Class: Readiness::GitLab::Projects
- Inherits:
-
Client
- Object
- Client
- Readiness::GitLab::Projects
show all
- Defined in:
- lib/support_readiness/gitlab/projects.rb
Overview
Instance Attribute Summary collapse
Class Method Summary
collapse
-
.access_tokens(client, project) ⇒ Array
Lists all access tokens for a project.
-
.all_members(client, project, filters = []) ⇒ Array
Lists all members in a project.
-
.create!(client, project) ⇒ Object
Creates a project within GitLab.
-
.create_badge!(client, project, params) ⇒ Hash
Creates a badge in a project.
-
.create_invitation!(client, project, data) ⇒ Array
Create a membership invitation for a project.
-
.delete_badge!(client, project, bid) ⇒ Boolean
Deletes a badge in a project.
-
.find(client, pid, attributes = []) ⇒ Hash
Locates a project within GitLab.
-
.find!(client, pid, attributes = []) ⇒ Object
Locates a project within GitLab.
-
.jobs(client, project, limit = 0, filters = []) ⇒ Array
-
.list(client, limit = 0, filters = []) ⇒ Array
-
.list_badges(client, project) ⇒ Array
Lists badges in a project.
-
.members(client, project, filters = []) ⇒ Array
Lists direct members in a project.
-
.milestones(client, project, filters = []) ⇒ Array
Lists all milestones in a project.
-
.pipelines(client, project, limit = 0, filters = []) ⇒ Array
Lists all pipelines for an object.
-
.rotate_token!(client, project, tid, expiration = (Date.today + 1.year).iso8601) ⇒ Hash
Rotates an access token for a project (revokes it and makes a new one with the same user).
-
.search(client, query) ⇒ Array
Search for a project by name.
-
.update_badge!(client, project, bid, params) ⇒ Hash
Updates a badge in a project.
-
.webhooks(client, project) ⇒ Array
Lists all project webhooks.
Instance Method Summary
collapse
Methods inherited from Client
auth_error, bad_request_error, convert_actions, convert_conditions, convert_standard_names_to_ids, convert_ticket_form_agent_conditions, convert_ticket_form_brands, convert_ticket_form_end_user_conditions, convert_ticket_form_names_to_ids, convert_view_names_to_ids, convert_view_restrictions, covert_ticket_form_field_ids, create_package!, erb_renderer, handle_request_error, not_found_error, not_processible_error, put_into_archive, recursively_deflate_directory, timestamp_filename, to_clean_json, to_clean_json_with_key, to_hash, to_nearly_clean_json, to_nearly_clean_json_with_key, to_param_string, write_entries
Constructor Details
#initialize(object = {}) ⇒ Projects
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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
|
# File 'lib/support_readiness/gitlab/projects.rb', line 25
def initialize(object = {})
@allow_merge_on_skipped_pipeline = object['allow_merge_on_skipped_pipeline']
@allow_pipeline_trigger_approve_deployment = object['allow_pipeline_trigger_approve_deployment']
@analytics_access_level = object['analytics_access_level']
@approvals_before_merge = object['approvals_before_merge']
@archived = object['archived']
@auto_cancel_pending_pipelines = object['auto_cancel_pending_pipelines']
@autoclose_referenced_issues = object['autoclose_referenced_issues']
@auto_devops_deploy_strategy = object['auto_devops_deploy_strategy']
@auto_devops_enabled = object['auto_devops_enabled']
@avatar_url = object['avatar_url']
@build_git_strategy = object['build_git_strategy']
@builds_access_level = object['builds_access_level']
@build_timeout = object['build_timeout']
@can_create_merge_request_in = object['can_create_merge_request_in']
@ci_allow_fork_pipelines_to_run_in_parent_project = object['ci_allow_fork_pipelines_to_run_in_parent_project']
@ci_config_path = object['ci_config_path']
@ci_default_git_depth = object['ci_default_git_depth']
@ci_forward_deployment_enabled = object['ci_forward_deployment_enabled']
@ci_forward_deployment_rollback_allowed = object['ci_forward_deployment_rollback_allowed']
@ci_id_token_sub_claim_components = object['ci_id_token_sub_claim_components']
@ci_job_token_scope_enabled = object['ci_job_token_scope_enabled']
@ci_pipeline_variables_minimum_override_role = object['ci_pipeline_variables_minimum_override_role']
@ci_push_repository_for_job_token_allowed = object['ci_push_repository_for_job_token_allowed']
@ci_restrict_pipeline_cancellation_role = object['ci_restrict_pipeline_cancellation_role']
@ci_separated_caches = object['ci_separated_caches']
@compliance_frameworks = object['compliance_frameworks']
@container_expiration_policy = object['container_expiration_policy']
@container_registry_access_level = object['container_registry_access_level']
@container_registry_enabled = object['container_registry_enabled']
@container_registry_image_prefix = object['container_registry_image_prefix']
@created_at = object['created_at']
@creator_id = object['creator_id']
@custom_attributes = object['custom_attributes']
@default_branch = object['default_branch']
@description = object['description']
@description_html = object['description_html']
@emails_disabled = object['emails_disabled']
@emails_enabled = object['emails_enabled']
@empty_repo = object['empty_repo']
@enforce_auth_checks_on_uploads = object['enforce_auth_checks_on_uploads']
@environments_access_level = object['environments_access_level']
@external_authorization_classification_label = object['external_authorization_classification_label']
@feature_flags_access_level = object['feature_flags_access_level']
@forked_from_project = object['forked_from_project']
@forking_access_level = object['forking_access_level']
@forks_count = object['forks_count']
@group_runners_enabled = object['group_runners_enabled']
@http_url_to_repo = object['http_url_to_repo']
@id = object['id']
@import_error = object['import_error']
@import_status = object['import_status']
@import_type = object['import_type']
@import_url = object['import_url']
@infrastructure_access_level = object['infrastructure_access_level']
@issue_branch_template = object['issue_branch_template']
@issues_access_level = object['issues_access_level']
@issues_enabled = object['issues_enabled']
@issues_template = object['issues_template']
@jobs_enabled = object['jobs_enabled']
@keep_latest_artifact = object['keep_latest_artifact']
@last_activity_at = object['last_activity_at']
@lfs_enabled = object['lfs_enabled']
@license = object['license']
@license_url = object['license_url']
@_links = object['_links']
@marked_for_deletion_at = object['marked_for_deletion_at']
@marked_for_deletion_on = object['marked_for_deletion_on']
@merge_commit_template = object['merge_commit_template']
@merge_method = object['merge_method']
@merge_pipelines_enabled = object['merge_pipelines_enabled']
@merge_requests_access_level = object['merge_requests_access_level']
@merge_requests_enabled = object['merge_requests_enabled']
@merge_requests_template = object['merge_requests_template']
@merge_trains_enabled = object['merge_trains_enabled']
@merge_trains_skip_train_allowed = object['merge_trains_skip_train_allowed']
@mirror = object['mirror']
@model_experiments_access_level = object['model_experiments_access_level']
@model_registry_access_level = object['model_registry_access_level']
@monitor_access_level = object['monitor_access_level']
@mr_default_target_self = object['mr_default_target_self']
@name = object['name']
@namespace_id = object['namespace_id']
@namespace = object['namespace']
@name_with_namespace = object['name_with_namespace']
@only_allow_merge_if_all_discussions_are_resolved = object['only_allow_merge_if_all_discussions_are_resolved']
@only_allow_merge_if_all_status_checks_passed = object['only_allow_merge_if_all_status_checks_passed']
@only_allow_merge_if_pipeline_succeeds = object['only_allow_merge_if_pipeline_succeeds']
@open_issues_count = object['open_issues_count']
@packages_enabled = object['packages_enabled']
@pages_access_level = object['pages_access_level']
@path = object['path']
@path_with_namespace = object['path_with_namespace']
@permissions = object['permissions']
@pre_receive_secret_detection_enabled = object['pre_receive_secret_detection_enabled']
@prevent_merge_without_jira_issue = object['prevent_merge_without_jira_issue']
@printing_merge_request_link_enabled = object['printing_merge_request_link_enabled']
@public_jobs = object['public_jobs']
@readme_url = object['readme_url']
@releases_access_level = object['releases_access_level']
@remove_source_branch_after_merge = object['remove_source_branch_after_merge']
@repository_access_level = object['repository_access_level']
@repository_object_format = object['repository_object_format']
@repository_storage = object['repository_storage']
@request_access_enabled = object['request_access_enabled']
@requirements_access_level = object['requirements_access_level']
@requirements_enabled = object['requirements_enabled']
@resolve_outdated_diff_discussions = object['resolve_outdated_diff_discussions']
@restrict_user_defined_variables = object['restrict_user_defined_variables']
@runners_token = object['runners_token']
@runner_token_expiration_interval = object['runner_token_expiration_interval']
@security_and_compliance_access_level = object['security_and_compliance_access_level']
@security_and_compliance_enabled = object['security_and_compliance_enabled']
@service_desk_address = object['service_desk_address']
@service_desk_enabled = object['service_desk_enabled']
@shared_runners_enabled = object['shared_runners_enabled']
@shared_with_groups = object['shared_with_groups']
@snippets_access_level = object['snippets_access_level']
@snippets_enabled = object['snippets_enabled']
@squash_commit_template = object['squash_commit_template']
@squash_option = object['squash_option']
@ssh_url_to_repo = object['ssh_url_to_repo']
@star_count = object['star_count']
@statistics = object['statistics']
@suggestion_commit_message = object['suggestion_commit_message']
@tag_list = object['tag_list']
@topics = object['topics']
@updated_at = object['updated_at']
@visibility = object['visibility']
@warn_about_potentially_unwanted_characters = object['warn_about_potentially_unwanted_characters']
@web_url = object['web_url']
@wiki_access_level = object['wiki_access_level']
@wiki_enabled = object['wiki_enabled']
end
|
Instance Attribute Details
#_links ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def _links
@_links
end
|
#allow_merge_on_skipped_pipeline ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def allow_merge_on_skipped_pipeline
@allow_merge_on_skipped_pipeline
end
|
#allow_pipeline_trigger_approve_deployment ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def allow_pipeline_trigger_approve_deployment
@allow_pipeline_trigger_approve_deployment
end
|
#analytics_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def analytics_access_level
@analytics_access_level
end
|
#approvals_before_merge ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def approvals_before_merge
@approvals_before_merge
end
|
#archived ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def archived
@archived
end
|
#auto_cancel_pending_pipelines ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def auto_cancel_pending_pipelines
@auto_cancel_pending_pipelines
end
|
#auto_devops_deploy_strategy ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def auto_devops_deploy_strategy
@auto_devops_deploy_strategy
end
|
#auto_devops_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def auto_devops_enabled
@auto_devops_enabled
end
|
#autoclose_referenced_issues ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def autoclose_referenced_issues
@autoclose_referenced_issues
end
|
#avatar_url ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def avatar_url
@avatar_url
end
|
#build_git_strategy ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def build_git_strategy
@build_git_strategy
end
|
#build_timeout ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def build_timeout
@build_timeout
end
|
#builds_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def builds_access_level
@builds_access_level
end
|
#can_create_merge_request_in ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def can_create_merge_request_in
@can_create_merge_request_in
end
|
#ci_allow_fork_pipelines_to_run_in_parent_project ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_allow_fork_pipelines_to_run_in_parent_project
@ci_allow_fork_pipelines_to_run_in_parent_project
end
|
#ci_config_path ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_config_path
@ci_config_path
end
|
#ci_default_git_depth ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_default_git_depth
@ci_default_git_depth
end
|
#ci_forward_deployment_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_forward_deployment_enabled
@ci_forward_deployment_enabled
end
|
#ci_forward_deployment_rollback_allowed ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_forward_deployment_rollback_allowed
@ci_forward_deployment_rollback_allowed
end
|
#ci_id_token_sub_claim_components ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_id_token_sub_claim_components
@ci_id_token_sub_claim_components
end
|
#ci_job_token_scope_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_job_token_scope_enabled
@ci_job_token_scope_enabled
end
|
#ci_pipeline_variables_minimum_override_role ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_pipeline_variables_minimum_override_role
@ci_pipeline_variables_minimum_override_role
end
|
#ci_push_repository_for_job_token_allowed ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_push_repository_for_job_token_allowed
@ci_push_repository_for_job_token_allowed
end
|
#ci_restrict_pipeline_cancellation_role ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_restrict_pipeline_cancellation_role
@ci_restrict_pipeline_cancellation_role
end
|
#ci_separated_caches ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ci_separated_caches
@ci_separated_caches
end
|
#compliance_frameworks ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def compliance_frameworks
@compliance_frameworks
end
|
#container_expiration_policy ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def container_expiration_policy
@container_expiration_policy
end
|
#container_registry_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def container_registry_access_level
@container_registry_access_level
end
|
#container_registry_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def container_registry_enabled
@container_registry_enabled
end
|
#container_registry_image_prefix ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def container_registry_image_prefix
@container_registry_image_prefix
end
|
#created_at ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def created_at
@created_at
end
|
#creator_id ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def creator_id
@creator_id
end
|
#custom_attributes ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def custom_attributes
@custom_attributes
end
|
#default_branch ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def default_branch
@default_branch
end
|
#description ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def description
@description
end
|
#description_html ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def description_html
@description_html
end
|
#emails_disabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def emails_disabled
@emails_disabled
end
|
#emails_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def emails_enabled
@emails_enabled
end
|
#empty_repo ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def empty_repo
@empty_repo
end
|
#enforce_auth_checks_on_uploads ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def enforce_auth_checks_on_uploads
@enforce_auth_checks_on_uploads
end
|
#environments_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def environments_access_level
@environments_access_level
end
|
#external_authorization_classification_label ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def external_authorization_classification_label
@external_authorization_classification_label
end
|
#feature_flags_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def feature_flags_access_level
@feature_flags_access_level
end
|
#forked_from_project ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def forked_from_project
@forked_from_project
end
|
#forking_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def forking_access_level
@forking_access_level
end
|
#forks_count ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def forks_count
@forks_count
end
|
#group_runners_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def group_runners_enabled
@group_runners_enabled
end
|
#http_url_to_repo ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def http_url_to_repo
@http_url_to_repo
end
|
#id ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def id
@id
end
|
#import_error ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def import_error
@import_error
end
|
#import_status ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def import_status
@import_status
end
|
#import_type ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def import_type
@import_type
end
|
#import_url ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def import_url
@import_url
end
|
#infrastructure_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def infrastructure_access_level
@infrastructure_access_level
end
|
#issue_branch_template ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def issue_branch_template
@issue_branch_template
end
|
#issues_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def issues_access_level
@issues_access_level
end
|
#issues_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def issues_enabled
@issues_enabled
end
|
#issues_template ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def issues_template
@issues_template
end
|
#jobs_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def jobs_enabled
@jobs_enabled
end
|
#keep_latest_artifact ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def keep_latest_artifact
@keep_latest_artifact
end
|
#last_activity_at ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def last_activity_at
@last_activity_at
end
|
#lfs_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def lfs_enabled
@lfs_enabled
end
|
#license ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def license
@license
end
|
#license_url ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def license_url
@license_url
end
|
#marked_for_deletion_at ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def marked_for_deletion_at
@marked_for_deletion_at
end
|
#marked_for_deletion_on ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def marked_for_deletion_on
@marked_for_deletion_on
end
|
#merge_commit_template ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_commit_template
@merge_commit_template
end
|
#merge_method ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_method
@merge_method
end
|
#merge_pipelines_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_pipelines_enabled
@merge_pipelines_enabled
end
|
#merge_requests_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_requests_access_level
@merge_requests_access_level
end
|
#merge_requests_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_requests_enabled
@merge_requests_enabled
end
|
#merge_requests_template ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_requests_template
@merge_requests_template
end
|
#merge_trains_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_trains_enabled
@merge_trains_enabled
end
|
#merge_trains_skip_train_allowed ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def merge_trains_skip_train_allowed
@merge_trains_skip_train_allowed
end
|
#mirror ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def mirror
@mirror
end
|
#model_experiments_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def model_experiments_access_level
@model_experiments_access_level
end
|
#model_registry_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def model_registry_access_level
@model_registry_access_level
end
|
#monitor_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def monitor_access_level
@monitor_access_level
end
|
#mr_default_target_self ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def mr_default_target_self
@mr_default_target_self
end
|
#name ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def name
@name
end
|
#name_with_namespace ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def name_with_namespace
@name_with_namespace
end
|
#namespace ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def namespace
@namespace
end
|
#namespace_id ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def namespace_id
@namespace_id
end
|
#only_allow_merge_if_all_discussions_are_resolved ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def only_allow_merge_if_all_discussions_are_resolved
@only_allow_merge_if_all_discussions_are_resolved
end
|
#only_allow_merge_if_all_status_checks_passed ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def only_allow_merge_if_all_status_checks_passed
@only_allow_merge_if_all_status_checks_passed
end
|
#only_allow_merge_if_pipeline_succeeds ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def only_allow_merge_if_pipeline_succeeds
@only_allow_merge_if_pipeline_succeeds
end
|
#open_issues_count ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def open_issues_count
@open_issues_count
end
|
#packages_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def packages_enabled
@packages_enabled
end
|
#pages_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def pages_access_level
@pages_access_level
end
|
#path ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def path
@path
end
|
#path_with_namespace ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def path_with_namespace
@path_with_namespace
end
|
#permissions ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def permissions
@permissions
end
|
#pre_receive_secret_detection_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def pre_receive_secret_detection_enabled
@pre_receive_secret_detection_enabled
end
|
#prevent_merge_without_jira_issue ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def prevent_merge_without_jira_issue
@prevent_merge_without_jira_issue
end
|
#printing_merge_request_link_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def printing_merge_request_link_enabled
@printing_merge_request_link_enabled
end
|
#public_jobs ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def public_jobs
@public_jobs
end
|
#readme_url ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def readme_url
@readme_url
end
|
#releases_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def releases_access_level
@releases_access_level
end
|
#remove_source_branch_after_merge ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def remove_source_branch_after_merge
@remove_source_branch_after_merge
end
|
#repository_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def repository_access_level
@repository_access_level
end
|
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def repository_object_format
@repository_object_format
end
|
#repository_storage ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def repository_storage
@repository_storage
end
|
#request_access_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def request_access_enabled
@request_access_enabled
end
|
#requirements_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def requirements_access_level
@requirements_access_level
end
|
#requirements_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def requirements_enabled
@requirements_enabled
end
|
#resolve_outdated_diff_discussions ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def resolve_outdated_diff_discussions
@resolve_outdated_diff_discussions
end
|
#restrict_user_defined_variables ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def restrict_user_defined_variables
@restrict_user_defined_variables
end
|
#runner_token_expiration_interval ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def runner_token_expiration_interval
@runner_token_expiration_interval
end
|
#runners_token ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def runners_token
@runners_token
end
|
#security_and_compliance_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def security_and_compliance_access_level
@security_and_compliance_access_level
end
|
#security_and_compliance_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def security_and_compliance_enabled
@security_and_compliance_enabled
end
|
#service_desk_address ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def service_desk_address
@service_desk_address
end
|
#service_desk_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def service_desk_enabled
@service_desk_enabled
end
|
#shared_runners_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def shared_runners_enabled
@shared_runners_enabled
end
|
#shared_with_groups ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def shared_with_groups
@shared_with_groups
end
|
#snippets_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def snippets_access_level
@snippets_access_level
end
|
#snippets_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def snippets_enabled
@snippets_enabled
end
|
#squash_commit_template ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def squash_commit_template
@squash_commit_template
end
|
#squash_option ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def squash_option
@squash_option
end
|
#ssh_url_to_repo ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def ssh_url_to_repo
@ssh_url_to_repo
end
|
#star_count ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def star_count
@star_count
end
|
#statistics ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def statistics
@statistics
end
|
#suggestion_commit_message ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def suggestion_commit_message
@suggestion_commit_message
end
|
#tag_list ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def tag_list
@tag_list
end
|
#topics ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def topics
@topics
end
|
#updated_at ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def updated_at
@updated_at
end
|
#visibility ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def visibility
@visibility
end
|
#warn_about_potentially_unwanted_characters ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def warn_about_potentially_unwanted_characters
@warn_about_potentially_unwanted_characters
end
|
#web_url ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def web_url
@web_url
end
|
#wiki_access_level ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def wiki_access_level
@wiki_access_level
end
|
#wiki_enabled ⇒ Object
14
15
16
|
# File 'lib/support_readiness/gitlab/projects.rb', line 14
def wiki_enabled
@wiki_enabled
end
|
Class Method Details
.access_tokens(client, project) ⇒ Array
Lists all access tokens for a project
328
329
330
331
332
|
# File 'lib/support_readiness/gitlab/projects.rb', line 328
def self.access_tokens(client, project)
response = client.connection.get "projects/#{project.id}/access_tokens"
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
Oj.load(response.body)
end
|
.all_members(client, project, filters = []) ⇒ Array
Lists all members in a project. This method can take a long time to run depending on the parameters used.
420
421
422
423
424
425
426
427
428
429
430
431
432
433
|
# File 'lib/support_readiness/gitlab/projects.rb', line 420
def self.all_members(client, project, filters = [])
array = []
page = 1
loop do
response = client.connection.get "projects/#{project.id}/members/all?per_page=100&page=#{page}&#{to_param_string(filters)}"
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
body = Oj.load(response.body)
array += body
break if body.count < 100
page += 1
end
array
end
|
.create!(client, project) ⇒ Object
Creates a project within GitLab. This will exit on error
304
305
306
307
308
|
# File 'lib/support_readiness/gitlab/projects.rb', line 304
def self.create!(client, project)
response = client.connection.post 'projects', to_clean_json(project)
handle_request_error(1, 'GitLab', response.status, { action: 'Create project', id: '' }) unless response.status == 200
Projects.new(Oj.load(response.body))
end
|
.create_badge!(client, project, params) ⇒ Hash
Creates a badge in a project.
483
484
485
486
487
|
# File 'lib/support_readiness/gitlab/projects.rb', line 483
def self.create_badge!(client, project, params)
response = client.connection.post "projects/#{project.id}/badges", params.to_json
handle_request_error(1, 'GitLab', response.status, { action: 'Create badge', id: project.id }) unless response.status == 200
Oj.load(response.body)
end
|
.create_invitation!(client, project, data) ⇒ Array
Create a membership invitation for a project. This will exit on error
685
686
687
688
689
|
# File 'lib/support_readiness/gitlab/projects.rb', line 685
def self.create_invitation!(client, project, data)
response = client.connection.post "projects/#{project.id}/invitations", data.to_json
handle_request_error(1, 'GitLab', response.status, { action: 'Invite people', id: project.id }) unless response.status == 200
Oj.load(response.body)
end
|
.delete_badge!(client, project, bid) ⇒ Boolean
Deletes a badge in a project.
537
538
539
540
541
|
# File 'lib/support_readiness/gitlab/projects.rb', line 537
def self.delete_badge!(client, project, bid)
response = client.connection.delete "projects/#{project.id}/badges/#{bid}"
handle_request_error(1, 'GitLab', response.status, { action: 'Delete badge', id: project.id }) unless response.status == 200
true
end
|
.find(client, pid, attributes = []) ⇒ Hash
Locates a project within GitLab. This will not exit on error (except Authentication errors)
213
214
215
216
217
218
219
220
221
222
|
# File 'lib/support_readiness/gitlab/projects.rb', line 213
def self.find(client, pid, attributes = [])
response = client.connection.get("projects/#{pid}?#{to_param_string(attributes)}")
if response.status == 301
response = client.connection.get("projects/#{response.body.split('/').last}?#{to_param_string(attributes)}")
end
handle_request_error(0, 'GitLab', response.status, { action: 'get', id: pid }) unless response.status == 200
return Projects.new(Oj.load(response.body)) if response.status == 200
Oj.load(response.body)
end
|
.find!(client, pid, attributes = []) ⇒ Object
Locates a project within GitLab. This will exit on error
242
243
244
245
246
247
248
249
|
# File 'lib/support_readiness/gitlab/projects.rb', line 242
def self.find!(client, pid, attributes = [])
response = client.connection.get("projects/#{pid}?#{to_param_string(attributes)}")
if response.status == 301
response = client.connection.get("projects/#{response.body.split('/').last}?#{to_param_string(attributes)}")
end
handle_request_error(1, 'GitLab', response.status, { action: 'Find project', id: pid }) unless response.status == 200
Projects.new(Oj.load(response.body))
end
|
.jobs(client, project, limit = 0, filters = []) ⇒ Array
623
624
625
|
# File 'lib/support_readiness/gitlab/projects.rb', line 623
def self.jobs(client, project, limit = 0, filters = [])
Jobs.list_project(client, project, limit, filters)
end
|
.list(client, limit = 0, filters = []) ⇒ Array
Lists projects. Does not stop until it ends or the page limit is hit. This method can take a long time to run depending on the parameters used.
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
# File 'lib/support_readiness/gitlab/projects.rb', line 179
def self.list(client, limit = 0, filters = [])
array = []
url = "projects?per_page=100&pagination=keyset&order_by=id&sort=asc&id_after=0&#{to_param_string(filters)}"
loop do
response = client.connection.get url
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
body = Oj.load(response.body)
array += body.map { |p| Projects.new(p) }
break if body.count < 100
break if limit != 0 && array.count >= (limit * 100)
url = "projects?per_page=100&pagination=keyset&order_by=id&sort=asc&id_after=#{body.last['id']}&#{to_param_string(filters)}"
end
array
end
|
.list_badges(client, project) ⇒ Array
Lists badges in a project.
453
454
455
456
457
|
# File 'lib/support_readiness/gitlab/projects.rb', line 453
def self.list_badges(client, project)
response = client.connection.get "projects/#{project.id}/badges"
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
Oj.load(response.body)
end
|
.members(client, project, filters = []) ⇒ Array
Lists direct members in a project. This method can take a long time to run depending on the parameters used.
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
# File 'lib/support_readiness/gitlab/projects.rb', line 385
def self.members(client, project, filters = [])
array = []
page = 1
loop do
response = client.connection.get "projects/#{project.id}/members?per_page=100&page=#{page}&#{to_param_string(filters)}"
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
body = Oj.load(response.body)
array += body
break if body.count < 100
page += 1
end
array
end
|
.milestones(client, project, filters = []) ⇒ Array
Lists all milestones in a project. This method can take a long time to run depending on the parameters used.
563
564
565
566
567
568
569
570
571
572
573
574
575
576
|
# File 'lib/support_readiness/gitlab/projects.rb', line 563
def self.milestones(client, project, filters = [])
array = []
page = 1
loop do
response = client.connection.get "projects/#{project.id}/milestones?per_page=100&page=#{page}&#{to_param_string(filters)}"
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
body = Oj.load(response.body)
array += body
break if body.count < 100
page += 1
end
array
end
|
.pipelines(client, project, limit = 0, filters = []) ⇒ Array
598
599
600
|
# File 'lib/support_readiness/gitlab/projects.rb', line 598
def self.pipelines(client, project, limit = 0, filters = [])
Pipelines.list(client, project, limit, filters)
end
|
.rotate_token!(client, project, tid, expiration = (Date.today + 1.year).iso8601) ⇒ Hash
Rotates an access token for a project (revokes it and makes a new one with the same user)
359
360
361
362
363
|
# File 'lib/support_readiness/gitlab/projects.rb', line 359
def self.rotate_token!(client, project, tid, expiration = (Date.today + 1.year).iso8601)
response = client.connection.post "projects/#{project.id}/access_tokens/#{tid}/rotate", { expires_at: expiration }.to_json
handle_request_error(1, 'GitLab', response.status, { action: 'Rotate access token', id: project.id }) unless response.status == 200
Oj.load(response.body)
end
|
.search(client, query) ⇒ Array
Search for a project by name. This method can take a long time to run depending on the number of results found.
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
# File 'lib/support_readiness/gitlab/projects.rb', line 269
def self.search(client, query)
array = []
url = "projects?per_page=100&pagination=keyset&order_by=id&sort=asc&id_after=0&search=#{query}"
loop do
response = client.connection.get url
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
body = Oj.load(response.body)
array += body.map { |p| Projects.new(p) }
break if body.count < 100
url = "projects?per_page=100&pagination=keyset&order_by=id&sort=asc&id_after=#{body.last['id']}&search=#{query}"
end
array
end
|
.update_badge!(client, project, bid, params) ⇒ Hash
Updates a badge in a project.
512
513
514
515
516
|
# File 'lib/support_readiness/gitlab/projects.rb', line 512
def self.update_badge!(client, project, bid, params)
response = client.connection.put "projects/#{project.id}/badges/#{bid}", params.to_json
handle_request_error(1, 'GitLab', response.status, { action: 'Update badge', id: project.id }) unless response.status == 200
Oj.load(response.body)
end
|
.webhooks(client, project) ⇒ Array
645
646
647
|
# File 'lib/support_readiness/gitlab/projects.rb', line 645
def self.webhooks(client, project)
ProjectWebhooks.list(client, project)
end
|