gitlab 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitlab/client/access_requests.rb +92 -90
- data/lib/gitlab/client/award_emojis.rb +126 -124
- data/lib/gitlab/client/boards.rb +81 -79
- data/lib/gitlab/client/branches.rb +89 -87
- data/lib/gitlab/client/build_variables.rb +117 -115
- data/lib/gitlab/client/builds.rb +98 -96
- data/lib/gitlab/client/commits.rb +167 -152
- data/lib/gitlab/client/deployments.rb +29 -27
- data/lib/gitlab/client/environments.rb +80 -78
- data/lib/gitlab/client/events.rb +54 -52
- data/lib/gitlab/client/group_milestones.rb +85 -83
- data/lib/gitlab/client/groups.rb +178 -176
- data/lib/gitlab/client/issues.rb +212 -188
- data/lib/gitlab/client/jobs.rb +150 -148
- data/lib/gitlab/client/keys.rb +14 -12
- data/lib/gitlab/client/labels.rb +79 -77
- data/lib/gitlab/client/merge_request_approvals.rb +101 -99
- data/lib/gitlab/client/merge_requests.rb +291 -277
- data/lib/gitlab/client/milestones.rb +85 -83
- data/lib/gitlab/client/namespaces.rb +18 -16
- data/lib/gitlab/client/notes.rb +260 -258
- data/lib/gitlab/client/pipeline_schedules.rb +123 -121
- data/lib/gitlab/client/pipeline_triggers.rb +93 -91
- data/lib/gitlab/client/pipelines.rb +73 -60
- data/lib/gitlab/client/projects.rb +538 -524
- data/lib/gitlab/client/repositories.rb +67 -65
- data/lib/gitlab/client/repository_files.rb +103 -101
- data/lib/gitlab/client/runners.rb +114 -112
- data/lib/gitlab/client/services.rb +45 -43
- data/lib/gitlab/client/sidekiq.rb +32 -30
- data/lib/gitlab/client/snippets.rb +86 -84
- data/lib/gitlab/client/system_hooks.rb +57 -55
- data/lib/gitlab/client/tags.rb +88 -86
- data/lib/gitlab/client/todos.rb +40 -38
- data/lib/gitlab/client/users.rb +243 -241
- data/lib/gitlab/client/versions.rb +13 -11
- data/lib/gitlab/error.rb +1 -1
- data/lib/gitlab/help.rb +1 -1
- data/lib/gitlab/page_links.rb +1 -1
- data/lib/gitlab/version.rb +1 -1
- metadata +3 -3
data/lib/gitlab/client/jobs.rb
CHANGED
@@ -1,162 +1,164 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to projects.
|
5
|
+
# @see https://docs.gitlab.com/ee/api/jobs.html
|
6
|
+
module Jobs
|
7
|
+
# Gets a list of Jobs for a Project
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.jobs(1)
|
11
|
+
# Gitlab.jobs("project")
|
12
|
+
#
|
13
|
+
# @param [Integer, String] id The ID or name of a project.
|
14
|
+
# @param [Hash] options A customizable set of options.
|
15
|
+
# @option options [Array] :scope The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def jobs(project_id, options = {})
|
18
|
+
get("/projects/#{url_encode project_id}/jobs", query: options)
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
21
|
+
# Gets a list of Jobs from a pipeline
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.pipeline_jobs(1, 2)
|
25
|
+
# Gitlab.pipeline_jobs("project", 2)
|
26
|
+
#
|
27
|
+
# @param [Integer, String] The ID or name of a project.
|
28
|
+
# @param [Integer] the id of the pipeline
|
29
|
+
# @param [Hash] options A customizable set of options.
|
30
|
+
# @option options [Array] :scope The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.
|
31
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
32
|
+
def pipeline_jobs(project_id, pipeline_id, options = {})
|
33
|
+
get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: options)
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
# Gets a single job
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# Gitlab.job(1, 2)
|
40
|
+
# Gitlab.job("project", 2)
|
41
|
+
#
|
42
|
+
# @param [Integer, String] The ID or name of a project.
|
43
|
+
# @param [Integer] the id of the job
|
44
|
+
def job(project_id, job_id)
|
45
|
+
get("/projects/#{url_encode project_id}/jobs/#{job_id}")
|
46
|
+
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
48
|
+
# Gets artifacts from a job
|
49
|
+
#
|
50
|
+
# @example
|
51
|
+
# Gitlab.job_artifacts(1, 2)
|
52
|
+
# Gitlab.job_artifacts("project", 2)
|
53
|
+
#
|
54
|
+
# @param [Integer, String] The ID or name of a project.
|
55
|
+
# @param [Integer] the id of the job
|
56
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
57
|
+
def job_artifacts(project_id, job_id)
|
58
|
+
get("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts",
|
59
|
+
format: nil,
|
60
|
+
headers: { Accept: 'text/plain' },
|
61
|
+
parser: ::Gitlab::Request::Parser)
|
62
|
+
end
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
64
|
+
# Download Job Artifact
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# Gitlab.job_artifacts_download(1, "master", "release")
|
68
|
+
# Gitlab.job_artifacts_download("project", "master", "release")
|
69
|
+
#
|
70
|
+
# @param [Integer, String] id, The ID or name of a project.
|
71
|
+
# @param [String] ref, Ref Name
|
72
|
+
# @param [String] job, jobname
|
73
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
74
|
+
def job_artifacts_download(project_id, ref_name, job_name)
|
75
|
+
get("/projects/#{url_encode project_id}/jobs/artifacts/#{ref_name}/download", query: { job: job_name },
|
76
|
+
format: nil,
|
77
|
+
headers: { Accept: 'text/plain' },
|
78
|
+
parser: ::Gitlab::Request::Parser)
|
79
|
+
end
|
79
80
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
81
|
+
# Get Job Trace
|
82
|
+
#
|
83
|
+
# @example
|
84
|
+
# Gitlab.job_trace(1,1)
|
85
|
+
# Gitlab.job_trace("project", 1)
|
86
|
+
#
|
87
|
+
# @param [Integer, String] The ID or name of a project.
|
88
|
+
# @param [Integer] the id of the job
|
89
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
90
|
+
def job_trace(project_id, job_id)
|
91
|
+
get("/projects/#{url_encode project_id}/jobs/#{job_id}/trace",
|
92
|
+
format: nil,
|
93
|
+
headers: { Accept: 'text/plain' },
|
94
|
+
parser: ::Gitlab::Request::Parser)
|
95
|
+
end
|
95
96
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
97
|
+
# Cancel a job
|
98
|
+
#
|
99
|
+
# @example
|
100
|
+
# Gitlab.job_cancel(1,1)
|
101
|
+
# Gitlab.job_cancel("project", 1)
|
102
|
+
#
|
103
|
+
# @param [Integer, String] The ID or name of a project.
|
104
|
+
# @param [Integer] the id of the job
|
105
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
106
|
+
def job_cancel(project_id, job_id)
|
107
|
+
post("/projects/#{url_encode project_id}/jobs/#{job_id}/cancel")
|
108
|
+
end
|
108
109
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
110
|
+
# Retry a job
|
111
|
+
#
|
112
|
+
# @example
|
113
|
+
# Gitlab.job_retry(1,1)
|
114
|
+
# Gitlab.job_retry("project", 1)
|
115
|
+
#
|
116
|
+
# @param [Integer, String] The ID or name of a project.
|
117
|
+
# @param [Integer] the id of the job
|
118
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
119
|
+
def job_retry(project_id, job_id)
|
120
|
+
post("/projects/#{url_encode project_id}/jobs/#{job_id}/retry")
|
121
|
+
end
|
121
122
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
123
|
+
# Erase Job
|
124
|
+
#
|
125
|
+
# @example
|
126
|
+
# Gitlab.job_erase(1,1)
|
127
|
+
# Gitlab.job_erase("project", 1)
|
128
|
+
#
|
129
|
+
# @param [Integer, String] The ID or name of a project.
|
130
|
+
# @param [Integer] the id of the job
|
131
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
132
|
+
def job_erase(project_id, job_id)
|
133
|
+
post("/projects/#{url_encode project_id}/jobs/#{job_id}/erase")
|
134
|
+
end
|
134
135
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
136
|
+
# Play a Job
|
137
|
+
# Triggers a manual action to start a job.
|
138
|
+
#
|
139
|
+
# @example
|
140
|
+
# Gitlab.job_play(1,1)
|
141
|
+
# Gitlab.job_play("project", 1)
|
142
|
+
#
|
143
|
+
# @param [Integer, String] The ID or name of a project.
|
144
|
+
# @param [Integer] the id of the job
|
145
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
146
|
+
def job_play(project_id, job_id)
|
147
|
+
post("/projects/#{url_encode project_id}/jobs/#{job_id}/play")
|
148
|
+
end
|
148
149
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
150
|
+
# Keep Artifacts
|
151
|
+
# Prevents artifacts from being deleted when expiration is set.
|
152
|
+
#
|
153
|
+
# @example
|
154
|
+
# Gitlab.job_artifacts_keep(1,1)
|
155
|
+
# Gitlab.job_artifacts_keep("project", 1)
|
156
|
+
#
|
157
|
+
# @param [Integer, String] The ID or name of a project.
|
158
|
+
# @param [Integer] the id of the job
|
159
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
160
|
+
def job_artifacts_keep(project_id, job_id)
|
161
|
+
post("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts/keep")
|
162
|
+
end
|
161
163
|
end
|
162
164
|
end
|
data/lib/gitlab/client/keys.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to keys.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/keys.html
|
6
|
+
module Keys
|
7
|
+
# Gets information about a key.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.key(1)
|
11
|
+
#
|
12
|
+
# @param [Integer] id The ID of a key.
|
13
|
+
# @return [Gitlab::ObjectifiedHash]
|
14
|
+
def key(id)
|
15
|
+
get("/keys/#{id}")
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
data/lib/gitlab/client/labels.rb
CHANGED
@@ -1,86 +1,88 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to labels.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/labels.html
|
6
|
+
module Labels
|
7
|
+
# Gets a list of project's labels.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.labels(5)
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project The ID or name of a project.
|
13
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
14
|
+
def labels(project, options = {})
|
15
|
+
get("/projects/#{url_encode project}/labels", query: options)
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
# Creates a new label.
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
# Gitlab.create_label(42, "Backlog", '#DD10AA')
|
22
|
+
#
|
23
|
+
# @param [Integer, String] project The ID or name of a project.
|
24
|
+
# @param [String] name The name of a label.
|
25
|
+
# @param [String] color The color of a label.
|
26
|
+
# @param [Hash] options A customizable set of options.
|
27
|
+
# @option options [String] :description The description of the label.
|
28
|
+
# @option options [String] :priority The priority of the label. Must be greater or equal than zero or null to remove the priority.
|
29
|
+
# @return [Gitlab::ObjectifiedHash] Information about created label.
|
30
|
+
def create_label(project, name, color, options = {})
|
31
|
+
post("/projects/#{url_encode project}/labels", body: options.merge(name: name, color: color))
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
34
|
+
# Updates a label.
|
35
|
+
#
|
36
|
+
# @example
|
37
|
+
# Gitlab.edit_label(42, "Backlog", { new_name: 'TODO' })
|
38
|
+
# Gitlab.edit_label(42, "Backlog", { new_name: 'TODO', color: '#DD10AA' })
|
39
|
+
#
|
40
|
+
# @param [Integer, String] project The ID or name of a project.
|
41
|
+
# @param [String] name The name of a label.
|
42
|
+
# @param [Hash] options A customizable set of options.
|
43
|
+
# @option options [String] :new_name The new name of a label.
|
44
|
+
# @option options [String] :color The color of a label.
|
45
|
+
# @option options [String] :description The description of the label.
|
46
|
+
# @option options [String] :priority The priority of the label. Must be greater or equal than zero or null to remove the priority.
|
47
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated label.
|
48
|
+
def edit_label(project, name, options = {})
|
49
|
+
put("/projects/#{url_encode project}/labels", body: options.merge(name: name))
|
50
|
+
end
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
52
|
+
# Deletes a label.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
# Gitlab.delete_label(2, 'Backlog')
|
56
|
+
#
|
57
|
+
# @param [Integer, String] project The ID or name of a project.
|
58
|
+
# @param [String] name The name of a label.
|
59
|
+
# @return [Gitlab::ObjectifiedHash] Information about deleted label.
|
60
|
+
def delete_label(project, name)
|
61
|
+
delete("/projects/#{url_encode project}/labels", body: { name: name })
|
62
|
+
end
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
64
|
+
# Subscribes the user to a label to receive notifications
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# Gitlab.subscribe_to_label(2, 'Backlog')
|
68
|
+
#
|
69
|
+
# @param [Integer, String] project The ID or name of a project.
|
70
|
+
# @param [String] name The name of a label.
|
71
|
+
# @return [Gitlab::ObjectifiedHash] Information about the label subscribed to.
|
72
|
+
def subscribe_to_label(project, name)
|
73
|
+
post("/projects/#{url_encode project}/labels/#{url_encode name}/subscribe")
|
74
|
+
end
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
76
|
+
# Unsubscribes the user from a label to not receive notifications from it
|
77
|
+
#
|
78
|
+
# @example
|
79
|
+
# Gitlab.unsubscribe_from_label(2, 'Backlog')
|
80
|
+
#
|
81
|
+
# @param [Integer, String] project The ID or name of a project.
|
82
|
+
# @param [String] name The name of a label.
|
83
|
+
# @return [Gitlab::ObjectifiedHash] Information about the label unsubscribed from.
|
84
|
+
def unsubscribe_from_label(project, name)
|
85
|
+
post("/projects/#{url_encode project}/labels/#{url_encode name}/unsubscribe")
|
86
|
+
end
|
85
87
|
end
|
86
88
|
end
|