Module: API::Helpers::ProjectsHelpers

Extended by:
ActiveSupport::Concern, Grape::API::Helpers
Defined in:
lib/api/helpers/projects_helpers.rb

Constant Summary collapse

STATISTICS_SORT_PARAMS =
%w[storage_size repository_size wiki_size packages_size].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.update_params_at_least_one_ofObject


119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/api/helpers/projects_helpers.rb', line 119

def self.update_params_at_least_one_of
  [
    :allow_merge_on_skipped_pipeline,
    :analytics_access_level,
    :autoclose_referenced_issues,
    :auto_devops_enabled,
    :auto_devops_deploy_strategy,
    :auto_cancel_pending_pipelines,
    :build_git_strategy,
    :build_timeout,
    :builds_access_level,
    :ci_config_path,
    :ci_default_git_depth,
    :ci_forward_deployment_enabled,
    :container_registry_access_level,
    :container_expiration_policy_attributes,
    :default_branch,
    :description,
    :emails_disabled,
    :forking_access_level,
    :issues_access_level,
    :lfs_enabled,
    :merge_pipelines_enabled,
    :merge_requests_access_level,
    :merge_requests_template,
    :merge_trains_enabled,
    :merge_method,
    :name,
    :only_allow_merge_if_all_discussions_are_resolved,
    :only_allow_merge_if_pipeline_succeeds,
    :operations_access_level,
    :pages_access_level,
    :path,
    :printing_merge_request_link_enabled,
    :public_builds,
    :remove_source_branch_after_merge,
    :repository_access_level,
    :request_access_enabled,
    :resolve_outdated_diff_discussions,
    :restrict_user_defined_variables,
    :security_and_compliance_access_level,
    :squash_option,
    :shared_runners_enabled,
    :snippets_access_level,
    :tag_list,
    :topics,
    :visibility,
    :wiki_access_level,
    :avatar,
    :suggestion_commit_message,
    :merge_commit_template,
    :squash_commit_template,
    :repository_storage,
    :compliance_framework_setting,
    :packages_enabled,
    :service_desk_enabled,
    :keep_latest_artifact,
    :mr_default_target_self,
    :enforce_auth_checks_on_uploads,

    # TODO: remove in API v5, replaced by *_access_level
    :issues_enabled,
    :jobs_enabled,
    :merge_requests_enabled,
    :wiki_enabled,
    :snippets_enabled,
    :container_registry_enabled
  ]
end

Instance Method Details

#filter_attributes_using_license!(attrs) ⇒ Object


189
190
# File 'lib/api/helpers/projects_helpers.rb', line 189

def filter_attributes_using_license!(attrs)
end

#validate_git_import_url!(import_url) ⇒ Object


192
193
194
195
196
197
198
199
200
# File 'lib/api/helpers/projects_helpers.rb', line 192

def validate_git_import_url!(import_url)
  return if import_url.blank?

  result = Import::ValidateRemoteGitEndpointService.new(url: import_url).execute # network call

  if result.error?
    render_api_error!(result.message, 422)
  end
end