Skip to content

Commit 732fc7a

Browse files
committed
pr.update() before processing PR labels while evaluating CI results
There is an intermittent email spam issue in rc: KPD tries to update PR labels, say from ci-fail to ci-pass, and immediately updates them back, causing an email notification on every iteration. The logic in the code is reasonable: we remove a "not_label" first, if it's in current labels, and add "new_label" and send a notification if it's not in current labels. The only odd thing that seems to be correlated with this behavior is forward proxy errors, which suggests failures when changing the pr (which makes calls github API). I noticed that KPD is looking at 2-3s old PR object in branch_worker.evaluate_ci_result(). While generally this shouldn't be an issue, let's add an explicit pr.update() call to make sure up to date labels are tested. The hypothesis is that KPD misbehavior might be caused by failed (or implicitly retried by proxy??) pr.remove_from_labels() / pr.add_to_labels() calls. If this is so, then adding pr.update() would shift the failure/retry to a less disruptive GET operation, which will "fix" KPD even if the proxy errors are still there. Differential Revision: D79931497 Reviewed-by: Jordan Rome <[email protected]> Signed-off-by: Ihor Solodrai <[email protected]>
1 parent 5f2c1c8 commit 732fc7a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel_patches_daemon/branch_worker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,7 @@ async def evaluate_ci_result(
12201220
new_label = StatusLabelSuffixes.FAIL.to_label(series.version)
12211221
not_label = StatusLabelSuffixes.PASS.to_label(series.version)
12221222

1223+
pr.update() # make sure we are looking at the up to date labels
12231224
labels = {label.name for label in pr.labels}
12241225
# Always make sure to remove the unused label so that we eventually
12251226
# converge on having only one pass/fail label for each version, come

0 commit comments

Comments
 (0)