2020-05-13 14:08:47 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
##
|
|
|
|
# Ci::Features is a class that aggregates all CI/CD feature flags in one place.
|
|
|
|
#
|
|
|
|
module Features
|
|
|
|
def self.artifacts_exclude_enabled?
|
2020-06-01 17:08:09 -04:00
|
|
|
::Feature.enabled?(:ci_artifacts_exclude, default_enabled: true)
|
2020-05-13 14:08:47 -04:00
|
|
|
end
|
2020-05-15 11:08:04 -04:00
|
|
|
|
2020-06-23 14:09:28 -04:00
|
|
|
def self.pipeline_latest?
|
|
|
|
::Feature.enabled?(:ci_pipeline_latest, default_enabled: true)
|
|
|
|
end
|
|
|
|
|
2020-07-15 08:09:26 -04:00
|
|
|
def self.pipeline_status_omit_commit_sha_in_cache_key?(project)
|
2020-08-02 20:09:34 -04:00
|
|
|
Feature.enabled?(:ci_pipeline_status_omit_commit_sha_in_cache_key, project, default_enabled: true)
|
2020-06-16 14:09:01 -04:00
|
|
|
end
|
2020-06-29 08:09:20 -04:00
|
|
|
|
|
|
|
# Remove in https://gitlab.com/gitlab-org/gitlab/-/issues/224199
|
|
|
|
def self.store_pipeline_messages?(project)
|
|
|
|
::Feature.enabled?(:ci_store_pipeline_messages, project, default_enabled: true)
|
|
|
|
end
|
2020-07-08 05:09:17 -04:00
|
|
|
|
2020-07-13 08:09:18 -04:00
|
|
|
def self.raise_job_rules_without_workflow_rules_warning?
|
2020-08-11 14:10:06 -04:00
|
|
|
::Feature.enabled?(:ci_raise_job_rules_without_workflow_rules_warning, default_enabled: true)
|
2020-07-13 08:09:18 -04:00
|
|
|
end
|
2020-07-14 08:09:14 -04:00
|
|
|
|
2020-09-04 05:08:38 -04:00
|
|
|
# NOTE: The feature flag `disallow_to_create_merge_request_pipelines_in_target_project`
|
2020-11-03 10:09:05 -05:00
|
|
|
# is a safe switch to disable the feature for a particular project when something went wrong,
|
2020-09-04 05:08:38 -04:00
|
|
|
# therefore it's not supposed to be enabled by default.
|
|
|
|
def self.disallow_to_create_merge_request_pipelines_in_target_project?(target_project)
|
|
|
|
::Feature.enabled?(:ci_disallow_to_create_merge_request_pipelines_in_target_project, target_project)
|
2020-07-15 17:09:26 -04:00
|
|
|
end
|
2020-07-22 14:09:27 -04:00
|
|
|
|
2020-09-15 14:09:43 -04:00
|
|
|
def self.trace_overwrite?
|
|
|
|
::Feature.enabled?(:ci_trace_overwrite, type: :ops, default_enabled: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.accept_trace?(project)
|
|
|
|
::Feature.enabled?(:ci_enable_live_trace, project) &&
|
2020-10-08 08:08:31 -04:00
|
|
|
::Feature.enabled?(:ci_accept_trace, project, type: :ops, default_enabled: true)
|
2020-09-15 14:09:43 -04:00
|
|
|
end
|
2020-09-16 05:09:43 -04:00
|
|
|
|
2020-10-06 08:08:38 -04:00
|
|
|
def self.log_invalid_trace_chunks?(project)
|
|
|
|
::Feature.enabled?(:ci_trace_log_invalid_chunks, project, type: :ops, default_enabled: false)
|
|
|
|
end
|
|
|
|
|
2021-01-19 10:10:34 -05:00
|
|
|
def self.validate_build_dependencies?(project)
|
2021-02-09 13:09:59 -05:00
|
|
|
::Feature.enabled?(:ci_validate_build_dependencies, project, default_enabled: :yaml) &&
|
2021-01-19 10:10:34 -05:00
|
|
|
::Feature.disabled?(:ci_validate_build_dependencies_override, project)
|
|
|
|
end
|
2021-01-28 16:09:04 -05:00
|
|
|
|
|
|
|
def self.display_quality_on_mr_diff?(project)
|
|
|
|
::Feature.enabled?(:codequality_mr_diff, project, default_enabled: false)
|
|
|
|
end
|
2021-02-04 13:09:22 -05:00
|
|
|
|
2021-03-05 01:09:26 -05:00
|
|
|
def self.multiple_cache_per_job?
|
|
|
|
::Feature.enabled?(:multiple_cache_per_job, default_enabled: :yaml)
|
|
|
|
end
|
2021-04-12 20:11:29 -04:00
|
|
|
|
|
|
|
def self.gldropdown_tags_enabled?
|
|
|
|
::Feature.enabled?(:gldropdown_tags, default_enabled: :yaml)
|
|
|
|
end
|
2020-05-13 14:08:47 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|