rules:changes: Ensure changes triggers on files exceeding diff limit
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
rules:changes: Determine changes via FindChangedPath RPC
Previously, the rules:changes trigger relied on the merge_request_diff_files association to determine changed files for a pipeline. This is subject to the diff_limits (i.e. 3k changed files, etc) which in the cases of very large changes, can result in a file, for which there is a changes trigger for a pipeline, not being processed by changes.
This MR switches from using pipeline.modified_paths to pipeline.changed_paths, which instead of using the merge_request_diff_files or the DiffStats gitaly RPC, uses the faster FindChangedPath gitaly RPC, which is also not subject to diff limits. This allows pipelines to trigger accurately on changes in the context of large diffs.
References
For more context on the approach see: #433257 (closed) and #433257 (comment 1722430360)
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Spin up the GDK
- Create a repo
- Create a file and add it to the repository
- Create a CI config including a
changesstanza on the path to the file added in 2. Ensure that is the only trigger (do not use compare_to) - Commit both
- Generate 3k files (or any number of files above your configured diff limit) and also modify the file(3) included in the trigger specified by (4)
- Commit all changed files
- Ensure pipeline is triggered
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #433257 (closed)