Module: Gitlab::Ci::Features

Defined in:
lib/gitlab/ci/features.rb

Overview

Ci::Features is a class that aggregates all CI/CD feature flags in one place.

Class Method Summary collapse

Class Method Details

.accept_trace?(project) ⇒ Boolean

Returns:

  • (Boolean)

49
50
51
52
# File 'lib/gitlab/ci/features.rb', line 49

def self.accept_trace?(project)
  ::Feature.enabled?(:ci_enable_live_trace, project) &&
    ::Feature.enabled?(:ci_accept_trace, project, type: :ops, default_enabled: true)
end

.artifacts_exclude_enabled?Boolean

Returns:

  • (Boolean)

9
10
11
# File 'lib/gitlab/ci/features.rb', line 9

def self.artifacts_exclude_enabled?
  ::Feature.enabled?(:ci_artifacts_exclude, default_enabled: true)
end

.auto_rollback_available?(project) ⇒ Boolean

Returns:

  • (Boolean)

62
63
64
# File 'lib/gitlab/ci/features.rb', line 62

def self.auto_rollback_available?(project)
  ::Feature.enabled?(:cd_auto_rollback, project) && project&.feature_available?(:auto_rollback)
end

.ci_pipeline_editor_page_enabled?(project) ⇒ Boolean

Returns:

  • (Boolean)

70
71
72
# File 'lib/gitlab/ci/features.rb', line 70

def self.ci_pipeline_editor_page_enabled?(project)
  ::Feature.enabled?(:ci_pipeline_editor_page, project, default_enabled: false)
end

.disallow_to_create_merge_request_pipelines_in_target_project?(target_project) ⇒ Boolean

NOTE: The feature flag `disallow_to_create_merge_request_pipelines_in_target_project` is a safe switch to disable the feature for a particular project when something went wrong, therefore it's not supposed to be enabled by default.

Returns:

  • (Boolean)

37
38
39
# File 'lib/gitlab/ci/features.rb', line 37

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)
end

.instance_variables_ui_enabled?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'lib/gitlab/ci/features.rb', line 13

def self.instance_variables_ui_enabled?
  ::Feature.enabled?(:ci_instance_variables_ui, default_enabled: true)
end

.log_invalid_trace_chunks?(project) ⇒ Boolean

Returns:

  • (Boolean)

54
55
56
# File 'lib/gitlab/ci/features.rb', line 54

def self.log_invalid_trace_chunks?(project)
  ::Feature.enabled?(:ci_trace_log_invalid_chunks, project, type: :ops, default_enabled: false)
end

.manual_bridges_enabled?(project) ⇒ Boolean

Returns:

  • (Boolean)

58
59
60
# File 'lib/gitlab/ci/features.rb', line 58

def self.manual_bridges_enabled?(project)
  ::Feature.enabled?(:ci_manual_bridges, project, default_enabled: true)
end

.pipeline_latest?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/gitlab/ci/features.rb', line 17

def self.pipeline_latest?
  ::Feature.enabled?(:ci_pipeline_latest, default_enabled: true)
end

.pipeline_status_omit_commit_sha_in_cache_key?(project) ⇒ Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/gitlab/ci/features.rb', line 21

def self.pipeline_status_omit_commit_sha_in_cache_key?(project)
  Feature.enabled?(:ci_pipeline_status_omit_commit_sha_in_cache_key, project, default_enabled: true)
end

.project_transactionless_destroy?(project) ⇒ Boolean

Returns:

  • (Boolean)

41
42
43
# File 'lib/gitlab/ci/features.rb', line 41

def self.project_transactionless_destroy?(project)
  Feature.enabled?(:project_transactionless_destroy, project, default_enabled: false)
end

.raise_job_rules_without_workflow_rules_warning?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/gitlab/ci/features.rb', line 30

def self.raise_job_rules_without_workflow_rules_warning?
  ::Feature.enabled?(:ci_raise_job_rules_without_workflow_rules_warning, default_enabled: true)
end

.seed_block_run_before_workflow_rules_enabled?(project) ⇒ Boolean

Returns:

  • (Boolean)

66
67
68
# File 'lib/gitlab/ci/features.rb', line 66

def self.seed_block_run_before_workflow_rules_enabled?(project)
  ::Feature.enabled?(:ci_seed_block_run_before_workflow_rules, project, default_enabled: true)
end

.store_pipeline_messages?(project) ⇒ Boolean

Returns:

  • (Boolean)

26
27
28
# File 'lib/gitlab/ci/features.rb', line 26

def self.store_pipeline_messages?(project)
  ::Feature.enabled?(:ci_store_pipeline_messages, project, default_enabled: true)
end

.trace_overwrite?Boolean

Returns:

  • (Boolean)

45
46
47
# File 'lib/gitlab/ci/features.rb', line 45

def self.trace_overwrite?
  ::Feature.enabled?(:ci_trace_overwrite, type: :ops, default_enabled: false)
end