From 1411ebaf2a4ede351aef77ec6732c2bfc0bca9f3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 13 Sep 2024 03:07:38 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- GITLAB_KAS_VERSION | 2 +- doc/ci/yaml/includes.md | 92 +++++++++++++++++++++++++++-------------- spec/spec_helper.rb | 4 ++ 3 files changed, 65 insertions(+), 33 deletions(-) diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION index c3f7c609183..7e633a52312 100644 --- a/GITLAB_KAS_VERSION +++ b/GITLAB_KAS_VERSION @@ -1 +1 @@ -bfae77d1f4867c0fc8d7a9b22c68f7f4a7e98d19 +63a9bf2c6fc43278a115463153a965b521224a02 diff --git a/doc/ci/yaml/includes.md b/doc/ci/yaml/includes.md index 9229ec3211e..dbab3aff294 100644 --- a/doc/ci/yaml/includes.md +++ b/doc/ci/yaml/includes.md @@ -310,66 +310,94 @@ default: - echo "Job complete." ``` -### Use nested includes with duplicate `includes` entries +### Use nested includes with duplicate `include` entries -Nested includes can include the same configuration file. The duplicate configuration -file is included multiple times, but the effect is the same as if it was only -included once. +You can include the same configuration file multiple times in the main configuration file and +in nested includes. -For example, with the following nested includes, where `defaults.gitlab-ci.yml` -is included multiple times: +If any file changes the included configuration using [overrides](#override-included-configuration-values), +then the order of the `include` entries might affect the final configuration. The last time +the configuration is included overrides any previous times the file was included. +For example: -- Contents of the `.gitlab-ci.yml` file: - - ```yaml - include: - - template: defaults.gitlab-ci.yml - - local: unit-tests.gitlab-ci.yml - - local: smoke-tests.gitlab-ci.yml - ``` - -- Contents of the `defaults.gitlab-ci.yml` file: +- Contents of a `defaults.gitlab-ci.yml` file: ```yaml default: - before_script: default-before-script.sh - retry: 2 + before_script: echo "Default before script" ``` -- Contents of the `unit-tests.gitlab-ci.yml` file: +- Contents of a `unit-tests.gitlab-ci.yml` file: ```yaml include: - template: defaults.gitlab-ci.yml + default: # Override the included default + before_script: echo "Unit test default override" + unit-test-job: script: unit-test.sh - retry: 0 ``` -- Contents of the `smoke-tests.gitlab-ci.yml` file: +- Contents of a `smoke-tests.gitlab-ci.yml` file: ```yaml include: - template: defaults.gitlab-ci.yml + default: # Override the included default + before_script: echo "Smoke test default override" + smoke-test-job: script: smoke-test.sh ``` -The final configuration would be: +With these three files, the order they are included changes the final configuration. +With: -```yaml -unit-test-job: - before_script: default-before-script.sh - script: unit-test.sh - retry: 0 +- `unit-tests` included first, the contents of the `.gitlab-ci.yml` file is: -smoke-test-job: - before_script: default-before-script.sh - script: smoke-test.sh - retry: 2 -``` + ```yaml + include: + - local: unit-tests.gitlab-ci.yml + - local: smoke-tests.gitlab-ci.yml + ``` + + The final configuration would be: + + ```yaml + unit-test-job: + before_script: echo "Smoke test default override" + script: unit-test.sh + + smoke-test-job: + before_script: echo "Smoke test default override" + script: smoke-test.sh + ``` + +- `unit-tests` included last, the contents of the `.gitlab-ci.yml` file is: + + ```yaml + include: + - local: smoke-tests.gitlab-ci.yml + - local: unit-tests.gitlab-ci.yml + ``` + +- The final configuration would be: + + ```yaml + unit-test-job: + before_script: echo "Unit test default override" + script: unit-test.sh + + smoke-test-job: + before_script: echo "Unit test default override" + script: smoke-test.sh + ``` + +If no file overrides the included configuration, the order of the `include` entries +does not affect the final configuration ## Use variables with `include` diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 65137f1bc2e..e86059d0243 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -349,6 +349,10 @@ RSpec.configure do |config| # See https://gitlab.com/gitlab-org/gitlab/-/issues/457283 stub_feature_flags(duo_chat_requires_licensed_seat_sm: false) + # This flag is for [Selectively disable by actor](https://docs.gitlab.com/ee/development/feature_flags/controls.html#selectively-disable-by-actor). + # Hence, it should not enable by default in test. + stub_feature_flags(v2_chat_agent_integration_override: false) if Gitlab.ee? + # Experimental merge request dashboard stub_feature_flags(merge_request_dashboard: false)