-
Notifications
You must be signed in to change notification settings - Fork 4.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
ci: make git-diff-develop work for PRs from foreign repos #27268
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ef03847
ci: make git-diff-develop work for PRs from foreign repos
legobeat 91ce41d
ci: git-diff-develop does not depend on prep-deps
legobeat 978eae7
ci: get-changed-files-with-git-diff: stable branch names
legobeat 04e5f48
prettier
legobeat c554b95
back-ported changes from #27548
HowardBraham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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'm noticing a problem here: we're comparing against the base branch, not the base commit. And similarly, we're comparing the current branch, not the current commit. This is problematic because the results are now dependent upon the exact timing of when this runs, and they're comparing changes made to develop that aren't in the target branch yet.
We're using this diff as a measure of what has changed in the PR, but because we're not comparing with the correct commit, we're going to get skewed results (as changes are made to
develop
, or asdevelop
is merged into the PR, etc.). This problem is in the original implementation as well though, not introduced here.I will follow up on this separately. We have fixed this same problem already elsewhere, we can fix it here too without much effort.
Edit: On second thought, it's just the reference to the current branch that is problematic, because when a later commit is made it would impact the CI run of prior commits.
Using
origin/develop
as the point of comparison is less problematic. In theory it still makes this less deterministic, but maybe not in a way that matters (e.g. it could result in the diff getting smaller if some portion of the branch was merged as a separate PR, but the results would be equally "correct" in a sense).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.
Given that this is just used to run modified tests additional times, I'm having a hard time imagining a scenario where this has a negative impact, despite it being technically incorrect. I'm thinking maybe this is fine, not worth fixing for now.