roll_commenter: Get change number out of dict
Get the change number out of the dict returned by number_for_hash()
instead of just using that dict as a number.
Bug: b/369718402
Change-Id: I076b20b731619014ec1ded8acf3083767934c3a5
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/254492
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
diff --git a/recipes/roll_commenter.expected/no_forward_progress.json b/recipes/roll_commenter.expected/no_forward_progress.json
index d483f69..3eb05c1 100644
--- a/recipes/roll_commenter.expected/no_forward_progress.json
+++ b/recipes/roll_commenter.expected/no_forward_progress.json
@@ -597,7 +597,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -623,10 +623,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -652,7 +652,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\", \"input\": {\"message\": \"1 roller failing:\\n\\n* [project/roll/foo-roller](https://cr-buildbucket.appspot.com/builder/project/roll/foo-roller)\", \"notify\": \"OWNER\", \"tag\": \"autogenerated:project:builder:bbid=8945511751514863184\"}, \"revision_id\": \"current\"}",
+ "{\"change_id\": \"1234\", \"input\": {\"message\": \"1 roller failing:\\n\\n* [project/roll/foo-roller](https://cr-buildbucket.appspot.com/builder/project/roll/foo-roller)\", \"notify\": \"OWNER\", \"tag\": \"autogenerated:project:builder:bbid=8945511751514863184\"}, \"revision_id\": \"current\"}",
"-output",
"/path/to/tmp/json"
],
@@ -678,7 +678,7 @@
"@@@STEP_LOG_LINE@json.output (exception)@No JSON object could be decoded@@@",
"@@@STEP_LOG_END@json.output (exception)@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\",@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\",@@@",
"@@@STEP_LOG_LINE@json.input@ \"input\": {@@@",
"@@@STEP_LOG_LINE@json.input@ \"message\": \"1 roller failing:\\n\\n* [project/roll/foo-roller](https://cr-buildbucket.appspot.com/builder/project/roll/foo-roller)\",@@@",
"@@@STEP_LOG_LINE@json.input@ \"notify\": \"OWNER\",@@@",
@@ -687,7 +687,7 @@
"@@@STEP_LOG_LINE@json.input@ \"revision_id\": \"current\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -748,7 +748,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -774,10 +774,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -803,7 +803,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\", \"input\": {\"message\": \"1 roller failing:\\n\\n* [project/roll/foo-roller](https://cr-buildbucket.appspot.com/builder/project/roll/foo-roller)\", \"notify\": \"OWNER\", \"tag\": \"autogenerated:project:builder:bbid=8945511751514863184\"}, \"revision_id\": \"current\"}",
+ "{\"change_id\": \"1234\", \"input\": {\"message\": \"1 roller failing:\\n\\n* [project/roll/foo-roller](https://cr-buildbucket.appspot.com/builder/project/roll/foo-roller)\", \"notify\": \"OWNER\", \"tag\": \"autogenerated:project:builder:bbid=8945511751514863184\"}, \"revision_id\": \"current\"}",
"-output",
"/path/to/tmp/json"
],
@@ -829,7 +829,7 @@
"@@@STEP_LOG_LINE@json.output (exception)@No JSON object could be decoded@@@",
"@@@STEP_LOG_END@json.output (exception)@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\",@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\",@@@",
"@@@STEP_LOG_LINE@json.input@ \"input\": {@@@",
"@@@STEP_LOG_LINE@json.input@ \"message\": \"1 roller failing:\\n\\n* [project/roll/foo-roller](https://cr-buildbucket.appspot.com/builder/project/roll/foo-roller)\",@@@",
"@@@STEP_LOG_LINE@json.input@ \"notify\": \"OWNER\",@@@",
@@ -838,7 +838,7 @@
"@@@STEP_LOG_LINE@json.input@ \"revision_id\": \"current\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -899,7 +899,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -925,10 +925,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1011,7 +1011,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1037,10 +1037,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1123,7 +1123,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1149,10 +1149,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1235,7 +1235,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1261,10 +1261,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1347,7 +1347,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1373,10 +1373,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1459,7 +1459,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1485,10 +1485,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1571,7 +1571,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1597,10 +1597,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1683,7 +1683,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1709,10 +1709,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1795,7 +1795,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1821,10 +1821,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1907,7 +1907,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1933,10 +1933,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
diff --git a/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned.json b/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned.json
index 88833a9..b28f4a4 100644
--- a/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned.json
+++ b/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned.json
@@ -597,7 +597,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -623,10 +623,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -732,7 +732,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -758,10 +758,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -846,7 +846,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -872,10 +872,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -958,7 +958,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -984,10 +984,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1070,7 +1070,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1096,10 +1096,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1182,7 +1182,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1208,10 +1208,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1294,7 +1294,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1320,10 +1320,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1406,7 +1406,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1432,10 +1432,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1518,7 +1518,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1544,10 +1544,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1630,7 +1630,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1656,10 +1656,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
@@ -1742,7 +1742,7 @@
"-host",
"https://pigweed-review.googlesource.com",
"-input",
- "{\"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"}",
+ "{\"change_id\": \"1234\"}",
"-output",
"/path/to/tmp/json"
],
@@ -1768,10 +1768,10 @@
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"{'_number': '1234', 'branch': 'main', 'project': 'pigweed'}\"@@@",
+ "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"1234\"@@@",
"@@@STEP_LOG_LINE@json.input@}@@@",
"@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/{'_number':%20'1234',%20'branch':%20'main',%20'project':%20'pigweed'}@@@"
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/1234@@@"
]
},
{
diff --git a/recipes/roll_commenter.py b/recipes/roll_commenter.py
index aaa7c58..351d556 100644
--- a/recipes/roll_commenter.py
+++ b/recipes/roll_commenter.py
@@ -381,10 +381,11 @@
host = api.gerrit.host_from_remote_url(
props.checkout_options.remote,
)
- number = api.checkout.number_for_hash(host, revision)
- if not number: # pragma: no cover
+ number_info = api.checkout.number_for_hash(host, revision)
+ if not number_info: # pragma: no cover
pres.step_summary_text = 'number not found'
continue
+ number = number_info['_number']
details = api.gerrit.change_details(
'details',