Problem/Motivation
Currently, the test-only job relies on a rebased MR to detect the changes and then do the rest of the logic. If the MR is not rebased, it will pick up other files not changed at all in the current MR.
Steps to reproduce
Create an MR against 11.x, wait until the next commit in 11.x, then run the "Test-only" job, you'll see that the list of files changed shown in the job contains more files than the ones that were changed in the MR.
Proposed resolution
Use a different "git diff" logic to detect the exact changes of the MR.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #3
fjgarlin commentedThe files reported here https://git.drupalcode.org/issue/drupal-3401971/-/jobs/341345 were the correct ones, even if the MR needs a rebase.
The fix I made was suggested here: https://stackoverflow.com/questions/68260856/gitlab-diff-between-merge-r...
Comment #4
smustgrave commentedThis would be huge. Thanks for linking to the stackoverflow for reference.
Comment #7
catchCommitted/pushed to 11.x and cherry-picked to 10.2.x, thanks!
Comment #8
wim leers🙏🙏🙏🙏🙏🙏
🤩🤩🤩🤩🤩🤩
Comment #9
smustgrave commentedLooking very forward to trying this out today
Comment #10
fjgarlin commentedI've been getting
fatal: bad object 7ddc1b8e0e312c46b62b8fecf49cf5795323052din certain jobs (ie: https://git.drupalcode.org/issue/drupal-3395977/-/jobs/353396).This seems to be due to the shallow clone depth, which is set to 20.
Reference: https://docs.gitlab.com/ee/ci/pipelines/settings.html#limit-the-number-o...
We are currently setting this value to a low number
GIT_DEPTH: "3"currently in the.gitlab-ci.ymlfileWe might need to set this variable to a bigger value. Investigating...
Comment #11
wim leersCan we not simply override that only for the "test only" job? Since that's manually triggered anyway, the extra load would be minimal?
Comment #13
fjgarlin commentedThat's exactly what I did :-)
MR is ready for review: https://git.drupalcode.org/project/drupal/-/merge_requests/5451/diffs
The failing job where I discovered is no longer failing: https://git.drupalcode.org/issue/drupal-3395977/-/jobs/353569
I went with 50 but happy for that to be changed to whatever makes the most sense.
Comment #14
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #15
fjgarlin commentedRebased.
Comment #16
smustgrave commentedFailure appears random.
Comment #19
catchCommitted/pushed the follow-up to 11.x and 10.2.x, thanks!
Comment #20
alexpott