workflows/eval: run when base branch changed#372475
workflows/eval: run when base branch changed#372475wolfgangwalther merged 1 commit intoNixOS:masterfrom
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? |
infinisil
left a comment
There was a problem hiding this comment.
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).
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? |
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. |
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.
495d41d to
9b01e09
Compare
|
I changed this to a much simpler approach: Whenever a pull request is edited we run a custom workflow. This runs its only job only when the edited event was caused by a change of the base branch. If that's the case, the job closes and re-opens the PR. This will trigger an entirely new CI run. Advantages:
Test run was here: |
|
This PR in it's current state solves two problems:
Compared to my previous implementation this is nicely isolated in a single file and not overly complex. The only slightly odd thing is, that when you change the base branch of a PR, CI will close and immediately open it again. Since changing the base branch is a rather rare event, compared to editing titles and descriptions, I think this compromise is well worth it. Since there was no objection to this approach, I will go ahead with it. |
|
Successfully created backport PR for |




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 = relaxedsandbox = truenix-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.