Skip to content

Commit

Permalink
Make sure to work on up-to-date PR data
Browse files Browse the repository at this point in the history
Summary:
As laid out in T168827021, we are prone to working with outdated PR data,
because the Python GitHub module we use caches state instead of re-requesting
it. This can be a source of trouble. In the above task it causes us to associate
GitHub CI Workflow runs for an outdated SHA-1 with an updated patchwork
series/pull request.
With this change we force an update of the pull request data to make sure that
`pr.head.sha` is up-to-date. Note that there really doesn't seem to be a single
best located for requesting such an update, so I am adding it where it's needed
at this point.

Reviewed By: anakryiko

Differential Revision: D50910044

fbshipit-source-id: e3ec61a4cb202917be1b73c1b372648f55ee054f
  • Loading branch information
danielocfb-test authored and facebook-github-bot committed Nov 2, 2023
1 parent bff6cc0 commit 192d653
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 @@ -893,6 +893,9 @@ async def subject_to_branch(self, subject: Subject) -> str:
return f"{await subject.branch}{HEAD_BASE_SEPARATOR}{self.repo_branch}"

async def sync_checks(self, pr: PullRequest, series: Series) -> None:
# Make sure that we are working with up-to-date data (as opposed to
# cached state).
pr.update()
# if it's merge conflict - report failure
ctx = f"{CI_DESCRIPTION}-{self.repo_branch}"
if _is_pr_flagged(pr):
Expand Down

0 comments on commit 192d653

Please sign in to comment.