Commit Graph

7 Commits

Author SHA1 Message Date
Silvan Mosberger
80202bd4fa ci/request-reviews: Avoid duplicates with different casings
It's possible to have different casings in OWNERS, so we need to handle
that

(cherry picked from commit e612b89953)
2024-10-15 01:06:13 +02:00
Lin Jian
9af45a7f85 ci/request-reviews: fix headRef to point to the PR head
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)
2024-10-15 01:06:10 +02:00
Silvan Mosberger
6e6a84a2a5 ci/request-reviews: Fix for branches starting with "pr"
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)
2024-10-15 00:45:07 +02:00
Silvan Mosberger
9115330873 ci/request-reviews: Make wrong base branch message hashes more transparent
Also, fix the description of the text

(cherry picked from commit c721e917ce)
2024-10-15 00:44:45 +02:00
Silvan Mosberger
59990c7e75 ci/request-reviews: Request reviews for individual team members
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)
2024-10-15 00:35:26 +02:00
Silvan Mosberger
16b54e1afb ci/request-reviews: Don't rerequest users that already reviewed
The automation should never rerequest reviews from users that already
reviewed the changes, which is what was happening before this change:

https://github.com/NixOS/nixpkgs/pull/347354#event-14570645380

Also reorder the arguments to make more sense

(cherry picked from commit 9a054bb9dd)
2024-10-15 00:35:23 +02:00
Silvan Mosberger
2eb82ca074 ci: Add review request scripts
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)
2024-10-15 00:29:40 +02:00