gitlab 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +6 -0
- data/.travis.yml +1 -1
- data/Dockerfile +8 -0
- data/README.md +64 -0
- data/docker-compose.yml +19 -0
- data/docker.env +2 -0
- data/gitlab.gemspec +4 -4
- data/lib/gitlab/client.rb +4 -0
- data/lib/gitlab/client/access_requests.rb +94 -0
- data/lib/gitlab/client/branches.rb +3 -3
- data/lib/gitlab/client/commits.rb +18 -0
- data/lib/gitlab/client/events.rb +58 -0
- data/lib/gitlab/client/group_milestones.rb +93 -0
- data/lib/gitlab/client/groups.rb +11 -11
- data/lib/gitlab/client/labels.rb +2 -2
- data/lib/gitlab/client/merge_requests.rb +129 -1
- data/lib/gitlab/client/notes.rb +21 -4
- data/lib/gitlab/client/projects.rb +37 -15
- data/lib/gitlab/client/runners.rb +11 -0
- data/lib/gitlab/client/sidekiq.rb +37 -0
- data/lib/gitlab/client/snippets.rb +3 -1
- data/lib/gitlab/client/tags.rb +5 -5
- data/lib/gitlab/version.rb +1 -1
- data/spec/fixtures/access_request.json +8 -0
- data/spec/fixtures/access_requests.json +18 -0
- data/spec/fixtures/approved_access_request.json +8 -0
- data/spec/fixtures/default_approved_access_request.json +8 -0
- data/spec/fixtures/group_milestone.json +1 -0
- data/spec/fixtures/group_milestone_issues.json +1 -0
- data/spec/fixtures/group_milestone_merge_requests.json +1 -0
- data/spec/fixtures/group_milestones.json +1 -0
- data/spec/fixtures/merge_request_discussion.json +39 -0
- data/spec/fixtures/merge_request_discussion_note.json +33 -0
- data/spec/fixtures/merge_request_discussions.json +41 -0
- data/spec/fixtures/project_commit_merge_requests.json +1 -0
- data/spec/fixtures/project_events.json +81 -1
- data/spec/fixtures/project_forks.json +50 -0
- data/spec/fixtures/runner_jobs.json +63 -0
- data/spec/fixtures/sidekiq_compound_metrics.json +36 -0
- data/spec/fixtures/sidekiq_job_stats.json +7 -0
- data/spec/fixtures/sidekiq_process_metrics.json +25 -0
- data/spec/fixtures/sidekiq_queue_metrics.json +8 -0
- data/spec/fixtures/user_contribution_events.json +101 -0
- data/spec/fixtures/user_events.json +40 -0
- data/spec/fixtures/user_projects.json +153 -0
- data/spec/gitlab/client/access_requests_spec.rb +141 -0
- data/spec/gitlab/client/branches_spec.rb +4 -2
- data/spec/gitlab/client/commits_spec.rb +22 -0
- data/spec/gitlab/client/events_spec.rb +48 -0
- data/spec/gitlab/client/group_milestones_spec.rb +98 -0
- data/spec/gitlab/client/merge_requests_spec.rb +127 -0
- data/spec/gitlab/client/notes_spec.rb +4 -4
- data/spec/gitlab/client/projects_spec.rb +37 -20
- data/spec/gitlab/client/runners_spec.rb +10 -0
- data/spec/gitlab/client/sidekiq_spec.rb +64 -0
- data/spec/gitlab/client/snippets_spec.rb +2 -2
- data/spec/gitlab/client/tags_spec.rb +44 -0
- data/spec/gitlab/shell_spec.rb +1 -1
- metadata +67 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30a94ccf69dc023d9f587a3435ef3bfef5f26a7899016d259533aa6172238753
|
4
|
+
data.tar.gz: 2fd9974e617d7d1112739a299171f3a366c6d73a1fa77ed3b5c4aa62bcf80a72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3652cd0cda7d3d598b157dedb520f95fe5a49f04d9b1fdf0def379aadf4823e314c174ab25728185e57d4ea10e847327176dadc943c908837bddce411aa118f
|
7
|
+
data.tar.gz: 2744fa91f5066133130316451c01a7f0e9c03f2209fd4fa861f7cd005a8533c6aff6fe13b433c2adf7a310f1c911e2aa87d1f52395272286198025223fa2dd71
|
data/.dockerignore
ADDED
data/.travis.yml
CHANGED
data/Dockerfile
ADDED
data/README.md
CHANGED
@@ -28,6 +28,12 @@ gem 'gitlab'
|
|
28
28
|
# gem 'gitlab', github: 'NARKOZ/gitlab'
|
29
29
|
```
|
30
30
|
|
31
|
+
Mac OS users can install using Homebrew:
|
32
|
+
|
33
|
+
```sh
|
34
|
+
brew install gitlab-gem
|
35
|
+
```
|
36
|
+
|
31
37
|
## Usage
|
32
38
|
|
33
39
|
Configuration example:
|
@@ -175,6 +181,64 @@ For more information, refer to [website](http://narkoz.github.io/gitlab).
|
|
175
181
|
|
176
182
|
## Development
|
177
183
|
|
184
|
+
### With a dockerized Gitlab instance
|
185
|
+
|
186
|
+
```shell
|
187
|
+
docker-compose up -d gitlab # Will start the gitlab instance in the background (approx. 3 minutes)
|
188
|
+
```
|
189
|
+
|
190
|
+
After a while, your Gitlab instance will be accessible on http://localhost:3000.
|
191
|
+
|
192
|
+
Once you have set your new root password, you can login with the root user.
|
193
|
+
|
194
|
+
You can now setup a personal access token here: http://localhost:3000/profile/personal_access_tokens
|
195
|
+
|
196
|
+
Once you have your token, set the variables to the correct values in the `docker.env` file.
|
197
|
+
|
198
|
+
Then, launch the tool:
|
199
|
+
|
200
|
+
```shell
|
201
|
+
docker-compose run app
|
202
|
+
```
|
203
|
+
|
204
|
+
```ruby
|
205
|
+
Gitlab.users
|
206
|
+
=> [#<Gitlab::ObjectifiedHash:47231290771040 {hash: {"id"=>1, "name"=>"Administrator", "username"=>"root", ...]
|
207
|
+
```
|
208
|
+
|
209
|
+
To launch the specs,
|
210
|
+
|
211
|
+
```shell
|
212
|
+
docker-compose run app rake spec
|
213
|
+
```
|
214
|
+
|
215
|
+
#### Want to use Gitlab Enterprise?
|
216
|
+
|
217
|
+
Just change the image from `gitlab/gitlab-ce:latest` to `gitlab/gitlab-ee:latest` in the `docker-compose.yml` file.
|
218
|
+
|
219
|
+
### With an external Gitlab instance
|
220
|
+
|
221
|
+
First, set the variables to the correct values in the `docker.env` file.
|
222
|
+
|
223
|
+
Then, launch the tool:
|
224
|
+
|
225
|
+
```shell
|
226
|
+
docker-compose run app
|
227
|
+
```
|
228
|
+
|
229
|
+
```ruby
|
230
|
+
Gitlab.users
|
231
|
+
=> [#<Gitlab::ObjectifiedHash:47231290771040 {hash: {"id"=>1, "name"=>"Administrator", "username"=>"root", ...]
|
232
|
+
```
|
233
|
+
|
234
|
+
To launch the specs,
|
235
|
+
|
236
|
+
```shell
|
237
|
+
docker-compose run app rake spec
|
238
|
+
```
|
239
|
+
|
240
|
+
### Without Docker
|
241
|
+
|
178
242
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
179
243
|
`rake spec` to run the tests. You can also run `bin/console` for an interactive
|
180
244
|
prompt that will allow you to experiment.
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# For more information, see https://docs.gitlab.com/omnibus/docker/README.html#install-gitlab-using-docker-compose
|
2
|
+
version: '3'
|
3
|
+
services:
|
4
|
+
app:
|
5
|
+
build: .
|
6
|
+
volumes:
|
7
|
+
- ./:/app
|
8
|
+
env_file: docker.env
|
9
|
+
|
10
|
+
gitlab:
|
11
|
+
image: 'gitlab/gitlab-ce:latest'
|
12
|
+
restart: always
|
13
|
+
hostname: 'gitlab.example.com'
|
14
|
+
environment:
|
15
|
+
GITLAB_OMNIBUS_CONFIG: |
|
16
|
+
external_url 'http://gitlab.example.com:3000'
|
17
|
+
# Add any other gitlab.rb configuration here, each on its own line
|
18
|
+
ports:
|
19
|
+
- 3000:3000
|
data/docker.env
ADDED
data/gitlab.gemspec
CHANGED
@@ -5,8 +5,8 @@ require 'gitlab/version'
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = 'gitlab'
|
7
7
|
gem.version = Gitlab::VERSION
|
8
|
-
gem.authors = ['Nihad Abbasov']
|
9
|
-
gem.email = ['mail@narkoz.me']
|
8
|
+
gem.authors = ['Nihad Abbasov', 'Sean Edge']
|
9
|
+
gem.email = ['mail@narkoz.me', 'asedge@gmail.com']
|
10
10
|
gem.description = 'Ruby client and CLI for GitLab API'
|
11
11
|
gem.summary = 'A Ruby wrapper and CLI for the GitLab API'
|
12
12
|
gem.homepage = 'https://github.com/narkoz/gitlab'
|
@@ -20,8 +20,8 @@ Gem::Specification.new do |gem|
|
|
20
20
|
|
21
21
|
gem.required_ruby_version = '>= 2.0.0'
|
22
22
|
|
23
|
-
gem.add_runtime_dependency 'httparty'
|
24
|
-
gem.add_runtime_dependency 'terminal-table'
|
23
|
+
gem.add_runtime_dependency 'httparty', '>= 0.14.0'
|
24
|
+
gem.add_runtime_dependency 'terminal-table', '>= 1.5.1'
|
25
25
|
|
26
26
|
gem.add_development_dependency 'pry'
|
27
27
|
gem.add_development_dependency 'rake'
|
data/lib/gitlab/client.rb
CHANGED
@@ -4,6 +4,7 @@ module Gitlab
|
|
4
4
|
Dir[File.expand_path('../client/*.rb', __FILE__)].each { |f| require f }
|
5
5
|
|
6
6
|
# Please keep in alphabetical order
|
7
|
+
include AccessRequests
|
7
8
|
include AwardEmojis
|
8
9
|
include Boards
|
9
10
|
include Branches
|
@@ -12,6 +13,8 @@ module Gitlab
|
|
12
13
|
include Commits
|
13
14
|
include Deployments
|
14
15
|
include Environments
|
16
|
+
include Events
|
17
|
+
include GroupMilestones
|
15
18
|
include Groups
|
16
19
|
include Issues
|
17
20
|
include Jobs
|
@@ -29,6 +32,7 @@ module Gitlab
|
|
29
32
|
include RepositoryFiles
|
30
33
|
include Runners
|
31
34
|
include Services
|
35
|
+
include Sidekiq
|
32
36
|
include Snippets
|
33
37
|
include SystemHooks
|
34
38
|
include Tags
|
@@ -0,0 +1,94 @@
|
|
1
|
+
class Gitlab::Client
|
2
|
+
# Defines methods related to Award Emojis.
|
3
|
+
# @see https://docs.gitlab.com/ce/api/access_requests.html
|
4
|
+
module AccessRequests
|
5
|
+
# Gets a list of access requests for a project viewable by the authenticated user.
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# Gitlab.project_access_requests(1)
|
9
|
+
#
|
10
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
11
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of project access requests
|
12
|
+
def project_access_requests(project)
|
13
|
+
get("/projects/#{url_encode project}/access_requests")
|
14
|
+
end
|
15
|
+
# Gets a list of access requests for a group viewable by the authenticated user.
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# Gitlab.group_access_requests(1)
|
19
|
+
#
|
20
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
21
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of group access requests
|
22
|
+
def group_access_requests(group)
|
23
|
+
get("/groups/#{url_encode group}/access_requests")
|
24
|
+
end
|
25
|
+
# Requests access for the authenticated user to a project.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# Gitlab.request_project_access(1)
|
29
|
+
#
|
30
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
31
|
+
# @return <Gitlab::ObjectifiedHash] Information about the requested project access
|
32
|
+
def request_project_access(project)
|
33
|
+
post("/projects/#{url_encode project}/access_requests")
|
34
|
+
end
|
35
|
+
# Requests access for the authenticated user to a group.
|
36
|
+
#
|
37
|
+
# @example
|
38
|
+
# Gitlab.request_group_access(1)
|
39
|
+
#
|
40
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
41
|
+
# @return <Gitlab::ObjectifiedHash] Information about the requested group access
|
42
|
+
def request_group_access(group)
|
43
|
+
post("/groups/#{url_encode group}/access_requests")
|
44
|
+
end
|
45
|
+
# Approves a project access request for the given user.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# Gitlab.approve_project_access_request(1, 1)
|
49
|
+
# Gitlab.approve_project_access_request(1, 1, {access_level: '30'})
|
50
|
+
#
|
51
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
52
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
53
|
+
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
54
|
+
# @return <Gitlab::ObjectifiedHash] Information about the approved project access request
|
55
|
+
def approve_project_access_request(project, user_id, options = {})
|
56
|
+
put("/projects/#{url_encode project}/access_requests/#{user_id}/approve", body: options)
|
57
|
+
end
|
58
|
+
# Approves a group access request for the given user.
|
59
|
+
#
|
60
|
+
# @example
|
61
|
+
# Gitlab.approve_group_access_request(1, 1)
|
62
|
+
# Gitlab.approve_group_access_request(1, 1, {access_level: '30'})
|
63
|
+
#
|
64
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
65
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
66
|
+
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
67
|
+
# @return <Gitlab::ObjectifiedHash] Information about the approved group access request
|
68
|
+
def approve_group_access_request(group, user_id, options = {})
|
69
|
+
put("/groups/#{url_encode group}/access_requests/#{user_id}/approve", body: options)
|
70
|
+
end
|
71
|
+
# Denies a project access request for the given user.
|
72
|
+
#
|
73
|
+
# @example
|
74
|
+
# Gitlab.deny_project_access_request(1, 1)
|
75
|
+
#
|
76
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
77
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
78
|
+
# @return [void] This API call returns an empty response body.
|
79
|
+
def deny_project_access_request(project, user_id)
|
80
|
+
delete("/projects/#{url_encode project}/access_requests/#{user_id}")
|
81
|
+
end
|
82
|
+
# Denies a group access request for the given user.
|
83
|
+
#
|
84
|
+
# @example
|
85
|
+
# Gitlab.deny_group_access_request(1, 1)
|
86
|
+
#
|
87
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
88
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
89
|
+
# @return [void] This API call returns an empty response body.
|
90
|
+
def deny_group_access_request(group, user_id)
|
91
|
+
delete("/groups/#{url_encode group}/access_requests/#{user_id}")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -68,15 +68,15 @@ class Gitlab::Client
|
|
68
68
|
# Creates a repository branch. Requires Gitlab >= 6.8.x
|
69
69
|
#
|
70
70
|
# @example
|
71
|
-
# Gitlab.create_branch(3, 'api')
|
72
|
-
# Gitlab.repo_create_branch(5, 'master')
|
71
|
+
# Gitlab.create_branch(3, 'api', 'feat/new-api')
|
72
|
+
# Gitlab.repo_create_branch(5, 'master', 'develop')
|
73
73
|
#
|
74
74
|
# @param [Integer, String] project The ID or name of a project.
|
75
75
|
# @param [String] branch The name of the new branch.
|
76
76
|
# @param [String] ref Create branch from commit sha or existing branch
|
77
77
|
# @return [Gitlab::ObjectifiedHash] Details about the branch
|
78
78
|
def create_branch(project, branch, ref)
|
79
|
-
post("/projects/#{url_encode project}/repository/branches",
|
79
|
+
post("/projects/#{url_encode project}/repository/branches", query: { branch: branch, ref: ref })
|
80
80
|
end
|
81
81
|
alias_method :repo_create_branch, :create_branch
|
82
82
|
|
@@ -142,5 +142,23 @@ class Gitlab::Client
|
|
142
142
|
}.merge(options)
|
143
143
|
post("/projects/#{url_encode project}/repository/commits", body: payload)
|
144
144
|
end
|
145
|
+
|
146
|
+
# Gets a list of merge requests for a commit.
|
147
|
+
#
|
148
|
+
# @see https://docs.gitlab.com/ce/api/commits.html#list-merge-requests-associated-with-a-commit
|
149
|
+
# Introduced in Gitlab 10.7
|
150
|
+
#
|
151
|
+
# @example
|
152
|
+
# Gitlab.commit_merge_requests(5, 'c9f9662a9b1116c838b523ed64c6abdb4aae4b8b')
|
153
|
+
#
|
154
|
+
# @param [Integer] project The ID of a project.
|
155
|
+
# @param [String] sha The commit hash.
|
156
|
+
# @option options [Integer] :page The page number.
|
157
|
+
# @option options [Integer] :per_page The number of results per page.
|
158
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
159
|
+
def commit_merge_requests(project, commit, options={})
|
160
|
+
get("/projects/#{url_encode project}/repository/commits/#{commit}/merge_requests", query: options)
|
161
|
+
end
|
162
|
+
alias_method :repo_commit_merge_requests, :commit_merge_requests
|
145
163
|
end
|
146
164
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class Gitlab::Client
|
2
|
+
# Defines methods related to events.
|
3
|
+
# @see https://docs.gitlab.com/ce/api/events.html
|
4
|
+
module Events
|
5
|
+
# Gets a list of authenticated user's events
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# Gitlab.events()
|
9
|
+
# Gitlab.events({ action: 'created', target_type: 'issue' })
|
10
|
+
#
|
11
|
+
# @param [Hash] options A customizable set of options.
|
12
|
+
# @option options [String] :action Only events of specific action type
|
13
|
+
# @option options [String] :target_type Only events of specific target type
|
14
|
+
# @option options [String] :before Only events created before YYYY-MM-DD
|
15
|
+
# @option options [String] :after Only events created after YYYY-MM-DD
|
16
|
+
# @option options [String] :sort Sort by created_at either 'asc' or 'desc'
|
17
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
18
|
+
def events(options={})
|
19
|
+
get('/events', query: options)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Gets a list of user contribution events
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.user_events(1)
|
26
|
+
# Gitlab.user_events(1, { action: created})
|
27
|
+
#
|
28
|
+
# @param [Integer, String] user The ID or username of user
|
29
|
+
# @param [Hash] options A customizable set of options.
|
30
|
+
# @option options [String] :action Only events of specific action type
|
31
|
+
# @option options [String] :target_type Only events of specific target type
|
32
|
+
# @option options [String] :before Only events created before YYYY-MM-DD
|
33
|
+
# @option options [String] :after Only events created after YYYY-MM-DD
|
34
|
+
# @option options [String] :sort Sort by created_at either 'asc' or 'desc'
|
35
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
36
|
+
def user_events(user, options={})
|
37
|
+
get("/users/#{url_encode user}/events", query: options)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Gets a list of visible project events
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
# Gitlab.project_events(1)
|
44
|
+
# Gitlab.project_events(1, { action: created })
|
45
|
+
#
|
46
|
+
# @param [Integer] project The ID of project
|
47
|
+
# @param [Hash] options A customizable set of options.
|
48
|
+
# @option options [String] :action Only events of specific action type
|
49
|
+
# @option options [String] :target_type Only events of specific target type
|
50
|
+
# @option options [String] :before Only events created before YYYY-MM-DD
|
51
|
+
# @option options [String] :after Only events created after YYYY-MM-DD
|
52
|
+
# @option options [String] :sort Sort by created_at either 'asc' or 'desc'
|
53
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
54
|
+
def project_events(project, options={})
|
55
|
+
get("/#{url_encode project}/events", query: options)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
class Gitlab::Client
|
2
|
+
# Defines methods related to group milestones.
|
3
|
+
# @see https://docs.gitlab.com/ee/api/group_milestones.html
|
4
|
+
module GroupMilestones
|
5
|
+
# Gets a list of a group's milestones.
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# Gitlab.group_milestones(5)
|
9
|
+
#
|
10
|
+
# @param [Integer, String] id The ID or name of a group.
|
11
|
+
# @param [Hash] options A customizable set of options.
|
12
|
+
# @option options [Integer] :page The page number.
|
13
|
+
# @option options [Integer] :per_page The number of results per page.
|
14
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
15
|
+
def group_milestones(id, options={})
|
16
|
+
get("/groups/#{url_encode id}/milestones", query: options)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Gets a single group milestone.
|
20
|
+
#
|
21
|
+
# @example
|
22
|
+
# Gitlab.group_milestone(5, 36)
|
23
|
+
#
|
24
|
+
# @param [Integer, String] id The ID or name of a group.
|
25
|
+
# @param [Integer] milestone_id The ID of a milestone.
|
26
|
+
# @return [Gitlab::ObjectifiedHash]
|
27
|
+
def group_milestone(id, milestone_id)
|
28
|
+
get("/groups/#{url_encode id}/milestones/#{milestone_id}")
|
29
|
+
end
|
30
|
+
|
31
|
+
# Creates a new group milestone.
|
32
|
+
#
|
33
|
+
# @example
|
34
|
+
# Gitlab.create_group_milestone(5, 'v1.0')
|
35
|
+
#
|
36
|
+
# @param [Integer, String] id The ID or name of a group.
|
37
|
+
# @param [String] title The title of a milestone.
|
38
|
+
# @param [Hash] options A customizable set of options.
|
39
|
+
# @option options [String] :description The description of a milestone.
|
40
|
+
# @option options [String] :due_date The due date of a milestone.
|
41
|
+
# @return [Gitlab::ObjectifiedHash] Information about created milestone.
|
42
|
+
def create_group_milestone(id, title, options={})
|
43
|
+
body = { title: title }.merge(options)
|
44
|
+
post("/groups/#{url_encode id}/milestones", body: body)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Updates a group milestone.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# Gitlab.edit_group_milestone(5, 2, { state_event: 'activate' })
|
51
|
+
#
|
52
|
+
# @param [Integer, String] id The ID or name of a group.
|
53
|
+
# @param [Integer] milestone_id The ID of a milestone.
|
54
|
+
# @param [Hash] options A customizable set of options.
|
55
|
+
# @option options [String] :title The title of a milestone.
|
56
|
+
# @option options [String] :description The description of a milestone.
|
57
|
+
# @option options [String] :due_date The due date of a milestone.
|
58
|
+
# @option options [String] :state_event The state of a milestone ('close' or 'activate').
|
59
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated milestone.
|
60
|
+
def edit_group_milestone(id, milestone_id, options={})
|
61
|
+
put("/groups/#{url_encode id}/milestones/#{milestone_id}", body: options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Gets the issues of a given group milestone.
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# Gitlab.group_milestone_issues(5, 2)
|
68
|
+
#
|
69
|
+
# @param [Integer, String] id The ID or name of a group.
|
70
|
+
# @param [Integer, String] milestone_id The ID of a milestone.
|
71
|
+
# @option options [Integer] :page The page number.
|
72
|
+
# @option options [Integer] :per_page The number of results per page.
|
73
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
74
|
+
def group_milestone_issues(id, milestone_id, options={})
|
75
|
+
get("/groups/#{url_encode id}/milestones/#{milestone_id}/issues", query: options)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Gets the merge_requests of a given group milestone.
|
79
|
+
#
|
80
|
+
# @example
|
81
|
+
# Gitlab.group_milestone_merge_requests(5, 2)
|
82
|
+
#
|
83
|
+
# @param [Integer, String] group The ID or name of a group.
|
84
|
+
# @param [Integer, String] milestone_id The ID of a milestone.
|
85
|
+
# @option options [Integer] :page The page number.
|
86
|
+
# @option options [Integer] :per_page The number of results per page.
|
87
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
88
|
+
def group_milestone_merge_requests(id, milestone_id, options={})
|
89
|
+
get("/groups/#{url_encode id}/milestones/#{milestone_id}/merge_requests", query: options)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|