Module: Gitlab::Client::MergeRequests
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/merge_requests.rb
Overview
Defines methods related to merge requests.
Instance Method Summary collapse
-
#accept_merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Accepts a merge request.
-
#create_merge_request(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a merge request.
-
#create_merge_request_discussion(project, merge_request_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Create new merge request discussion.
-
#create_merge_request_discussion_note(project, merge_request_id, discussion_id, options) ⇒ Gitlab::ObjectifiedHash
Add note to existing merge request discussion.
-
#create_merge_request_pipeline(project, iid) ⇒ Gitlab::ObjectifiedHash
Create a new pipeline for a merge request.
-
#delete_merge_request(project, merge_request_id) ⇒ Gitlab::ObjectifiedHash
Delete a merge request.
-
#delete_merge_request_discussion_note(project, merge_request_id, discussion_id, note_id) ⇒ Gitlab::ObjectifiedHash
Delete a merge request discussion note.
-
#merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Gets a single merge request.
-
#merge_request_changes(project, id) ⇒ Gitlab::ObjectifiedHash
Gets the changes of a merge request.
-
#merge_request_closes_issues(project_id, merge_request_iid) ⇒ Object
List issues that will close on merge.
-
#merge_request_commits(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets the commits of a merge request.
-
#merge_request_dependencies(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Shows information about the merge request dependencies that must be resolved before merging.
-
#merge_request_diff_version(project, merge_request_id, version_id) ⇒ Gitlab::ObjectifiedHash
Gets the diff a single merge request diff version.
-
#merge_request_diff_versions(project, merge_request_id) ⇒ Gitlab::ObjectifiedHash
Gets a list of merge request diff versions.
-
#merge_request_diffs(project, merge_request_id) ⇒ Gitlab::ObjectifiedHash
Gets a list of merge request diffs.
-
#merge_request_discussion(project, merge_request_id, discussion_id) ⇒ Gitlab::ObjectifiedHash
Get single merge request discussion.
-
#merge_request_discussions(project, merge_request_id, options = {}) ⇒ Gitlab::ObjectifiedHash
List project merge request discussions.
-
#merge_request_participants(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of merge request participants.
-
#merge_request_pipelines(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of merge request pipelines.
-
#merge_requests(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project merge requests.
-
#rebase_merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Rebase a merge request.
-
#resolve_merge_request_discussion(project, merge_request_id, discussion_id, options) ⇒ Gitlab::ObjectifiedHash
Resolve a merge request discussion.
-
#subscribe_to_merge_request(project, id) ⇒ Gitlab::ObjectifiedHash
Subscribes to a merge request.
-
#unsubscribe_from_merge_request(project, id) ⇒ Gitlab::ObjectifiedHash
Unsubscribes from a merge request.
-
#update_merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a merge request.
-
#update_merge_request_discussion_note(project, merge_request_id, discussion_id, note_id, options) ⇒ Gitlab::ObjectifiedHash
Modify an existing merge request discussion note.
-
#user_merge_requests(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of all of the merge requests the authenticated user has access to.
Instance Method Details
#accept_merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Accepts a merge request.
166 167 168 |
# File 'lib/gitlab/client/merge_requests.rb', line 166 def accept_merge_request(project, id, = {}) put("/projects/#{url_encode project}/merge_requests/#{id}/merge", body: ) end |
#create_merge_request(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a merge request.
128 129 130 131 |
# File 'lib/gitlab/client/merge_requests.rb', line 128 def create_merge_request(project, title, = {}) body = { title: title }.merge() post("/projects/#{url_encode project}/merge_requests", body: body) end |
#create_merge_request_discussion(project, merge_request_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Create new merge request discussion
282 283 284 |
# File 'lib/gitlab/client/merge_requests.rb', line 282 def create_merge_request_discussion(project, merge_request_id, = {}) post("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions", body: ) end |
#create_merge_request_discussion_note(project, merge_request_id, discussion_id, options) ⇒ Gitlab::ObjectifiedHash
Add note to existing merge request discussion
314 315 316 |
# File 'lib/gitlab/client/merge_requests.rb', line 314 def create_merge_request_discussion_note(project, merge_request_id, discussion_id, ) post("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions/#{discussion_id}/notes", body: ) end |
#create_merge_request_pipeline(project, iid) ⇒ Gitlab::ObjectifiedHash
Create a new pipeline for a merge request. A pipeline created via this endpoint doesnt run a regular branch/tag pipeline. It requires .gitlab-ci.yml to be configured with only: [merge_requests] to create jobs.
The new pipeline can be:
A detached merge request pipeline. A pipeline for merged results if the project setting is enabled.
89 90 91 |
# File 'lib/gitlab/client/merge_requests.rb', line 89 def create_merge_request_pipeline(project, iid) post("/projects/#{url_encode project}/merge_requests/#{iid}/pipelines") end |
#delete_merge_request(project, merge_request_id) ⇒ Gitlab::ObjectifiedHash
Delete a merge request
357 358 359 |
# File 'lib/gitlab/client/merge_requests.rb', line 357 def delete_merge_request(project, merge_request_id) delete("/projects/#{url_encode project}/merge_requests/#{merge_request_id}") end |
#delete_merge_request_discussion_note(project, merge_request_id, discussion_id, note_id) ⇒ Gitlab::ObjectifiedHash
Delete a merge request discussion note
345 346 347 |
# File 'lib/gitlab/client/merge_requests.rb', line 345 def delete_merge_request_discussion_note(project, merge_request_id, discussion_id, note_id) delete("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions/#{discussion_id}/notes/#{note_id}") end |
#merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Gets a single merge request.
46 47 48 |
# File 'lib/gitlab/client/merge_requests.rb', line 46 def merge_request(project, id, = {}) get("/projects/#{url_encode project}/merge_requests/#{id}", query: ) end |
#merge_request_changes(project, id) ⇒ Gitlab::ObjectifiedHash
Gets the changes of a merge request.
178 179 180 |
# File 'lib/gitlab/client/merge_requests.rb', line 178 def merge_request_changes(project, id) get("/projects/#{url_encode project}/merge_requests/#{id}/changes") end |
#merge_request_closes_issues(project_id, merge_request_iid) ⇒ Object
List issues that will close on merge
201 202 203 |
# File 'lib/gitlab/client/merge_requests.rb', line 201 def merge_request_closes_issues(project_id, merge_request_iid) get("/projects/#{url_encode project_id}/merge_requests/#{merge_request_iid}/closes_issues") end |
#merge_request_commits(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets the commits of a merge request.
190 191 192 |
# File 'lib/gitlab/client/merge_requests.rb', line 190 def merge_request_commits(project, id) get("/projects/#{url_encode project}/merge_requests/#{id}/commits") end |
#merge_request_dependencies(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Shows information about the merge request dependencies that must be resolved before merging.
70 71 72 |
# File 'lib/gitlab/client/merge_requests.rb', line 70 def merge_request_dependencies(project, id) get("/projects/#{url_encode project}/merge_requests/#{id}/blocks") end |
#merge_request_diff_version(project, merge_request_id, version_id) ⇒ Gitlab::ObjectifiedHash
Gets the diff a single merge request diff version\
394 395 396 |
# File 'lib/gitlab/client/merge_requests.rb', line 394 def merge_request_diff_version(project, merge_request_id, version_id) get("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/versions/#{version_id}") end |
#merge_request_diff_versions(project, merge_request_id) ⇒ Gitlab::ObjectifiedHash
Gets a list of merge request diff versions
381 382 383 |
# File 'lib/gitlab/client/merge_requests.rb', line 381 def merge_request_diff_versions(project, merge_request_id) get("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/versions") end |
#merge_request_diffs(project, merge_request_id) ⇒ Gitlab::ObjectifiedHash
Gets a list of merge request diffs
369 370 371 |
# File 'lib/gitlab/client/merge_requests.rb', line 369 def merge_request_diffs(project, merge_request_id) get("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/diffs") end |
#merge_request_discussion(project, merge_request_id, discussion_id) ⇒ Gitlab::ObjectifiedHash
Get single merge request discussion
254 255 256 |
# File 'lib/gitlab/client/merge_requests.rb', line 254 def merge_request_discussion(project, merge_request_id, discussion_id) get("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions/#{discussion_id}") end |
#merge_request_discussions(project, merge_request_id, options = {}) ⇒ Gitlab::ObjectifiedHash
List project merge request discussions
241 242 243 |
# File 'lib/gitlab/client/merge_requests.rb', line 241 def merge_request_discussions(project, merge_request_id, = {}) get("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions", query: ) end |
#merge_request_participants(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of merge request participants.
101 102 103 |
# File 'lib/gitlab/client/merge_requests.rb', line 101 def merge_request_participants(project, id) get("/projects/#{url_encode project}/merge_requests/#{id}/participants") end |
#merge_request_pipelines(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of merge request pipelines.
58 59 60 |
# File 'lib/gitlab/client/merge_requests.rb', line 58 def merge_request_pipelines(project, id) get("/projects/#{url_encode project}/merge_requests/#{id}/pipelines") end |
#merge_requests(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project merge requests.
30 31 32 |
# File 'lib/gitlab/client/merge_requests.rb', line 30 def merge_requests(project, = {}) get("/projects/#{url_encode project}/merge_requests", query: ) end |
#rebase_merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Rebase a merge request.
408 409 410 |
# File 'lib/gitlab/client/merge_requests.rb', line 408 def rebase_merge_request(project, id, = {}) put("/projects/#{url_encode project}/merge_requests/#{id}/rebase", body: ) end |
#resolve_merge_request_discussion(project, merge_request_id, discussion_id, options) ⇒ Gitlab::ObjectifiedHash
Resolve a merge request discussion
297 298 299 |
# File 'lib/gitlab/client/merge_requests.rb', line 297 def resolve_merge_request_discussion(project, merge_request_id, discussion_id, ) put("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions/#{discussion_id}", body: ) end |
#subscribe_to_merge_request(project, id) ⇒ Gitlab::ObjectifiedHash
Subscribes to a merge request.
214 215 216 |
# File 'lib/gitlab/client/merge_requests.rb', line 214 def subscribe_to_merge_request(project, id) post("/projects/#{url_encode project}/merge_requests/#{id}/subscribe") end |
#unsubscribe_from_merge_request(project, id) ⇒ Gitlab::ObjectifiedHash
Unsubscribes from a merge request.
227 228 229 |
# File 'lib/gitlab/client/merge_requests.rb', line 227 def unsubscribe_from_merge_request(project, id) post("/projects/#{url_encode project}/merge_requests/#{id}/unsubscribe") end |
#update_merge_request(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a merge request.
147 148 149 |
# File 'lib/gitlab/client/merge_requests.rb', line 147 def update_merge_request(project, id, = {}) put("/projects/#{url_encode project}/merge_requests/#{id}", body: ) end |
#update_merge_request_discussion_note(project, merge_request_id, discussion_id, note_id, options) ⇒ Gitlab::ObjectifiedHash
Modify an existing merge request discussion note
331 332 333 |
# File 'lib/gitlab/client/merge_requests.rb', line 331 def update_merge_request_discussion_note(project, merge_request_id, discussion_id, note_id, ) put("/projects/#{url_encode project}/merge_requests/#{merge_request_id}/discussions/#{discussion_id}/notes/#{note_id}", body: ) end |
#user_merge_requests(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of all of the merge requests the authenticated user has access to.
15 16 17 |
# File 'lib/gitlab/client/merge_requests.rb', line 15 def user_merge_requests( = {}) get('/merge_requests', query: ) end |