Skip to content

Commit

Permalink
ci/request-reviews: fix headRef to point to the PR head
Browse files Browse the repository at this point in the history
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 f4c6e11)
  • Loading branch information
jian-lin authored and infinisil committed Oct 14, 2024
1 parent 6e6a84a commit 9af45a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ci/request-reviews/request-reviews.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ git -C "$tmp/nixpkgs.git" remote add fork https://github.com/"$prRepo".git
git -C "$tmp/nixpkgs.git" config remote.fork.partialclonefilter tree:0
git -C "$tmp/nixpkgs.git" config remote.fork.promisor true

# Our local branches mirror Nixpkgs, so make sure to not try to update any to avoid conflicts
git -C "$tmp/nixpkgs.git" fetch --no-tags fork "$prBranch"
headRef=$(git -C "$tmp/nixpkgs.git" rev-parse HEAD)
headRef=$(git -C "$tmp/nixpkgs.git" rev-parse refs/remotes/fork/"$prBranch")

log "Checking correctness of the base branch"
if ! "$SCRIPT_DIR"/verify-base-branch.sh "$tmp/nixpkgs.git" "$headRef" "$baseRepo" "$baseBranch" "$prRepo" "$prBranch" | tee "$tmp/invalid-base-error" >&2; then
Expand Down

0 comments on commit 9af45a7

Please sign in to comment.