Skip to content

Commit 66ae313

Browse files
committed
publish_toolstate.py: further fix the runtime errors
The regex was missing a `,`, causing `relevant_pr_match` to become None and set the PR number to -1 and assigned the new issue to `@<unknown user>`. This causes the 422 error when creating the issue due to invalid assignee and unable to leave the tool-is-broken comment since PR -1 does not exist. The default user names are now also changed to @ghost to prevent the 422 error in case anything goes wrong again.
1 parent 8af675a commit 66ae313

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/publish_toolstate.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def update_latest(
171171

172172
# assume that PR authors are also owners of the repo where the branch lives
173173
relevant_pr_match = re.search(
174-
'Auto merge of #([0-9]+) - ([^:]+):[^,]+ r=([^\s]+)',
174+
r'Auto merge of #([0-9]+) - ([^:]+):[^,]+, r=(\S+)',
175175
cur_commit_msg,
176176
)
177177
if relevant_pr_match:
@@ -182,10 +182,10 @@ def update_latest(
182182
pr_reviewer = relevant_pr_match.group(3)
183183
else:
184184
number = '-1'
185-
relevant_pr_user = '<unknown user>'
185+
relevant_pr_user = 'ghost'
186186
relevant_pr_number = '<unknown PR>'
187187
relevant_pr_url = '<unknown>'
188-
pr_reviewer = '<unknown reviewer>'
188+
pr_reviewer = 'ghost'
189189

190190
message = update_latest(
191191
cur_commit,

0 commit comments

Comments
 (0)