bazel: Add extra_args option

Bug: b/391649137
Change-Id: I252ba41ecdb8e2030fb23abf92e3c765d3798803
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/262379
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
diff --git a/recipe_modules/bazel/api.py b/recipe_modules/bazel/api.py
index 0c4a961..a1f512c 100644
--- a/recipe_modules/bazel/api.py
+++ b/recipe_modules/bazel/api.py
@@ -186,6 +186,7 @@
                             self.ensure(),
                             *args,
                             *base_args,
+                            *self.options.extra_args,
                         ]
 
                         with self.api.step.nest(shlex.join(args)):
diff --git a/recipe_modules/bazel/options.proto b/recipe_modules/bazel/options.proto
index 988eba1..4c6ffca 100644
--- a/recipe_modules/bazel/options.proto
+++ b/recipe_modules/bazel/options.proto
@@ -32,6 +32,9 @@
 
   // Names of presubmit "programs" to execute from the file at config_path.
   repeated string program = 5;
+
+  // Extra args to pass into Bazel for each invocation.
+  repeated string extra_args = 6;
 }
 
 message BazelInvocation {