Skip to content

Add internal_include_prepended=true to ProjectConfig source `Bridge`

Leaminn Ma requested to merge internal-include-true-for-bridge-source into master

What does this MR do and why?

This is a small follow-up correction to !112608 (merged) which resolved #391279 (closed).

In !112608 (merged) we added a new method called internal_include_prepended? to each ProjectConfig::Source that internally dumps an include into the pipeline config YAML. We use this value to determine whether or not to exclude this include from the total includes count in External::Mapper::Verifier. We added this method with the value true for all the applicable sources except for Bridge, which was an oversight.

Bridge does in fact inject an include via Bridge.yaml_for_downstream. So this source should have had internal_include_prepended? set to true. This MR makes that correction.

The result of this change is that a downstream pipeline config can have +1 more include files before reaching the maximum limit.

We have not yet had any reports of this issue so this is a preemptive correction. It was observed from !124231 (comment 1438651109).

How to reproduce

  1. In your Admin Settings, update your Maximum includes value to 1.
  2. Create 2 files in your project with the following contents:

config1.yml:

job1:
  script: echo

include: config2.yml

config2.yml:

job2:
  script: echo
  1. In your .gitlab-ci.yml file, update the contents with:
trigger-job:
  trigger:
    include: config1.yml

job0:
  script: echo
  1. Run your project pipeline and observe that the downstream pipeline errors even though config1.yml only has 1 include.

Screenshot_2023-06-30_at_1.18.42_PM

How to set up and validate locally

  1. Follow steps 1-4 from the above section.
  2. Check out this branch.
  3. After your gdk reloads, run your project pipeline again and observe that the downstream pipeline error no longer occurs.

Screenshot_2023-06-30_at_1.24.24_PM

  1. After conducting the above test, ensure you restore the original value for Maximum includes in your Admin settings.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Leaminn Ma

Merge request reports