diff --git a/app/controllers/admin/plan_limits_controller.rb b/app/controllers/admin/plan_limits_controller.rb index ea52198432cb6a124db29740ce0721337be9a26f..b8608390d4d63e8f860ce7f63308a4be0cda21fc 100644 --- a/app/controllers/admin/plan_limits_controller.rb +++ b/app/controllers/admin/plan_limits_controller.rb @@ -41,7 +41,6 @@ def plan_limits_params generic_packages_max_file_size ci_pipeline_size ci_active_jobs - ci_active_pipelines ci_project_subscriptions ci_pipeline_schedules ci_needs_size_limit diff --git a/app/helpers/plan_limits_helper.rb b/app/helpers/plan_limits_helper.rb index 71869b3ba301eec63a9d4f8e12c8afc447883d7e..74653ad3511d058ce22791638aec12eacd5b63ba 100644 --- a/app/helpers/plan_limits_helper.rb +++ b/app/helpers/plan_limits_helper.rb @@ -7,8 +7,6 @@ def plan_limit_setting_description(limit_name) s_('AdminSettings|Maximum number of jobs in a single pipeline') when :ci_active_jobs s_('AdminSettings|Total number of jobs in currently active pipelines') - when :ci_active_pipelines - s_('AdminSettings|Maximum number of active pipelines per project') when :ci_project_subscriptions s_('AdminSettings|Maximum number of pipeline subscriptions to and from a project') when :ci_pipeline_schedules diff --git a/app/models/concerns/enums/ci/pipeline.rb b/app/models/concerns/enums/ci/pipeline.rb index 8ed6c54441bf16e332d222305096ffb7a07cba8f..778471eac8bb5cca508bbfa429bbae14f86fc9e5 100644 --- a/app/models/concerns/enums/ci/pipeline.rb +++ b/app/models/concerns/enums/ci/pipeline.rb @@ -11,7 +11,6 @@ def self.failure_reasons config_error: 1, external_validation_failure: 2, user_not_verified: 3, - activity_limit_exceeded: 20, size_limit_exceeded: 21, job_activity_limit_exceeded: 22, deployments_limit_exceeded: 23, diff --git a/app/models/instance_configuration.rb b/app/models/instance_configuration.rb index 8a8c1a293751038937e1787a3a2d8d8e7ad7c2d3..64c9680ce90eb8b1b78a9b51b79a6053dd48eb5f 100644 --- a/app/models/instance_configuration.rb +++ b/app/models/instance_configuration.rb @@ -138,7 +138,6 @@ def plan_ci_cd_limits(plan) plan.actual_limits.slice( :ci_pipeline_size, :ci_active_jobs, - :ci_active_pipelines, :ci_project_subscriptions, :ci_pipeline_schedules, :ci_needs_size_limit, diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index aa0cd4761912d0b7b0e7a25a1f4d030c58f30dfe..8c9ff49b0e7b55806b32ff6a33710777e46aea42 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -13,7 +13,6 @@ def self.failure_reasons config_error: 'The pipeline failed due to an error on the CI/CD configuration file.', external_validation_failure: 'The external pipeline validation failed.', user_not_verified: 'The pipeline failed due to the user not being verified', - activity_limit_exceeded: 'The pipeline activity limit was exceeded.', size_limit_exceeded: 'The pipeline size limit was exceeded.', job_activity_limit_exceeded: 'The pipeline job activity limit was exceeded.', deployments_limit_exceeded: 'The pipeline deployments limit was exceeded.', diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index 7cad7e8301c7532523fa04650616a9f4cb0800f6..a8da83e84a16dc5ff294730fec21e8c377a1609a 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -33,7 +33,6 @@ class CreatePipelineService < BaseService Gitlab::Ci::Pipeline::Chain::EnsureResourceGroups, Gitlab::Ci::Pipeline::Chain::Create, Gitlab::Ci::Pipeline::Chain::CreateCrossDatabaseAssociations, - Gitlab::Ci::Pipeline::Chain::Limit::Activity, Gitlab::Ci::Pipeline::Chain::CancelPendingPipelines, Gitlab::Ci::Pipeline::Chain::Metrics, Gitlab::Ci::Pipeline::Chain::TemplateUsage, diff --git a/app/views/admin/application_settings/_ci_cd.html.haml b/app/views/admin/application_settings/_ci_cd.html.haml index fd671f722383f181748a9853b8a54d666ebbf09b..f162f5be74644286a0e181b20c34c48cb7b54fdf 100644 --- a/app/views/admin/application_settings/_ci_cd.html.haml +++ b/app/views/admin/application_settings/_ci_cd.html.haml @@ -82,9 +82,6 @@ .form-group = f.label :ci_active_jobs, plan_limit_setting_description(:ci_active_jobs) = f.number_field :ci_active_jobs, class: 'form-control gl-form-input' - .form-group - = f.label :ci_active_pipelines, plan_limit_setting_description(:ci_active_pipelines) - = f.number_field :ci_active_pipelines, class: 'form-control gl-form-input' .form-group = f.label :ci_project_subscriptions, plan_limit_setting_description(:ci_project_subscriptions) = f.number_field :ci_project_subscriptions, class: 'form-control gl-form-input' diff --git a/app/views/help/instance_configuration/_ci_cd_limits.html.haml b/app/views/help/instance_configuration/_ci_cd_limits.html.haml index 0a5cbb710e336d2024232fcb6a819ba9ed4e00b0..8496d354ee1de667fd3bd89b96cfc1419705b768 100644 --- a/app/views/help/instance_configuration/_ci_cd_limits.html.haml +++ b/app/views/help/instance_configuration/_ci_cd_limits.html.haml @@ -26,10 +26,6 @@ %td= plan_limit_setting_description(:ci_active_jobs) - ci_cd_limits.each_value do |limits| %td= instance_configuration_disabled_cell_html(limits[:ci_active_jobs]) - %tr - %td= plan_limit_setting_description(:ci_active_pipelines) - - ci_cd_limits.each_value do |limits| - %td= instance_configuration_disabled_cell_html(limits[:ci_active_pipelines]) %tr %td= plan_limit_setting_description(:ci_project_subscriptions) - ci_cd_limits.each_value do |limits| diff --git a/doc/administration/instance_limits.md b/doc/administration/instance_limits.md index c113d1aeff44dce70a4a887e2574ecbe9f141a32..f0702288da597bfd482ddcc831c30d7c92b14863 100644 --- a/doc/administration/instance_limits.md +++ b/doc/administration/instance_limits.md @@ -430,38 +430,6 @@ Plan.default.actual_limits.update!(ci_active_jobs: 500) Set the limit to `0` to disable it. -### Number of pipelines running concurrently - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32823) in GitLab 12.5. - -The total number of pipelines running concurrently can be limited per project. -When enabled, the limit is checked each time a new pipeline is created. -Without a concurrent pipelines limit, a sudden flood of triggered pipelines could -overwhelm the instance resources. - -If a new pipeline would cause the total number of pipelines to exceed the limit, -the pipeline fails with a `The pipeline activity limit was exceeded.` error. - -On [GitLab Premium](https://about.gitlab.com/pricing/) self-managed or -higher installations, this limit is defined under a `default` plan that affects all -projects. This limit is disabled (`0`) by default. GitLab SaaS subscribers have different -limits [defined per plan](../user/gitlab_com/index.md#gitlab-cicd), and they affect -all projects under that plan. - -To set this limit for a self-managed installation, enable the **Maximum number of active pipelines per project** -[setting in the Admin Area](../user/admin_area/settings/continuous_integration.md#set-cicd-limits). - -Alternatively, you can run the following in the [GitLab Rails console](operations/rails_console.md#starting-a-rails-console-session): - -```ruby -# If limits don't exist for the default plan, you can create one with: -# Plan.default.create_limits! - -Plan.default.actual_limits.update!(ci_active_pipelines: 100) -``` - -Set the limit to `0` to disable it. - ### Maximum time jobs can run > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16777) in GitLab 12.3. diff --git a/doc/api/plan_limits.md b/doc/api/plan_limits.md index 8f6a7ae3e8dccc92eec8888e5bb6447d03994974..f93f246c3f02605a552710a7f8c27d21e09e2ce0 100644 --- a/doc/api/plan_limits.md +++ b/doc/api/plan_limits.md @@ -37,7 +37,6 @@ Example response: { "ci_pipeline_size": 0, "ci_active_jobs": 0, - "ci_active_pipelines": 0, "ci_project_subscriptions": 2, "ci_pipeline_schedules": 10, "ci_needs_size_limit": 50, @@ -68,7 +67,6 @@ PUT /application/plan_limits | `plan_name` | string | yes | Name of the plan to update. | | `ci_pipeline_size` | integer | no | Maximum number of jobs in a single pipeline. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85895) in GitLab 15.0. | | `ci_active_jobs` | integer | no | Total number of jobs in currently active pipelines. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85895) in GitLab 15.0. | -| `ci_active_pipelines` | integer | no | Maximum number of active pipelines per project. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85895) in GitLab 15.0. | | `ci_project_subscriptions` | integer | no | Maximum number of pipeline subscriptions to and from a project. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85895) in GitLab 15.0. | | `ci_pipeline_schedules` | integer | no | Maximum number of pipeline schedules. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85895) in GitLab 15.0. | | `ci_needs_size_limit` | integer | no | Maximum number of [DAG](../ci/directed_acyclic_graph/index.md) dependencies that a job can have. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85895) in GitLab 15.0. | @@ -94,7 +92,6 @@ Example response: { "ci_pipeline_size": 0, "ci_active_jobs": 0, - "ci_active_pipelines": 0, "ci_project_subscriptions": 2, "ci_pipeline_schedules": 10, "ci_needs_size_limit": 50, diff --git a/doc/development/database/creating_enums.md b/doc/development/database/creating_enums.md index e2ae36f7481617d1cbc418e6e363cf04a4639572..908656dae84222358b7667708479e692cc802f70 100644 --- a/doc/development/database/creating_enums.md +++ b/doc/development/database/creating_enums.md @@ -63,7 +63,7 @@ module EE module Pipeline override :failure_reasons def failure_reasons - super.merge(activity_limit_exceeded: 2) + super.merge(job_activity_limit_exceeded: 2) end end end @@ -73,9 +73,9 @@ end This works as-is, however, it has a couple of downside that: - Someone could define a key/value pair in EE that is **conflicted** with a value defined in FOSS. - For example, define `activity_limit_exceeded: 1` in `EE::Enums::Pipeline`. + For example, define `job_activity_limit_exceeded: 1` in `EE::Enums::Pipeline`. - When it happens, the feature works totally different. - For example, we cannot figure out `failure_reason` is either `config_error` or `activity_limit_exceeded`. + For example, we cannot figure out `failure_reason` is either `config_error` or `job_activity_limit_exceeded`. - When it happens, we have to ship a database migration to fix the data integrity, which might be impossible if you cannot recover the original value. @@ -88,7 +88,7 @@ module EE module Pipeline override :failure_reasons def failure_reasons - super.merge(activity_limit_exceeded: 1_000, size_limit_exceeded: 1_001) + super.merge(job_activity_limit_exceeded: 1_000, size_limit_exceeded: 1_001) end end end @@ -98,7 +98,7 @@ end This looks working as a workaround, however, this approach has some downsides that: - Features could move from EE to FOSS or vice versa. Therefore, the offset might be mixed between FOSS and EE in the future. - For example, when you move `activity_limit_exceeded` to FOSS, you see `{ unknown_failure: 0, config_error: 1, activity_limit_exceeded: 1_000 }`. + For example, when you move `job_activity_limit_exceeded` to FOSS, you see `{ unknown_failure: 0, config_error: 1, job_activity_limit_exceeded: 1_000 }`. - The integer column for the `enum` is likely created [as `SMALLINT`](#creating-enums). Therefore, you need to be careful of that the offset doesn't exceed the maximum value of 2 bytes integer. @@ -110,7 +110,7 @@ class Pipeline < ApplicationRecord enum failure_reason: { unknown_failure: 0, config_error: 1, - activity_limit_exceeded: 2 + job_activity_limit_exceeded: 2 } end ``` diff --git a/ee/lib/ee/gitlab/ci/pipeline/chain/limit/activity.rb b/ee/lib/ee/gitlab/ci/pipeline/chain/limit/activity.rb deleted file mode 100644 index 313c227d8e7272b23efc91b072c1717b36e2a323..0000000000000000000000000000000000000000 --- a/ee/lib/ee/gitlab/ci/pipeline/chain/limit/activity.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -module EE - module Gitlab - module Ci - module Pipeline - module Chain - module Limit - module Activity - extend ::Gitlab::Utils::Override - include ::Gitlab::Ci::Pipeline::Chain::Helpers - include ::Gitlab::OptimisticLocking - - attr_reader :limit - private :limit - - def initialize(*) - super - - @limit = Pipeline::Quota::Activity - .new(project.namespace, pipeline.project) - end - - override :perform! - def perform! - return unless limit.exceeded? - - retry_optimistic_lock(pipeline, name: 'ci_pipeline_chain_limit_activity') do - pipeline.drop!(:activity_limit_exceeded) - limit.log_error!(project_id: project.id, plan: project.actual_plan_name) - end - end - - override :break? - def break? - limit.exceeded? - end - end - end - end - end - end - end -end diff --git a/ee/lib/ee/gitlab/ci/pipeline/quota/activity.rb b/ee/lib/ee/gitlab/ci/pipeline/quota/activity.rb deleted file mode 100644 index b885d04a94f6682ab9801cc36f7de0d2c7f93674..0000000000000000000000000000000000000000 --- a/ee/lib/ee/gitlab/ci/pipeline/quota/activity.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -module EE - module Gitlab - module Ci - module Pipeline - module Quota - class Activity < ::Gitlab::Ci::Limit - include ::Gitlab::Utils::StrongMemoize - include ActionView::Helpers::TextHelper - - def initialize(namespace, project) - @namespace = namespace - @project = project - end - - def enabled? - ci_active_pipelines_limit > 0 - end - - def exceeded? - return false unless enabled? - - alive_pipelines_count > ci_active_pipelines_limit - end - - def message - return unless exceeded? - - 'Project has too many active pipelines! ' \ - "There are #{pluralize(alive_pipelines_count, 'active pipeline')}, "\ - "but the limit is #{ci_active_pipelines_limit}." - end - - private - - def alive_pipelines_count - strong_memoize(:alive_pipelines_limit) do - @project.ci_pipelines.alive.count - end - end - - def ci_active_pipelines_limit - strong_memoize(:ci_active_pipelines_limit) do - @namespace.actual_limits.ci_active_pipelines - end - end - end - end - end - end - end -end diff --git a/ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb b/ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb deleted file mode 100644 index b2c0e62733929cbcee4e10f1d6e9a6ec2d74e9e8..0000000000000000000000000000000000000000 --- a/ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::Activity, :saas do - let_it_be(:namespace) { create(:namespace) } - let_it_be(:project, reload: true) { create(:project, namespace: namespace) } - let_it_be(:ultimate_plan, reload: true) { create(:ultimate_plan) } - - let(:plan_limits) { create(:plan_limits, plan: ultimate_plan) } - let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) } - - subject { described_class.new(namespace, project) } - - shared_context 'pipeline activity limit exceeded' do - before do - create(:ci_pipeline, project: project, status: 'created') - create(:ci_pipeline, project: project, status: 'pending') - create(:ci_pipeline, project: project, status: 'running') - - plan_limits.update!(ci_active_pipelines: 1) - end - end - - shared_context 'pipeline activity limit not exceeded' do - before do - plan_limits.update!(ci_active_pipelines: 2) - end - end - - describe '#enabled?' do - context 'when limit is enabled in plan' do - before do - plan_limits.update!(ci_active_pipelines: 10) - end - - it 'is enabled' do - expect(subject).to be_enabled - end - end - - context 'when limit is not enabled' do - before do - plan_limits.update!(ci_active_pipelines: 0) - end - - it 'is not enabled' do - expect(subject).not_to be_enabled - end - end - - context 'when limit does not exist' do - before do - allow(namespace).to receive(:actual_plan) { create(:default_plan) } - end - - it 'is not enabled' do - expect(subject).not_to be_enabled - end - end - end - - describe '#exceeded?' do - context 'when limit is exceeded' do - include_context 'pipeline activity limit exceeded' - - it 'is exceeded' do - expect(subject).to be_exceeded - end - end - - context 'when limit is not exceeded' do - include_context 'pipeline activity limit not exceeded' - - it 'is not exceeded' do - expect(subject).not_to be_exceeded - end - end - end - - describe '#message' do - context 'when limit is exceeded' do - include_context 'pipeline activity limit exceeded' - - it 'returns info about pipeline activity limit exceeded' do - expect(subject.message) - .to eq "Project has too many active pipelines! There are 3 active pipelines, but the limit is 1." - end - end - end -end diff --git a/ee/spec/lib/gitlab/ci/pipeline/chain/limit/activity_spec.rb b/ee/spec/lib/gitlab/ci/pipeline/chain/limit/activity_spec.rb deleted file mode 100644 index 6cdd134a611d6ae5a0df3e1db87559b21ab1f786..0000000000000000000000000000000000000000 --- a/ee/spec/lib/gitlab/ci/pipeline/chain/limit/activity_spec.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Activity, :saas do - let_it_be(:namespace) { create(:namespace) } - let_it_be(:project) { create(:project, namespace: namespace) } - let_it_be(:user) { create(:user) } - - let(:command) do - double('command', project: project, current_user: user) - end - - let(:pipeline) do - create(:ci_pipeline, project: project) - end - - let(:step) { described_class.new(pipeline, command) } - - subject { step.perform! } - - context 'when active pipelines limit is exceeded' do - before do - ultimate_plan = create(:ultimate_plan) - create(:plan_limits, plan: ultimate_plan, ci_active_pipelines: 1) - create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) - - create(:ci_pipeline, project: project, status: 'pending') - create(:ci_pipeline, project: project, status: 'running') - end - - it 'drops the pipeline' do - subject - - expect(pipeline.reload).to be_failed - end - - it 'persists the pipeline' do - subject - - expect(pipeline).to be_persisted - end - - it 'breaks the chain' do - subject - - expect(step.break?).to be true - end - - it 'sets a valid failure reason' do - subject - - expect(pipeline.activity_limit_exceeded?).to be true - end - - it 'logs the error' do - expect(Gitlab::ErrorTracking).to receive(:log_exception).with( - instance_of(Gitlab::Ci::Limit::LimitExceededError), - { project_id: project.id, plan: namespace.actual_plan_name } - ) - - subject - end - end - - context 'when pipeline activity limit is not exceeded' do - before do - ultimate_plan = create(:ultimate_plan) - create(:plan_limits, plan: ultimate_plan, ci_active_pipelines: 100) - create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) - end - - it 'does not break the chain' do - subject - - expect(step.break?).to be false - end - - it 'does not invalidate the pipeline' do - subject - - expect(pipeline.errors).to be_empty - end - - it 'does not log any error' do - expect(Gitlab::ErrorTracking).not_to receive(:track_exception) - - subject - end - end -end diff --git a/ee/spec/models/ci/pipeline_spec.rb b/ee/spec/models/ci/pipeline_spec.rb index 530ec0f612240e15a6a32d5e259f675317da11dd..cfe9276d2778e55cabe5540965b6e377f4d498c7 100644 --- a/ee/spec/models/ci/pipeline_spec.rb +++ b/ee/spec/models/ci/pipeline_spec.rb @@ -25,7 +25,7 @@ describe '.failure_reasons' do it 'contains failure reasons about exceeded limits' do expect(described_class.failure_reasons) - .to include 'activity_limit_exceeded', 'size_limit_exceeded' + .to include 'size_limit_exceeded' end end diff --git a/ee/spec/models/ee/namespace_spec.rb b/ee/spec/models/ee/namespace_spec.rb index 9e40b054f983043035c18d43731495c0429355bf..caf1ca80c0d00942cdc1d706710e1ea0a2e029af 100644 --- a/ee/spec/models/ee/namespace_spec.rb +++ b/ee/spec/models/ee/namespace_spec.rb @@ -721,7 +721,6 @@ let!(:default_limits) do create(:plan_limits, plan: default_plan, - ci_active_pipelines: 1, ci_pipeline_size: 2, ci_active_jobs: 3) end @@ -740,7 +739,6 @@ let!(:free_limits) do create(:plan_limits, plan: free_plan, - ci_active_pipelines: 3, ci_pipeline_size: 4, ci_active_jobs: 5) end @@ -759,7 +757,6 @@ let!(:subscription_limits) do create(:plan_limits, plan: ultimate_plan, - ci_active_pipelines: 5, ci_pipeline_size: 6, ci_active_jobs: 7) end diff --git a/ee/spec/presenters/ci/pipeline_presenter_spec.rb b/ee/spec/presenters/ci/pipeline_presenter_spec.rb index dab42c6d72490f73a764ee61891c5d56ab966760..7bc180c761866745537f2363bfe2757169939ee4 100644 --- a/ee/spec/presenters/ci/pipeline_presenter_spec.rb +++ b/ee/spec/presenters/ci/pipeline_presenter_spec.rb @@ -11,10 +11,10 @@ describe '#failure_reason' do context 'when pipeline has failure reason' do it 'represents a failure reason sentence' do - pipeline.failure_reason = :activity_limit_exceeded + pipeline.failure_reason = :job_activity_limit_exceeded expect(presenter.failure_reason) - .to eq 'The pipeline activity limit was exceeded.' + .to eq 'The pipeline job activity limit was exceeded.' end end diff --git a/ee/spec/services/ci/create_pipeline_service_spec.rb b/ee/spec/services/ci/create_pipeline_service_spec.rb index bf19bcbfb8de605abf8945dbd7406dfa56d58f7e..48fc0530f91fc511a27965a187a7e0aeadd79b98 100644 --- a/ee/spec/services/ci/create_pipeline_service_spec.rb +++ b/ee/spec/services/ci/create_pipeline_service_spec.rb @@ -37,26 +37,6 @@ end end - context 'when pipeline activity limit is exceeded' do - before do - plan_limits.update_column(:ci_active_pipelines, 2) - - create(:ci_pipeline, project: project, status: 'pending') - create(:ci_pipeline, project: project, status: 'running') - end - - it 'drops the pipeline and does not process jobs', :aggregate_failures do - response, pipeline = create_pipeline! - - expect(response).to be_error - expect(pipeline).to be_persisted - expect(pipeline).to be_failed - expect(pipeline.statuses).not_to be_empty - expect(pipeline.statuses).to all(be_created) - expect(pipeline.activity_limit_exceeded?).to be true - end - end - context 'when pipeline size limit is exceeded' do before do plan_limits.update_column(:ci_pipeline_size, 2) diff --git a/lib/api/admin/plan_limits.rb b/lib/api/admin/plan_limits.rb index 5ef56d3326fbcba3e2f27f141518ef60372bdf2c..f1d7b56ad92ee1e681d65cfb87ac6f10075e5cfa 100644 --- a/lib/api/admin/plan_limits.rb +++ b/lib/api/admin/plan_limits.rb @@ -53,7 +53,6 @@ def current_plan(name) optional :ci_pipeline_size, type: Integer, desc: 'Maximum number of jobs in a single pipeline' optional :ci_active_jobs, type: Integer, desc: 'Total number of jobs in currently active pipelines' - optional :ci_active_pipelines, type: Integer, desc: 'Maximum number of active pipelines per project' optional :ci_project_subscriptions, type: Integer, desc: 'Maximum number of pipeline subscriptions to and from a project' optional :ci_pipeline_schedules, type: Integer, desc: 'Maximum number of pipeline schedules' diff --git a/lib/api/entities/plan_limit.rb b/lib/api/entities/plan_limit.rb index d69be0077f2be6e6c8ac06e36e12d2fa562b8ff1..b5cff2bb73c16d6686f60098a25e4ca29d709017 100644 --- a/lib/api/entities/plan_limit.rb +++ b/lib/api/entities/plan_limit.rb @@ -5,7 +5,6 @@ module Entities class PlanLimit < Grape::Entity expose :ci_pipeline_size, documentation: { type: 'integer', example: 0 } expose :ci_active_jobs, documentation: { type: 'integer', example: 0 } - expose :ci_active_pipelines, documentation: { type: 'integer', example: 0 } expose :ci_project_subscriptions, documentation: { type: 'integer', example: 2 } expose :ci_pipeline_schedules, documentation: { type: 'integer', example: 10 } expose :ci_needs_size_limit, documentation: { type: 'integer', example: 50 } diff --git a/lib/gitlab/ci/pipeline/chain/limit/activity.rb b/lib/gitlab/ci/pipeline/chain/limit/activity.rb deleted file mode 100644 index ef9235477dbad30fd2b050a8237db9b867b11086..0000000000000000000000000000000000000000 --- a/lib/gitlab/ci/pipeline/chain/limit/activity.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module Ci - module Pipeline - module Chain - module Limit - class Activity < Chain::Base - def perform! - # to be overridden in EE - end - - def break? - false # to be overridden in EE - end - end - end - end - end - end -end - -Gitlab::Ci::Pipeline::Chain::Limit::Activity.prepend_mod_with('Gitlab::Ci::Pipeline::Chain::Limit::Activity') diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 14a32883f2ce60e898c754e64ffb9c83a3c01bc1..262e004a146e9f0ef744bb5c5e5e67abee2453e8 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -3084,9 +3084,6 @@ msgstr "" msgid "AdminSettings|Maximum number of DAG dependencies that a job can have" msgstr "" -msgid "AdminSettings|Maximum number of active pipelines per project" -msgstr "" - msgid "AdminSettings|Maximum number of custom domains per project" msgstr "" diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 9a0d7ea0848139ae8cbe22af46bfcee5cfcedd2d..7c39b17256dd842b3fbcf3f529f8255a69bd71b9 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -442,7 +442,6 @@ page.within('.as-ci-cd') do fill_in 'plan_limits_ci_pipeline_size', with: 10 fill_in 'plan_limits_ci_active_jobs', with: 20 - fill_in 'plan_limits_ci_active_pipelines', with: 25 fill_in 'plan_limits_ci_project_subscriptions', with: 30 fill_in 'plan_limits_ci_pipeline_schedules', with: 40 fill_in 'plan_limits_ci_needs_size_limit', with: 50 @@ -454,7 +453,6 @@ limits = default_plan.reload.limits expect(limits.ci_pipeline_size).to eq(10) expect(limits.ci_active_jobs).to eq(20) - expect(limits.ci_active_pipelines).to eq(25) expect(limits.ci_project_subscriptions).to eq(30) expect(limits.ci_pipeline_schedules).to eq(40) expect(limits.ci_needs_size_limit).to eq(50) diff --git a/spec/helpers/plan_limits_helper_spec.rb b/spec/helpers/plan_limits_helper_spec.rb index 121338c9cf29b36e7a16a42accd2ebb21072a5b4..b25e97150f8e65fa32abf0c2ec4170e47d8ade49 100644 --- a/spec/helpers/plan_limits_helper_spec.rb +++ b/spec/helpers/plan_limits_helper_spec.rb @@ -8,7 +8,6 @@ [ :ci_pipeline_size, :ci_active_jobs, - :ci_active_pipelines, :ci_project_subscriptions, :ci_pipeline_schedules, :ci_needs_size_limit, diff --git a/spec/lib/api/entities/plan_limit_spec.rb b/spec/lib/api/entities/plan_limit_spec.rb index baaaeb0b6003e54626635fb460a9f051f61fd879..045d16c91b2a063c73f68627a7d754e13746ec87 100644 --- a/spec/lib/api/entities/plan_limit_spec.rb +++ b/spec/lib/api/entities/plan_limit_spec.rb @@ -11,7 +11,6 @@ expect(subject).to include( :ci_pipeline_size, :ci_active_jobs, - :ci_active_pipelines, :ci_project_subscriptions, :ci_pipeline_schedules, :ci_needs_size_limit, diff --git a/spec/models/instance_configuration_spec.rb b/spec/models/instance_configuration_spec.rb index f57667cc5d6e45108e38ab435492387938e18dbc..4c5c1bc3151ff84c4d11926dad5fa52a2227673a 100644 --- a/spec/models/instance_configuration_spec.rb +++ b/spec/models/instance_configuration_spec.rb @@ -189,7 +189,6 @@ def stub_pub_file(path) plan: plan1, ci_pipeline_size: 1001, ci_active_jobs: 1002, - ci_active_pipelines: 1003, ci_project_subscriptions: 1004, ci_pipeline_schedules: 1005, ci_needs_size_limit: 1006, @@ -200,7 +199,6 @@ def stub_pub_file(path) plan: plan2, ci_pipeline_size: 1101, ci_active_jobs: 1102, - ci_active_pipelines: 1103, ci_project_subscriptions: 1104, ci_pipeline_schedules: 1105, ci_needs_size_limit: 1106, @@ -214,7 +212,6 @@ def stub_pub_file(path) expect(ci_cd_size_limits[:Plan1]).to eq({ ci_active_jobs: 1002, - ci_active_pipelines: 1003, ci_needs_size_limit: 1006, ci_pipeline_schedules: 1005, ci_pipeline_size: 1001, @@ -224,7 +221,6 @@ def stub_pub_file(path) }) expect(ci_cd_size_limits[:Plan2]).to eq({ ci_active_jobs: 1102, - ci_active_pipelines: 1103, ci_needs_size_limit: 1106, ci_pipeline_schedules: 1105, ci_pipeline_size: 1101, diff --git a/spec/models/plan_limits_spec.rb b/spec/models/plan_limits_spec.rb index eb17a66a103bf39617d0704c7892b13a5edd0333..962bb21d76141fc9ece91cb7a824413f402c0ccd 100644 --- a/spec/models/plan_limits_spec.rb +++ b/spec/models/plan_limits_spec.rb @@ -206,6 +206,8 @@ ] end + # Remove ci_active_pipelines when db column is removed + # https://gitlab.com/gitlab-org/gitlab/-/issues/408141 let(:columns_with_zero) do %w[ ci_active_pipelines diff --git a/spec/requests/api/admin/plan_limits_spec.rb b/spec/requests/api/admin/plan_limits_spec.rb index dffe062c0311b15c8c8e5caad248bf4040eda01d..6085b48c7c213b025508969d4bc8d77d09e3ca75 100644 --- a/spec/requests/api/admin/plan_limits_spec.rb +++ b/spec/requests/api/admin/plan_limits_spec.rb @@ -18,7 +18,6 @@ expect(json_response).to be_an Hash expect(json_response['ci_pipeline_size']).to eq(Plan.default.actual_limits.ci_pipeline_size) expect(json_response['ci_active_jobs']).to eq(Plan.default.actual_limits.ci_active_jobs) - expect(json_response['ci_active_pipelines']).to eq(Plan.default.actual_limits.ci_active_pipelines) expect(json_response['ci_project_subscriptions']).to eq(Plan.default.actual_limits.ci_project_subscriptions) expect(json_response['ci_pipeline_schedules']).to eq(Plan.default.actual_limits.ci_pipeline_schedules) expect(json_response['ci_needs_size_limit']).to eq(Plan.default.actual_limits.ci_needs_size_limit) @@ -49,7 +48,6 @@ expect(json_response).to be_an Hash expect(json_response['ci_pipeline_size']).to eq(Plan.default.actual_limits.ci_pipeline_size) expect(json_response['ci_active_jobs']).to eq(Plan.default.actual_limits.ci_active_jobs) - expect(json_response['ci_active_pipelines']).to eq(Plan.default.actual_limits.ci_active_pipelines) expect(json_response['ci_project_subscriptions']).to eq(Plan.default.actual_limits.ci_project_subscriptions) expect(json_response['ci_pipeline_schedules']).to eq(Plan.default.actual_limits.ci_pipeline_schedules) expect(json_response['ci_needs_size_limit']).to eq(Plan.default.actual_limits.ci_needs_size_limit) @@ -95,7 +93,6 @@ 'plan_name': 'default', 'ci_pipeline_size': 101, 'ci_active_jobs': 102, - 'ci_active_pipelines': 103, 'ci_project_subscriptions': 104, 'ci_pipeline_schedules': 105, 'ci_needs_size_limit': 106, @@ -116,7 +113,6 @@ expect(json_response).to be_an Hash expect(json_response['ci_pipeline_size']).to eq(101) expect(json_response['ci_active_jobs']).to eq(102) - expect(json_response['ci_active_pipelines']).to eq(103) expect(json_response['ci_project_subscriptions']).to eq(104) expect(json_response['ci_pipeline_schedules']).to eq(105) expect(json_response['ci_needs_size_limit']).to eq(106) @@ -161,7 +157,6 @@ 'plan_name': 'default', 'ci_pipeline_size': 'z', 'ci_active_jobs': 'y', - 'ci_active_pipelines': 'x', 'ci_project_subscriptions': 'w', 'ci_pipeline_schedules': 'v', 'ci_needs_size_limit': 'u', @@ -183,7 +178,6 @@ expect(json_response['error']).to include( 'ci_pipeline_size is invalid', 'ci_active_jobs is invalid', - 'ci_active_pipelines is invalid', 'ci_project_subscriptions is invalid', 'ci_pipeline_schedules is invalid', 'ci_needs_size_limit is invalid',