diff --git a/config/feature_flags/gitlab_com_derisk/ci_matrix_expressions.yml b/config/feature_flags/gitlab_com_derisk/ci_matrix_expressions.yml deleted file mode 100644 index b8a42661e2f30e86cac6314383a450660f49668c..0000000000000000000000000000000000000000 --- a/config/feature_flags/gitlab_com_derisk/ci_matrix_expressions.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: ci_matrix_expressions -description: -feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/423553 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/205247 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/571105 -milestone: '18.5' -group: group::pipeline authoring -type: gitlab_com_derisk -default_enabled: false diff --git a/doc/ci/yaml/expressions.md b/doc/ci/yaml/expressions.md index e51ddaedbdcddc8a8ad1b32141de8a633dad74f9..e79d4273ac7250d194ee47695480048808140d59 100644 --- a/doc/ci/yaml/expressions.md +++ b/doc/ci/yaml/expressions.md @@ -65,18 +65,10 @@ scan-website: {{< history >}} -- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423553) in GitLab 18.6 [with a flag](../../administration/feature_flags/_index.md) named `ci_matrix_expressions`. Disabled by default. This feature is in [beta](../../policy/development_stages_support.md#beta). +- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423553) in GitLab 18.6. This feature is in [beta](../../policy/development_stages_support.md#beta). {{< /history >}} -{{< alert type="flag" >}} - -On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `ci_matrix_expressions`. -On GitLab.com and GitLab Dedicated, this feature is not available. -This feature is not ready for production use. - -{{< /alert >}} - Use the [`matrix.` context](matrix_expressions.md) to reference [`parallel:matrix`](_index.md#parallelmatrix) values by using a `$[[ matrix.IDENTIFIER ]]` syntax. Use it in job dependencies to enable dynamic 1:1 mappings between `parallel:matrix` jobs. diff --git a/doc/ci/yaml/matrix_expressions.md b/doc/ci/yaml/matrix_expressions.md index c7756d8d12c8922c1f78a1efd6068fe3c03013bc..7debba597f8383fab148558968131c1466787ddb 100644 --- a/doc/ci/yaml/matrix_expressions.md +++ b/doc/ci/yaml/matrix_expressions.md @@ -7,18 +7,10 @@ title: Matrix expressions in GitLab CI/CD {{< history >}} -- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423553) in GitLab 18.6 [with a flag](../../administration/feature_flags/_index.md) named `ci_matrix_expressions`. Disabled by default. This feature is in [beta](../../policy/development_stages_support.md#beta). +- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423553) in GitLab 18.6. This feature is in [beta](../../policy/development_stages_support.md#beta). {{< /history >}} -{{< alert type="flag" >}} - -On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../../administration/feature_flags/_index.md) named `ci_matrix_expressions`. -On GitLab.com and GitLab Dedicated, this feature is not available. -This feature is not ready for production use. - -{{< /alert >}} - Matrix expressions enable dynamic job dependencies based on [`parallel:matrix`](_index.md#parallelmatrix) identifiers, to create 1:1 mappings between `parallel:matrix` jobs. diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index a6c20dd59ed0e187a5f2cedc2b0f2451457160fc..dbbe60ec31fbd4d0403c708d229130b7590b3386 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -133,10 +133,7 @@ def workflow_auto_cancel end def normalized_jobs - # Remove with_actor wrapper when ci_matrix_expressions FF is removed - @normalized_jobs ||= Gitlab::Ci::Config::FeatureFlags.with_actor(@project) do - normalizer.normalize_jobs - end + @normalized_jobs ||= normalizer.normalize_jobs end def normalizer_errors diff --git a/lib/gitlab/ci/config/normalizer.rb b/lib/gitlab/ci/config/normalizer.rb index 7ce5ec47316992b2b0b702d02f40c8d8b27970b2..31f28864d066d498251f73751c3037b5a0cb4fb0 100644 --- a/lib/gitlab/ci/config/normalizer.rb +++ b/lib/gitlab/ci/config/normalizer.rb @@ -80,8 +80,7 @@ def expand_parallelize_jobs parallelized_jobs[job_name].each do |job| merged_config = config.deep_merge(job.attributes) - if job.attributes[:job_variables] && merged_config[:needs] && - FeatureFlags.enabled?(:ci_matrix_expressions) + if job.attributes[:job_variables] && merged_config[:needs] interpolator = Interpolation::MatrixInterpolator.new(job.attributes[:job_variables]) interpolated_needs = interpolator.interpolate(merged_config[:needs]) diff --git a/spec/lib/gitlab/ci/config/normalizer_spec.rb b/spec/lib/gitlab/ci/config/normalizer_spec.rb index c54811ce5993d4e5e6356899b6e6f35b0f2d74ca..0f8b824fa6214980e4380aea34112e9673a4b4e7 100644 --- a/spec/lib/gitlab/ci/config/normalizer_spec.rb +++ b/spec/lib/gitlab/ci/config/normalizer_spec.rb @@ -389,10 +389,7 @@ end subject(:normalized_jobs) do - # Remove with_actor wrapper when ci_matrix_expressions FF is removed - Gitlab::Ci::Config::FeatureFlags.with_actor(nil) do - described_class.new(config).normalize_jobs - end + described_class.new(config).normalize_jobs end it 'interpolates matrix expressions in needs configuration' do @@ -446,12 +443,7 @@ it 'collects errors for missing matrix variables and leaves config unchanged' do normalizer = described_class.new(config) - - # Remove with_actor wrapper when ci_matrix_expressions FF is removed - normalized_jobs = Gitlab::Ci::Config::FeatureFlags.with_actor(nil) do - normalizer.normalize_jobs - end - + normalized_jobs = normalizer.normalize_jobs test_job = normalized_jobs[:'test: [linux, amd64]'] expect(test_job[:needs][:job][0][:name]).to eq('build: [$[[ matrix.OS ]], $[[ matrix.NONEXISTENT ]]]') @@ -460,34 +452,6 @@ ) end end - - context 'when ci_matrix_expressions feature flag is disabled' do - before do - stub_feature_flags(ci_matrix_expressions: false) - end - - it 'does not interpolate matrix expressions' do - expect(normalized_jobs.keys.map(&:to_s)).to contain_exactly( - 'build: [linux, amd64]', 'build: [linux, arm64]', - 'test: [linux, amd64]', 'test: [linux, arm64]' - ) - - test_amd64 = normalized_jobs[:'test: [linux, amd64]'] - test_arm64 = normalized_jobs[:'test: [linux, arm64]'] - - expect(test_amd64[:needs]).to eq({ - job: [ - { name: 'build: [$[[ matrix.OS ]], $[[ matrix.ARCH ]]]' } - ] - }) - - expect(test_arm64[:needs]).to eq({ - job: [ - { name: 'build: [$[[ matrix.OS ]], $[[ matrix.ARCH ]]]' } - ] - }) - end - end end end end diff --git a/spec/lib/gitlab/ci/yaml_processor/test_cases/parallel_spec.rb b/spec/lib/gitlab/ci/yaml_processor/test_cases/parallel_spec.rb index 0576e96f6f1c32b0828cd1b96f419d0b7705aa38..ecb1c6ea081d6369254780299aef719be7291931 100644 --- a/spec/lib/gitlab/ci/yaml_processor/test_cases/parallel_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor/test_cases/parallel_spec.rb @@ -90,20 +90,6 @@ module Ci ) end end - - context 'when ci_matrix_expressions feature flag is disabled' do - before do - stub_feature_flags(ci_matrix_expressions: false) - end - - it 'returns an error for invalid job reference' do - result = processor.execute - - expect(result.errors).to contain_exactly( - a_string_including('undefined need: build: [$[[ matrix.OS ]], $[[ matrix.ARCH ]]]') - ) - end - end end end end