-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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] Improve fetching of changed files #89980
Merged
Merged
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
PRs always use a merge into the repo on checkout, so checking for `HEAD^1` will show all the changes regardless of the number of commits in a PR
AThousandShips
added
enhancement
topic:buildsystem
cherrypick:4.1
Considered for cherry-picking into a future 4.1.x release
cherrypick:4.2
Considered for cherry-picking into a future 4.2.x release
labels
Mar 28, 2024
Will add some broken files to demonstrate that it catches these cases:
Didn't know quite how to fix a file check one as it doesn't catch trailing newlines for some reason, and trailing whitespace is already caught by clang, so leaving with those two checks being confirmed |
AThousandShips
force-pushed
the
ci_better_fix
branch
3 times, most recently
from
March 28, 2024 13:35
53ad933
to
950743c
Compare
akien-mga
approved these changes
Mar 28, 2024
fire
approved these changes
Mar 28, 2024
Thanks! |
Thank you! |
Cherry-picked for 4.2.2. |
akien-mga
removed
the
cherrypick:4.2
Considered for cherry-picking into a future 4.2.x release
label
Apr 8, 2024
Cherry-picked for 4.1.4. |
akien-mga
removed
the
cherrypick:4.1
Considered for cherry-picking into a future 4.1.x release
label
Apr 8, 2024
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.
PRs always use a merge into the repo on checkout, so checking for
HEAD^1
will show all the changes regardless of the number of commits in a PR, as it represents the target commit of the mergeYou can see the improved results by comparing these two builds:
It appears the CI will still catch file formatting without the files (I think it runs on all files if none are specified) but this ensures the files are properly listed, and it seems to fail on some files in the existing version when it fails to fetch files (my bad):
The reason it partially worked (which I failed to notice because some CI checks run regardless and I didn't check other cases like header guards) was that for single commit PRs it did the correct thing, checking the merge commit against its first parent, which was correct, but with multiple commit it instead broke, unsure exactly what broke with it though, but this new change ensures it always picks the first parent of the merge and that will include all the changes and have them properly aligned with the merged state
Follow up to: