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



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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/api/helpers/projects_helpers.rb', line 146

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_allow_fork_pipelines_to_run_in_parent_project,
    :ci_forward_deployment_enabled,
    :ci_forward_deployment_rollback_allowed,
    :ci_separated_caches,
    :container_registry_access_level,
    :container_expiration_policy_attributes,
    :default_branch,
    :description,
    :emails_disabled, # deprecated
    :emails_enabled,
    :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,
    :pages_access_level,
    :path,
    :printing_merge_request_link_enabled,
    :public_builds, # deprecated
    :public_jobs,
    :remove_source_branch_after_merge,
    :repository_access_level,
    :request_access_enabled,
    :resolve_outdated_diff_discussions,
    :restrict_user_defined_variables,
    :show_diff_preview_in_email,
    :security_and_compliance_access_level,
    :squash_option,
    :shared_runners_enabled,
    :group_runners_enabled,
    :snippets_access_level,
    :tag_list,
    :topics,
    :visibility,
    :wiki_access_level,
    :avatar,
    :suggestion_commit_message,
    :merge_commit_template,
    :squash_commit_template,
    :issue_branch_template,
    :repository_storage,
    :packages_enabled,
    :service_desk_enabled,
    :keep_latest_artifact,
    :mr_default_target_self,
    :enforce_auth_checks_on_uploads,
    :releases_access_level,
    :environments_access_level,
    :feature_flags_access_level,
    :infrastructure_access_level,
    :monitor_access_level,
    :model_experiments_access_level,
    :model_registry_access_level,
    :warn_about_potentially_unwanted_characters,
    :ci_pipeline_variables_minimum_override_role,
    :ci_push_repository_for_job_token_allowed,
    :ci_delete_pipelines_in_seconds,

    # 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



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

def filter_attributes_using_license!(attrs); end

#validate_git_import_url!(import_url) ⇒ Object



235
236
237
238
239
240
241
242
243
# File 'lib/api/helpers/projects_helpers.rb', line 235

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