Commit 3804a2f1 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'remove-ci-plan-needs' into 'master'

Remove `ci_plan_needs_size_limit` feature flag

Closes #238173

See merge request gitlab-org/gitlab!42584
parents 8cd20069 710caac8
---
name: ci_plan_needs_size_limit
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37568
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/238173
group: group::ci
type: development
default_enabled: true
\ No newline at end of file
......@@ -2088,9 +2088,7 @@ This example creates four paths of execution:
- The maximum number of jobs that a single job can need in the `needs:` array is limited:
- For GitLab.com, the limit is 50. For more information, see our
[infrastructure issue](https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/7541).
- For self-managed instances, the limit is:
- 10, if the `ci_plan_needs_size_limit` feature flag is disabled (default).
- 50, if the `ci_plan_needs_size_limit` feature flag is enabled. This limit [can be changed](#changing-the-needs-job-limit).
- For self-managed instances, the limit is: 50. This limit [can be changed](#changing-the-needs-job-limit).
- If `needs:` refers to a job that is marked as `parallel:`.
the current job will depend on all parallel jobs created.
- `needs:` is similar to `dependencies:` in that it needs to use jobs from prior stages,
......
......@@ -46,10 +46,6 @@ module Gitlab
::Feature.enabled?(:ci_disallow_to_create_merge_request_pipelines_in_target_project, target_project)
end
def self.ci_plan_needs_size_limit?(project)
::Feature.enabled?(:ci_plan_needs_size_limit, project, default_enabled: true)
end
def self.lint_creates_pipeline_with_dry_run?(project)
::Feature.enabled?(:ci_lint_creates_pipeline_with_dry_run, project, default_enabled: true)
end
......
......@@ -11,8 +11,6 @@ module Gitlab
delegate :dig, to: :@seed_attributes
DEFAULT_NEEDS_LIMIT = 10
def initialize(pipeline, attributes, previous_stages)
@pipeline = pipeline
@seed_attributes = attributes
......@@ -140,11 +138,7 @@ module Gitlab
end
def max_needs_allowed
if ::Gitlab::Ci::Features.ci_plan_needs_size_limit?(@pipeline.project)
@pipeline.project.actual_limits.ci_needs_size_limit
else
DEFAULT_NEEDS_LIMIT
end
end
def pipeline_attributes
......
......@@ -931,22 +931,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
context 'when using 101 needs' do
let(:needs_count) { 101 }
context 'when ci_plan_needs_size_limit is disabled' do
before do
stub_feature_flags(ci_plan_needs_size_limit: false)
end
it "returns an error" do
expect(subject.errors).to contain_exactly(
"rspec: one job can only need 10 others, but you have listed 101. See needs keyword documentation for more details")
end
end
context 'when ci_plan_needs_size_limit is enabled' do
before do
stub_feature_flags(ci_plan_needs_size_limit: true)
end
it "returns an error" do
expect(subject.errors).to contain_exactly(
"rspec: one job can only need 50 others, but you have listed 101. See needs keyword documentation for more details")
......@@ -975,5 +959,4 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment