Module: Ci::VariablesHelper

Defined in:
app/helpers/ci/variables_helper.rb

Instance Method Summary collapse

Instance Method Details

#ci_variable_maskable_raw_regexObject



27
28
29
# File 'app/helpers/ci/variables_helper.rb', line 27

def ci_variable_maskable_raw_regex
  Ci::Maskable::MASK_AND_RAW_REGEX.inspect.sub('\\A', '^').sub('\\z', '$')[1...-1]
end

#ci_variable_maskable_regexObject



31
32
33
# File 'app/helpers/ci/variables_helper.rb', line 31

def ci_variable_maskable_regex
  Ci::Maskable::REGEX.inspect.sub('\\A', '^').sub('\\z', '$').sub(%r{^/}, '').sub(%r{/[a-z]*$}, '').gsub('\/', '/')
end

#ci_variable_protected_by_default?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'app/helpers/ci/variables_helper.rb', line 5

def ci_variable_protected_by_default?
  Gitlab::CurrentSettings.current_application_settings.protected_ci_variables
end

#create_deploy_token_path(entity, opts = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'app/helpers/ci/variables_helper.rb', line 9

def create_deploy_token_path(entity, opts = {})
  if entity.is_a?(::Group)
    create_deploy_token_group_settings_repository_path(entity, opts)
  else
    # TODO: change this path to 'create_deploy_token_project_settings_ci_cd_path'
    # See MR comment for more detail: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27059#note_311585356
    create_deploy_token_project_settings_repository_path(entity, opts)
  end
end

#revoke_deploy_token_path(entity, token) ⇒ Object



19
20
21
22
23
24
25
# File 'app/helpers/ci/variables_helper.rb', line 19

def revoke_deploy_token_path(entity, token)
  if entity.is_a?(::Group)
    revoke_group_deploy_token_path(entity, token)
  else
    revoke_project_deploy_token_path(entity, token)
  end
end