-
Notifications
You must be signed in to change notification settings - Fork 283
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
ci(github): fix path filtering of required but skipped workflows #2977
Merged
petermetz
merged 1 commit into
hyperledger-cacti:main
from
petermetz:ci-fix-path-filtering-required-but-skipped-checks
Jan 17, 2024
Merged
ci(github): fix path filtering of required but skipped workflows #2977
petermetz
merged 1 commit into
hyperledger-cacti:main
from
petermetz:ci-fix-path-filtering-required-but-skipped-checks
Jan 17, 2024
Conversation
This file contains 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
petermetz
requested review from
takeutak,
izuru0,
jagpreetsinghsasan,
VRamakrishna,
sandeepnRES and
outSH
as code owners
January 15, 2024 19:43
outSH
approved these changes
Jan 16, 2024
petermetz
force-pushed
the
ci-fix-path-filtering-required-but-skipped-checks
branch
from
January 17, 2024 03:55
76d2414
to
5bcd009
Compare
sandeepnRES
reviewed
Jan 17, 2024
sandeepnRES
reviewed
Jan 17, 2024
sandeepnRES
approved these changes
Jan 17, 2024
sandeepnRES
force-pushed
the
ci-fix-path-filtering-required-but-skipped-checks
branch
from
January 17, 2024 14:18
8ae311e
to
7fb8d8f
Compare
1. Migrated from the stock GitHub Actions yaml syntax to using this custom action[1] that allows us to skip the running of jobs based on path filtering. The difference compared to the old solution is that this one won't just skip the checks that are marked as required but it will pass them instead. 2. This is a suboptimal solution because we have to run each job so that the code can be checked out and then examined for changes. This uses resources that we should not have to expend, but currently there's no way to avoid this because of the way the GitHub handles required checks that are skipped (which cause a deadlock on the CI at the currently). 3. There is a relevant discussion thread about the problem here [2] which should be voted on heavily so that it gets the necessary attention from the product teams at GitHub. Quoting the relevant part of the GitHub documentation directly: > Handling skipped but required checks > Warning: If a workflow is skipped due to path filtering, branch > filtering or a commit message, then checks associated with that workflow > will remain in a "Pending" state. A pull request that requires those > checks to be successful will be blocked from merging. > > For this reason you should not use path or branch filtering to skip > workflow runs if the workflow is required. For more information, see > "Skipping workflow runs" and "Required workflows." > > If, however, a job within a workflow is skipped due to a conditional, > it will report its status as "Success". For more information, see > "Using conditions to control job execution." **Source** (link broken into multiple lines to avoid it being longer than 100 characters): https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/ collaborating-on-repositories-with-code-quality-features/ troubleshooting-required-status-checks#handling-skipped-but-required-checks [1] https://github.com/dorny/paths-filter [2] https://github.com/orgs/community/discussions/44490 Signed-off-by: Peter Somogyvari <[email protected]> Signed-off-by: Sandeep Nishad <[email protected]>
sandeepnRES
force-pushed
the
ci-fix-path-filtering-required-but-skipped-checks
branch
from
January 17, 2024 15:20
7fb8d8f
to
6465e93
Compare
@sandeepnRES Thank you very much for the help and the optimizations! |
petermetz
deleted the
ci-fix-path-filtering-required-but-skipped-checks
branch
January 17, 2024 23:48
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.
action[1] that allows us to skip the running of jobs based on path filtering.
The difference compared to the old solution is that this one won't just
skip the checks that are marked as required but it will pass them instead.
the code can be checked out and then examined for changes. This uses
resources that we should not have to expend, but currently there's no way
to avoid this because of the way the GitHub handles required checks that
are skipped (which cause a deadlock on the CI at the currently).
should be voted on heavily so that it gets the necessary attention from
the product teams at GitHub.
Quoting the relevant part of the GitHub documentation directly:
Source (link broken into multiple lines to avoid it being longer than
100 characters):
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/
collaborating-on-repositories-with-code-quality-features/
troubleshooting-required-status-checks#handling-skipped-but-required-checks
[1] https://github.com/dorny/paths-filter
[2] https://github.com/orgs/community/discussions/44490
Pull Request Requirements
upstream/main
branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.-s
flag when usinggit commit
command. You may refer to this link for more information.Character Limit
A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.