Previously, headRef points to the master branch of Nixpkgs, which
basically means no code owner review will be requested.
The problem can be verified using the following command.
$ DRY_MODE=1 ./ci/request-reviews/request-reviews.sh NixOS/nixpkgs 347973 ci/OWNERS
[...]
This PR touches 0 files
Requesting reviews from: {
"reviewers": []
}
[...]
Additionally, the comment about conflicts is removed thanks to the
unambiguous way of specifying ref.
(cherry picked from commit f4c6e1174c)
Turns out if :<something> is passed, a local branch is updated, which
can conflict if the PR branch starts with "pr". I tried to avoid that
with the original code but apparently that didn't work!
https://github.com/NixOS/nixpkgs/actions/runs/11284183639/job/31384967152?pr=347822
Fetching the PR commit history
From https://github.com/linj-fork/nixpkgs
* [new branch] pr/kanata-add-version-check -> fork/pr
error: cannot lock ref 'refs/remotes/fork/pr/kanata-add-version-check': 'refs/remotes/fork/pr' exists; cannot create 'refs/remotes/fork/pr/kanata-add-version-check'
! [new branch] pr/kanata-add-version-check -> fork/pr/kanata-add-version-check (unable to update local ref)
error: some local refs could not be updated; try running
(cherry picked from commit 299a181477)
This effectively disables the native GitHub codeowners feature
and enables the new alternate codeowners mechanism introduced in
https://github.com/NixOS/nixpkgs/pull/336261
This means that:
- We can now declare users without write access as code owners!
- Targeting the wrong branch won't trigger mass pings anymore!
(cherry-picked from commit b01ca00aed)
This makes this codeowner mechanism behave differently than the native
one, but there's no other way to avoid rerequesting reviews from teams
when a member already reviewed the PR.
(cherry picked from commit 1ff83b2c96)
Also post a comment in case base branch is wrong
This guides newcomers in how to smoothly handle the potentially scary
situation of having thousands of commits listed in a PR.
While CI shows the same, people might not even look at CI if the PR
looks botched.
(cherry picked from commit 369cfa02da)
This is needed such that in the next commit, we can re-use the same
version from a shell.nix, allowing people to have a guaranteed matching
nixfmt version.
(cherry picked from commit b33ac05d04)