roll_util: Add extra label support to rollers
Add support to rollers for extra label arguments in the auto_roller
module.
Grabbing these arguments from roll_util module properties, so they don't
need to be retrieved and processed in each roller recipe.
Change-Id: I5c6bdae7e6034674e94840da2fb50a0427c9bb0b
Bug: 252
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/19621
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Gary Miguel <garymm@google.com>
diff --git a/recipe_modules/roll_util/api.py b/recipe_modules/roll_util/api.py
index 88c1a7f..96f8e5b 100644
--- a/recipe_modules/roll_util/api.py
+++ b/recipe_modules/roll_util/api.py
@@ -69,6 +69,11 @@
class RollUtilApi(recipe_api.RecipeApi):
+ def __init__(self, props, *args, **kwargs):
+ super(RollUtilApi, self).__init__(*args, **kwargs)
+ self.labels_to_set = {x.label: x.value for x in props.labels_to_set}
+ self.labels_to_wait_on = props.labels_to_wait_on
+
def _single_commit_roll_message(
self, project_name, commit, old_revision, new_revision
):