Skip to content

rules:changes: Ensure changes triggers on files exceeding diff limit

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

  1. Spin up the GDK
  2. Create a repo
  3. Create a file and add it to the repository
  4. Create a CI config including a changes stanza on the path to the file added in 2. Ensure that is the only trigger (do not use compare_to)
  5. Commit both
  6. 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)
  7. Commit all changed files
  8. 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)

The Feature Flag issue.

Edited by Kasia Misirli

Merge request reports

Loading