gitlab 4.6.1 → 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/commits.rb +13 -0
- data/lib/gitlab/client/issues.rb +22 -0
- data/lib/gitlab/client/merge_requests.rb +12 -0
- data/lib/gitlab/client/pipelines.rb +13 -2
- data/lib/gitlab/client/projects.rb +12 -0
- data/lib/gitlab/error.rb +1 -1
- data/lib/gitlab/page_links.rb +1 -1
- data/lib/gitlab/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 421115b0e89dbdc41a5b604763a4d2f8c159117ea7a750112cd4ae4384716f46
|
4
|
+
data.tar.gz: f29e4c90ebf303275d2cdb40814019d537b7cd79d9ca620b234eab78f990c7ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa2447b6dff0b4335d542f199b3dac0b5171850417b01f8f0d2238eca7015707548308ccfa235b60443b2bf4fa436bb4981f6d21a36126d37c4432359c7a2b5
|
7
|
+
data.tar.gz: 15acf72e2442ea9aca44941545db106560ac07090c32012cc70a734dea36abb74ca57b1852350a29b825cf8080725a6989948e4faa92b09eaf75a209a7f6ddc2
|
@@ -35,6 +35,19 @@ class Gitlab::Client
|
|
35
35
|
end
|
36
36
|
alias repo_commit commit
|
37
37
|
|
38
|
+
# Cherry picks a commit to a given branch.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# Gitlab.cherry_pick_commit(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', 'master')
|
42
|
+
#
|
43
|
+
# @param [Integer, String] project The ID or name of a project.
|
44
|
+
# @param [String] sha The commit hash or name of a repository branch or tag
|
45
|
+
# @param [String] branch The name of the branch
|
46
|
+
# @return [Gitlab::ObjectifiedHash]
|
47
|
+
def cherry_pick_commit(project, sha, branch)
|
48
|
+
post("/projects/#{url_encode project}/repository/commits/#{sha}/cherry_pick", body: { branch: branch })
|
49
|
+
end
|
50
|
+
|
38
51
|
# Get the diff of a commit in a project.
|
39
52
|
#
|
40
53
|
# @example
|
data/lib/gitlab/client/issues.rb
CHANGED
@@ -205,5 +205,27 @@ class Gitlab::Client
|
|
205
205
|
def time_stats_for_issue(project, id)
|
206
206
|
get("/projects/#{url_encode project}/issues/#{id}/time_stats")
|
207
207
|
end
|
208
|
+
|
209
|
+
# Get participants on issue
|
210
|
+
#
|
211
|
+
# @example
|
212
|
+
# @gitlab.participants_on_issue(3, 42)
|
213
|
+
#
|
214
|
+
# @param [Integer, String] project The ID or name of a project.
|
215
|
+
# @param [Integer] id The ID of an issue.
|
216
|
+
def participants_on_issue(project, id)
|
217
|
+
get("/projects/#{url_encode project}/issues/#{id}/participants")
|
218
|
+
end
|
219
|
+
|
220
|
+
# List merge requests that will close issue on merge
|
221
|
+
#
|
222
|
+
# @example
|
223
|
+
# Gitlab.merge_requests_closing_issue_on_merge(3, 42)
|
224
|
+
#
|
225
|
+
# @param [Integer, String] project The ID or name of a project.
|
226
|
+
# @param [Integer] id The ID of an issue.
|
227
|
+
def merge_requests_closing_issue_on_merge(project, id)
|
228
|
+
get("/projects/#{url_encode project}/issues/#{id}/closed_by")
|
229
|
+
end
|
208
230
|
end
|
209
231
|
end
|
@@ -43,6 +43,18 @@ class Gitlab::Client
|
|
43
43
|
get("/projects/#{url_encode project}/merge_requests/#{id}")
|
44
44
|
end
|
45
45
|
|
46
|
+
# Gets a list of merge request pipelines.
|
47
|
+
#
|
48
|
+
# @example
|
49
|
+
# Gitlab.merge_request_pipelines(5, 36)
|
50
|
+
#
|
51
|
+
# @param [Integer, String] project The ID or name of a project.
|
52
|
+
# @param [Integer] id The ID of a merge request.
|
53
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
54
|
+
def merge_request_pipelines(project, id)
|
55
|
+
get("/projects/#{url_encode project}/merge_requests/#{id}/pipelines")
|
56
|
+
end
|
57
|
+
|
46
58
|
# Creates a merge request.
|
47
59
|
#
|
48
60
|
# @example
|
@@ -38,9 +38,20 @@ class Gitlab::Client
|
|
38
38
|
#
|
39
39
|
# @param [Integer, String] project The ID or name of a project.
|
40
40
|
# @param [String] ref Reference to commit.
|
41
|
+
# @param [Hash] variables Variables passed to pipelines
|
41
42
|
# @return [Gitlab::ObjectifiedHash] The pipelines changes.
|
42
|
-
def create_pipeline(project, ref)
|
43
|
-
|
43
|
+
def create_pipeline(project, ref, variables = {})
|
44
|
+
body = {}
|
45
|
+
|
46
|
+
# This mapping is necessary, cause the API expects an array with objects (with `key` and `value` keys)
|
47
|
+
# See: https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline
|
48
|
+
body[:variables] = variables.map { |(key, value)| { key: key, value: value } } if variables.any?
|
49
|
+
|
50
|
+
post(
|
51
|
+
"/projects/#{url_encode project}/pipeline",
|
52
|
+
query: { ref: ref },
|
53
|
+
body: body
|
54
|
+
)
|
44
55
|
end
|
45
56
|
|
46
57
|
# Cancels a pipeline.
|
@@ -467,6 +467,18 @@ class Gitlab::Client
|
|
467
467
|
delete("/projects/#{url_encode project}/share/#{id}")
|
468
468
|
end
|
469
469
|
|
470
|
+
# Transfer a project to a new namespace.
|
471
|
+
#
|
472
|
+
# @example
|
473
|
+
# Gitlab.transfer_project(42, 'yolo')
|
474
|
+
#
|
475
|
+
# @param [Integer, String] project The ID or path of a project
|
476
|
+
# @param [Integer, String] namespace The ID or path of the namespace to transfer to project to
|
477
|
+
# @return [Gitlab::ObjectifiedHash] Information about transfered project.
|
478
|
+
def transfer_project(project, namespace)
|
479
|
+
put("/projects/#{url_encode project}/transfer", body: { namespace: namespace })
|
480
|
+
end
|
481
|
+
|
470
482
|
# Stars a project.
|
471
483
|
# @see https://docs.gitlab.com/ce/api/projects.html#star-a-project
|
472
484
|
#
|
data/lib/gitlab/error.rb
CHANGED
@@ -59,7 +59,7 @@ module Gitlab
|
|
59
59
|
case message
|
60
60
|
when Gitlab::ObjectifiedHash
|
61
61
|
message.to_h.sort.map do |key, val|
|
62
|
-
"'#{key}' #{(val.is_a?(Hash) ? val.sort.map { |k, v| "(#{k}: #{v.join(' ')})" } : val).join(' ')}"
|
62
|
+
"'#{key}' #{(val.is_a?(Hash) ? val.sort.map { |k, v| "(#{k}: #{v.join(' ')})" } : [val].flatten).join(' ')}"
|
63
63
|
end.join(', ')
|
64
64
|
when Array
|
65
65
|
message.join(' ')
|
data/lib/gitlab/page_links.rb
CHANGED
data/lib/gitlab/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nihad Abbasov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.7.
|
206
|
+
rubygems_version: 2.7.8
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: A Ruby wrapper and CLI for the GitLab API
|