txt_roll: Return a list of Roll objects
Bug: b/341756093
Change-Id: I25d0df455fa79d96bfabddcdac73fae657d6733c
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/230835
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Danielle Kay <danikay@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
diff --git a/recipe_modules/txt_roll/api.py b/recipe_modules/txt_roll/api.py
index d879fb1..12dfb24 100644
--- a/recipe_modules/txt_roll/api.py
+++ b/recipe_modules/txt_roll/api.py
@@ -38,7 +38,7 @@
self,
checkout: checkout_api.CheckoutContext,
txt_entry: TxtEntry,
- ) -> dict[str, roll_util_api.Roll] | None:
+ ) -> list[roll_util_api.Roll]:
branch = txt_entry.branch or 'main'
new_revision = self.m.git_roll_util.resolve_new_revision(
@@ -89,17 +89,17 @@
old_revision,
new_revision,
)
- return
+ return []
with self.m.step.nest('txt_path') as pres:
pres.step_summary_text = repr(txt_entry.path)
- return {
- txt_entry.path: self.m.roll_util.create_roll(
+ return [
+ self.m.roll_util.create_roll(
project_name=txt_entry.path,
old_revision=old_revision,
new_revision=new_revision,
proj_dir=project_dir,
direction=direction,
),
- }
+ ]
diff --git a/recipes/txt_roller.py b/recipes/txt_roller.py
index 1c45c7f..ec22503 100644
--- a/recipes/txt_roller.py
+++ b/recipes/txt_roller.py
@@ -70,9 +70,7 @@
if not rolls:
return # pragma: no cover
- authors: Sequence[api.roll_util.Account] = api.roll_util.authors(
- *rolls.values()
- )
+ authors: Sequence[api.roll_util.Account] = api.roll_util.authors(*rolls)
author_override: Optional[api.roll_util.Account] = None
if len(authors) == 1 and props.forge_author:
@@ -83,7 +81,7 @@
change: api.auto_roller.GerritChange = api.auto_roller.attempt_roll(
props.auto_roller_options,
repo_dir=checkout.root,
- commit_message=api.roll_util.message(*rolls.values()),
+ commit_message=api.roll_util.message(*rolls),
author_override=author_override,
)