Conversation
Just thought. Another way we could handle that would be to make the job name dynamic. E.g. it is named |
MattSturgeon
left a comment
There was a problem hiding this comment.
A fundamental issue here may be the security limitations applied to the pull_request trigger when the PR is from a fork.
This would imply that to run the test.yml workflow, you must push your PR branch to the non-fork nixpkgs repo rather than to your fork.
This would be especially inconvenient for non-committers.
Is it possible to configure these workflows so that they run as much as possible when the secrets are not available?
One complication is that you also cannot use secrets in if conditions, although you can have a step check whether a secret is non-empty and write to GITHUB_OUTPUT. I guess you could do something similar with permissions, maybe using the permissions REST API endpoint?
That's exactly my thought on how to handle this additionally. I find |
Note that this is already the case - this PR doesn't change anything in that regard. We already have the case that:
There's not much we can do different here without tripping up To clarify: The |
71c7fa1 to
0d225f3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
0d225f3 to
bb79ee9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
bb79ee9 to
f8fd0ed
Compare
.github/workflows/test.yml
Outdated
There was a problem hiding this comment.
f8fd0ed to
701007c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
These were left-over from when the eval workflow still had the labeling and reviewer components.
701007c to
3053443
Compare
|
(resolved another one of my own merge conflicts...) |
Came up with a different, imho much better, because less hacky, approach in #435929. |
3053443 to
48cc902
Compare
|
Just added the Other than the stuff mentioned above, I'm hoping this will also help with unnecessarily scheduled jobs in haskell-updates. Currently, the pull_request trigger fires in #429810 all the time, even though the "Files" tab doesn't show any changes to the workflows. Seems like the |
This workflow runs the PR and Push workflow files on a `pull_request` trigger. The intent is to test changes to the workflow files immediately. Previously, these were run directly from the respective workflow files. The new approach allows us to move the logic to run this only when workflow files changed from the pull_request trigger into a job. This has the advantage that older jobs are cleaned up, when the PR changes from a state of "workflow files changed" to "no workflow files changed". This can happen when changing a PR's base from staging to master, in which case changes from master would temporarily appear in the PR as changes. When these include changes to workflow files, this would trigger the PR workflow via `pull_request`. Once the base is changed, the PR is closed and re-opened, so CI runs again - but since it's on the same commit and the new run doesn't trigger `pull_request`, the results of the previous run are still kept and displayed. These results may include cancelled or failed jobs, which are impossible to recover from without another force-push. Checking this condition at run-time is only possible, because we move it into a separate workflow, turning the `pr.yml` workflow into a re-usable workflow. This will make sure to skip the whole workflow at once, when no change was detected, which will prevent the "no PR failures" job from appearing as skipped - which would imply "success" and make the PR mergeable immediately. Instead the "no PR failures" job is not shown at all for this trigger, which is generally what we want. Do the same for `push.yml` for consistency.
Previously, the test for the push workflow was running on the HEAD commit of the PR only. It would be better to run it on the merged result instead, just like any other tests we run in a PR.
Changes to the merge-group workflow should also validate that the file is hooked up correctly and works - otherwise we risk merging CI changes that cause the merge queue to fail consistently.
48cc902 to
534d41e
Compare
|
Successfully created backport PR for |
(1st commit from #435526, 2nd and 3rd from #435535 - the latter is needed to avoid name conflicts of artifacts between the push and pr parts of this new workflow)
This workflow runs the PR and Push workflow files on a
pull_requesttrigger. The intent is to test changes to the workflow files immediately. Previously, these were run directly from the respective workflow files.The new approach allows us to move the logic to run this only when workflow files changed from the pull_request trigger into a job. This has the advantage that older jobs are cleaned up, when the PR changes from a state of "workflow files changed" to "no workflow files changed". This can happen when changing a PR's base from staging to master, in which case changes from master would temporarily appear in the PR as changes. When these include changes to workflow files, this would trigger the PR workflow via
pull_request. Once the base is changed, the PR is closed and re-opened, so CI runs again - but since it's on the same commit and the new run doesn't triggerpull_request, the results of the previous run are still kept and displayed. These results may include cancelled or failed jobs, which are impossible to recover from without another force-push.Checking this condition at run-time is only possible, because we move it into a separate workflow, turning the
pr.ymlworkflow into a re-usable workflow. This will make sure to skip the whole workflow at once, when no change was detected, which will prevent the "no PR failures" job from appearing as skipped - which would imply "success" and make the PR mergeable immediately. Instead the "no PR failures" job is not shown at all for this trigger, which is generally what we want.Do the same for
push.ymlfor consistency. Also adds themerge_group.ymlfile to the test workflow to confirm we don't break that.Note: This does not fully disable the "no PR failures" job for
pull_requesttriggers, yet. It only affects the special case when switching branches in a PR. There will still be a second change required for the more general case, i.e. auto-merging a CI-related PR, which might trigger either of the two "no PR failures" jobs first and thus ignore the other.Things done
Add a 👍 reaction to pull requests you find important.