-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workflows/eval: run when base branch changed #372475
base: master
Are you sure you want to change the base?
workflows/eval: run when base branch changed #372475
Conversation
6c24f43
to
941a690
Compare
Now tested. Forgot to pass through permission for the tag job, fixed. It works. Here's how:
Not visible on the second screenshot, yet: We are also running eval again after the base branch change, which is the point of all of this: All of that happened in wolfgangwalther#632. |
@infinisil WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed it for now. Clever! Though also rather messy 😅, so I'm a bit undecided whether we should have this.
Advantages:
- Doesn't run CI when PR title/body is changed.
- Less resource usage
- No more waiting for CI in such cases.
Disadvantages:
- Temporarily messy and potentially confusing CI results in the rare case of changing the base branch
- Duplicated parts in the workflows
- More complexity
Based on that, and unless I'm missing anything, I don't feel inclined to have this. Instead it would be best for GitHub to address https://github.com/orgs/community/discussions/64119 so that we don't need such a workaround, I've made a comment about that in NixOS/foundation#25 (comment).
@@ -8,7 +8,7 @@ name: Check that Nix files are formatted | |||
|
|||
on: | |||
pull_request_target: | |||
types: [opened, synchronize, reopened, edited] | |||
workflow_call: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines should have some generic comment indicating that it's used via edited-base.yml
It's the least messy, at least by output, that I could make it :D, but yes I agree.
This happens quite frequently to me, when I'm merging backport PRs. Building and testing stuff, then going through a final check of the changelog.. yeah all, good set the checkmark "acceptable for release".. ah, damn CI is running again. I merge in those cases and don't wait for CI, but I'll always get error notifications, because those jobs can't finish when the PR's branch is suddenly gone.
My idea was to come back with more of the same. In this case it's technically a "correctness" issue, so I did that first. But I also think the following is quite annoying: I have a ton of checks.. and those visible at the top are always a list of "get-merge-commit", because we run this so often. With the same approach as in edited-base.yml, i.e. calling those other workflows via workflow_call, we could run the merge-commit job once and pass the result to all other workflows. This would give us much less cluttered output. One more step would then be to collect most of the small "check" jobs into a single job, so it only appears once. I really don't need to see maintainers-sorted, nix-format, nixf-tidy, editorconfig etc. etc. all in separate jobs in the list. They are almost never failing and I could easily look it up which step failed. My goal: Make the "check list" usable without scrolling. Not everything, but at least have useful information at the top already. We could probably make this a bit easier to understand in the Doing it this way would also give us a nice overview of: One file has all the jobs that will run on a branch push, one file has all the jobs that will run on a PR, ... Potentially easier to reach consistent results with that.
Hopefully my vision above changes your mind ;) Or.. maybe you have other ideas about the issues mentioned? |
We intend to use the edited event to react to base branch changes - but before this change, we also ran those jobs on simple edits like title or description. While this works for some of the quicker jobs, it will not be sustainable for all evaluation-related jobs. But evaluation needs to be re-triggered on a base branch change as well, thus this change.
When the base branch changes, we need to run full eval again, because the changed output paths depend on the base branch.
941a690
to
495d41d
Compare
I really like this idea. The selection logic being under workflow control seems like the only way to avoid fatigue over there being yet another check that I need to run locally prior to proposing a PR... and is directionally aligned with running CI locally, outside of GitHub, so we can replicate locally what it would do. |
Marked as draft for now. I will come back to it, but will do other things first. |
This is based on #371216, so the biggest chunk of commits is from that PR and should be reviewed / commented on there.
Only the last two commits are relevant for this PR. Here, we first change the way we react to the "edited" event for pull_request_target. This avoids running jobs when only title or description of a PR change. This then allows us to run eval on base branch changes as well, without triggering those on small edits all the time.
Tested the concepts, but not the final PR in that constellation, yet.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.