-
Notifications
You must be signed in to change notification settings - Fork 527
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
Compute affected tests in CI workflow is omitting targets affected by committed renamed files #4035
Comments
Follow-up: I thought the issue was because the merge-base was different between the branch & running it locally (I think this is because GitHub actually generates a merge commit which seems to combine the latest develop with the changes in the PR branch & then runs CI workflows against that merge commit). However, forcing CI workflow to use the HEAD commit for the PR didn't fix the issue (per https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit). Upon further investigation, I realized that there's a difference in Git versions. My local version is 2.7.4 where the script behaves correctly, and CI is using Git 2.34.1. Since GitHub updates our environment from underneath us, this is an undiscovered regression. Interestingly, the compute affected tests test suite didn't catch this despite using real Git (though the root cause is still unknown since it's not clear what the actual regression is yet). My guess is that a relatively new version of Git changed how it treats moved files reported in |
https://stackoverflow.com/a/10121060/3689782 provides some context here. |
git 2.9.0 was the version when rename detection was automatically enabled upon git diff (see https://github.com/git/git/blob/142430338477d9d1bb25be66267225fb58498d92/Documentation/RelNotes/2.9.0.txt#L33) so this issue has existed since the script was introduced in CI. |
https://stackoverflow.com/a/55839215/3689782 is a help, and I realize that all we need to add is |
Following up on #3022 (comment)
@BenHenning, with the case of private fun retrieveRenamedFiles(): List<String> {
val renamedFilesCommand = executeGitCommand("diff -M --name-status ${computeCommitRange()}")
return renamedFilesCommand.filter { it.startsWith("R") }
.map { it.split("\t")[1] }
} The command execution:
Would this be something that can be done with I tried implementing the same for ComputeAffectedTests by just including the renamedFiles lists to Changed Files Lists & Stack TracesInitial Changed Files List without moving files and adding the retrieval of renamed files method -
After moving CoverageReporter.kt from coverage/reporter -> coverage:
After moving CoverageReporter.kt from coverage/reporter -> coverage:
Seems to provide the newly moved filenames as the result, and could that also help with this - #4035 (comment) |
See #4020 (comment) for specifics. However, because the script is computing the wrong base branch, in some cases it may miss changes (such as was noticed in #4020) which is a serious problem since we won't end up running affected targets until after the PR is merged.
#4034 is my working PR to investigate.
The text was updated successfully, but these errors were encountered: