Skip to content

Commit

Permalink
Do not use results from previous series version
Browse files Browse the repository at this point in the history
Summary:
Previously, we could see the following sequence of events:

```
<v1 sent>
email: v1 fail
<v2 sent>
email: v2 fail       <<<
email: v2 success
```

`<<<` indicates that kpd was looking at the results from v1
but reporting against v2. This is confusing and wrong.

Example: kernel-patches/bpf#7070

 {F1647837371}

## Root cause

kpd, for each series on patchwork, does a reconcile-then-reap action.

In our case, during reconcile, kpd would:

1. Grab a handle to the existing PR
2. Remove v1 labels and add v2 labels
3. Force push the PR

At the end of reconciliation, the handle to the PR would have stale metadata
saying the PR HEAD still pointed to v1 (despite v2 already being pushed).

This means that when kpd goes to reap the results, it would filter workflow
runs based on the v1 sha, see the jobs have completed, and then report
the stale result against v2.

Fix by syncing the handle's metadata after a force push.

Reviewed By: chantra

Differential Revision: D57741395

fbshipit-source-id: 2974327c247b8bfc4028e566ab14254a53c9b891
  • Loading branch information
Daniel Xu authored and facebook-github-bot committed May 23, 2024
1 parent 454b980 commit 1dcda88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel_patches_daemon/branch_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ async def apply_push_comment(
can_create=True,
)
self.repo_local.git.push("--force", "origin", branch_name)
# Metadata inside `pr` may be stale from the force push; refresh it
if pr:
pr.update()
return pr
# we don't have a branch, also means no PR, push first then create PR
elif branch_name not in self.branches:
Expand Down

0 comments on commit 1dcda88

Please sign in to comment.