workflows/check-by-name: Trigger on base branch changes#282707
Merged
infinisil merged 1 commit intoNixOS:masterfrom Jan 24, 2024
Merged
workflows/check-by-name: Trigger on base branch changes#282707infinisil merged 1 commit intoNixOS:masterfrom
infinisil merged 1 commit intoNixOS:masterfrom
Conversation
Not doing this can cause CI to report a misleading result when it wasn't retriggered after a base branch change.
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
13 tasks
This was referenced Feb 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
In a PR there was an odd failure of the
pkgs/by-namecheck: After a base branch change, it seemingly complained about new non-pkgs/by-namepackages introduced by the PR (see #275539 that introduced this new check). Even though the PR only had a single unrelated commit on top of staging at that point.Why did this happen? Here's the series of events leading to that:
PR opened with
masteras the base branchThis triggered CI, completing successfully
Marked as draft, presumably to avoid the many review requests when changing the base branch in the next step
Force pushed, presumably to staging + the changes
At this point, master is still the base branch, and if the PR were merged at that point, master would've gotten all commits from staging.
Since the
pkgs/by-namechecker compares the PR against the base branch of it, it correctly failed with the packages that would've been new on master and aren't usingpkgs/by-nameyet!Also this can only cause failures right now because the two new relevant packages in staging were merged before
pkgs/by-namestarted being enforced (Vulkan 1.3.275 #281591 and libplacebo: 5.264.1 -> 6.338.1 #269415). Now thatpkgs/by-nameis being enforced (notably for all base branches), it's going to get very improbable.Only afterwards, the base branch was changed to staging.
However, the
pull_request_targetGitHub Actions event doesn't trigger for base branch changes by default!One way to "fix" that is to instead push the merge base of the old and new base branch before switching. This way you also won't have to mark it as a draft to avoid requesting reviews by everybody.
But the better fix is to make CI retrigger when the base branch changes!
This work is sponsored by Tweag and Antithesis ✨
Changes
This PR changes the
pkgs/by-namecheck workflow to also trigger when the base branch changes. This type of event doesn't trigger CI by default:Instead it's part of the
editedevent, which however also triggers in other cases:However, this workflow is fairly quick, and PR's don't get edited that often, so it shouldn't be a problem.
Ping @zeuner
Things done
Add a 👍 reaction to pull requests you find important.