I’m working remotely today and went to download my PR series ending at [amdgpu-cfi: 9/9]: [AMDGPU][MC] Replace shifted registers in CFI instructions by slinder1 · Pull Request #183147 · llvm/llvm-project and noticed that (our?) bot deleted every branch:
Oddly it seems to have done it repeatedly?
I assume this is because of an ongoing PR outage at GH: GitHub Status - Incomplete pull request results in repositories
Best I can guess is that:
- We have a bot to clean up user branches which aren’t associated with a PR
- The ongoing outage made my PRs invisible to the bot
- It cleaned them up
- Possibly this all happened again when the branches were restored as part of the mitigation on GH’s end but the PR wasn’t fully restored yet
If this is true I guess there isn’t anything to be done, but I wanted to know if my assumptions here are accurate. Do we have any log of the bot actions to check?
This sounds right. The bot did delete a large number of branches yesterday and I got a report from a coworker about the same thing happening. I disabled it last evening in case it continues to be broken ([Github] Disable prune-unused-branches workflow (#194773) · llvm/llvm-project@a6187c0 · GitHub).
I did not realize there was an outage yesterday causing incomplete pull requests, so thank you for pointing that out. I will make sure the bot takes some more measures before deleting branches to hopefully avoid anything like this happening in the future.
Sorry for the inconvenience here. In case people do not have the branches available locally to push anymore, all of the diffs from main are available in the BranchDiffs workflow artifact in Prune Unused Branches · llvm/llvm-project@a54419a · GitHub , which should be applicable against a recent main to restore the state of any of the deleted branches.
2 Likes
Thank you for the fast response and the details! I do have the branches in my case, but I’m going to wait until the outage is resolved on GHs side.
Sorry for the inconvenience here. In case people do not have the branches available locally to push anymore, all of the diffs from main are available in the BranchDiffs workflow artifact in Prune Unused Branches · llvm/llvm-project@a54419a · GitHub , which should be applicable against a recent main to restore the state of any of the deleted branches.
Related Github pro-tip: you can add .patch to any PR URL to get the latest state as a patch file, even if the original branch or even contributor fork was deleted (which sometimes otherwise completely breaks the UI and may even report 404 PR not found). You can also fetch the commit associated with any PR using git fetch using the ref pull/<NUM>/head, or with the gh tool.
1 Like
TIL the patch ref doesn’t depend on the branch. I hadn’t even tried it once I failed to pull the branch. Thanks!
In case it is useful to anyone, these are the git aliases I use to avoid using gh for this:
# subject
ascii-subject = "!f() { git rev-list --format=format:%s --no-commit-header --max-count=1 \"$1\" | tr '[:upper:]' '[:lower:]' | sed -E -e 's/\\(#[0-9]+\\)//g' -e \"s/'//g\" -e 's/[^a-z0-9]/ /g' -e 's/^\\s+//' -e 's/\\s+$//' -e 's/\\s+/_/g'; }; f"
# github PRs
pr-pull = "!f() { \
git fetch --quiet $1 pull/$2/head:PULL_PR_TEMP || exit 1; \
local branch=pr/$1/$2_$(git ascii-subject PULL_PR_TEMP); \
git fetch $1 pull/$2/head:$branch && \
git switch --no-guess $branch; \
git branch --quiet -D PULL_PR_TEMP; \
}; f"