labclient 0.1.0 → 0.1.5

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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/lib/labclient.rb +65 -42
  3. data/lib/labclient/branches/branch.rb +25 -0
  4. data/lib/labclient/branches/create.rb +33 -0
  5. data/lib/labclient/client.rb +45 -5
  6. data/lib/labclient/common.rb +5 -0
  7. data/lib/labclient/docs.rb +5 -1
  8. data/lib/labclient/epics/epic.rb +13 -0
  9. data/lib/labclient/error.rb +1 -0
  10. data/lib/labclient/files/create.rb +14 -8
  11. data/lib/labclient/generator/generator.rb +70 -0
  12. data/lib/labclient/generator/names.rb +68 -0
  13. data/lib/labclient/generator/template_helper.rb +82 -0
  14. data/lib/labclient/generator/templates/environments.rb +98 -0
  15. data/lib/labclient/generator/templates/pages.rb +67 -0
  16. data/lib/labclient/generator/templates/pipeline_trigger.rb +82 -0
  17. data/lib/labclient/generator/wizard.rb +142 -0
  18. data/lib/labclient/groups/group.rb +17 -0
  19. data/lib/labclient/groups/stub.rb +8 -0
  20. data/lib/labclient/http.rb +8 -3
  21. data/lib/labclient/issues/agent_detail.rb +1 -1
  22. data/lib/labclient/issues/closed_by.rb +1 -1
  23. data/lib/labclient/issues/create.rb +17 -5
  24. data/lib/labclient/issues/delete.rb +1 -1
  25. data/lib/labclient/issues/issue.rb +21 -1
  26. data/lib/labclient/issues/move.rb +1 -1
  27. data/lib/labclient/issues/participants.rb +1 -1
  28. data/lib/labclient/issues/related_merge_requests.rb +1 -1
  29. data/lib/labclient/issues/show.rb +1 -1
  30. data/lib/labclient/issues/subscribe.rb +1 -1
  31. data/lib/labclient/issues/time_stats.rb +5 -5
  32. data/lib/labclient/issues/todo.rb +1 -1
  33. data/lib/labclient/issues/unsubscribe.rb +1 -1
  34. data/lib/labclient/issues/update.rb +1 -1
  35. data/lib/labclient/klass.rb +35 -3
  36. data/lib/labclient/lab_struct.rb +17 -0
  37. data/lib/labclient/license/list.rb +2 -2
  38. data/lib/labclient/members/member.rb +1 -0
  39. data/lib/labclient/merge_requests/accept.rb +16 -7
  40. data/lib/labclient/merge_requests/cancel_auto_merge.rb +1 -1
  41. data/lib/labclient/merge_requests/changes.rb +1 -1
  42. data/lib/labclient/merge_requests/closes_issues.rb +1 -1
  43. data/lib/labclient/merge_requests/commits.rb +1 -1
  44. data/lib/labclient/merge_requests/create.rb +12 -0
  45. data/lib/labclient/merge_requests/delete.rb +1 -1
  46. data/lib/labclient/merge_requests/diff_versions.rb +1 -1
  47. data/lib/labclient/merge_requests/merge_request.rb +49 -4
  48. data/lib/labclient/merge_requests/participants.rb +1 -1
  49. data/lib/labclient/merge_requests/pipelines.rb +2 -2
  50. data/lib/labclient/merge_requests/rebase.rb +1 -1
  51. data/lib/labclient/merge_requests/show.rb +1 -1
  52. data/lib/labclient/merge_requests/subscribe.rb +1 -1
  53. data/lib/labclient/merge_requests/time_stats.rb +5 -5
  54. data/lib/labclient/merge_requests/todo.rb +1 -1
  55. data/lib/labclient/merge_requests/unsubscribe.rb +1 -1
  56. data/lib/labclient/merge_requests/update.rb +1 -1
  57. data/lib/labclient/notes/epics/create.rb +12 -4
  58. data/lib/labclient/notes/epics/delete.rb +3 -3
  59. data/lib/labclient/notes/epics/list.rb +21 -4
  60. data/lib/labclient/notes/epics/show.rb +4 -4
  61. data/lib/labclient/notes/epics/update.rb +4 -4
  62. data/lib/labclient/notes/issues/create.rb +11 -1
  63. data/lib/labclient/notes/issues/list.rb +18 -3
  64. data/lib/labclient/notes/issues/show.rb +1 -1
  65. data/lib/labclient/notes/merge_requests/create.rb +8 -0
  66. data/lib/labclient/notes/merge_requests/list.rb +20 -2
  67. data/lib/labclient/notes/snippets/create.rb +1 -1
  68. data/lib/labclient/notes/snippets/list.rb +20 -3
  69. data/lib/labclient/notes/snippets/show.rb +1 -1
  70. data/lib/labclient/notifications/update.rb +1 -1
  71. data/lib/labclient/overview.rb +117 -16
  72. data/lib/labclient/paginated_response.rb +6 -1
  73. data/lib/labclient/pipelines/pipeline.rb +41 -0
  74. data/lib/labclient/projects/access_requests/access_request.rb +0 -1
  75. data/lib/labclient/projects/badges/project_badge.rb +0 -1
  76. data/lib/labclient/projects/clusters/project_cluster.rb +0 -1
  77. data/lib/labclient/projects/create.rb +13 -0
  78. data/lib/labclient/projects/deployments/project_deployment.rb +1 -3
  79. data/lib/labclient/projects/environments/project_environment.rb +0 -1
  80. data/lib/labclient/projects/forks/existing.rb +0 -2
  81. data/lib/labclient/projects/forks/fork.rb +1 -1
  82. data/lib/labclient/projects/forks/list.rb +0 -1
  83. data/lib/labclient/projects/forks/remove.rb +0 -1
  84. data/lib/labclient/projects/hooks/project_hook.rb +0 -1
  85. data/lib/labclient/projects/labels/project_label.rb +0 -1
  86. data/lib/labclient/projects/methods.rb +76 -2
  87. data/lib/labclient/projects/mirrors/project_mirror.rb +0 -1
  88. data/lib/labclient/projects/reference.rb +17 -0
  89. data/lib/labclient/projects/release_links/project_release_link.rb +0 -1
  90. data/lib/labclient/projects/releases/project_release.rb +0 -1
  91. data/lib/labclient/projects/services/project_service.rb +0 -1
  92. data/lib/labclient/projects/snippets/project_snippet.rb +12 -0
  93. data/lib/labclient/projects/stars/star.rb +0 -2
  94. data/lib/labclient/projects/stars/starred_projects.rb +0 -2
  95. data/lib/labclient/projects/stars/starrers.rb +1 -1
  96. data/lib/labclient/projects/triggers/project_trigger.rb +0 -1
  97. data/lib/labclient/projects/variables/project_variable.rb +0 -1
  98. data/lib/labclient/protected_branches/protect.rb +6 -5
  99. data/lib/labclient/protected_environments/list.rb +29 -0
  100. data/lib/labclient/protected_environments/protect.rb +53 -0
  101. data/lib/labclient/protected_environments/protected_environment.rb +22 -0
  102. data/lib/labclient/protected_environments/show.rb +24 -0
  103. data/lib/labclient/protected_environments/unprotect.rb +31 -0
  104. data/lib/labclient/snippets/snippet.rb +2 -2
  105. data/lib/labclient/users/membership.rb +62 -0
  106. data/lib/labclient/users/memberships.rb +8 -3
  107. data/lib/labclient/users/user.rb +13 -1
  108. data/lib/labclient/version.rb +1 -1
  109. metadata +38 -9
  110. data/lib/labclient/open_struct.rb +0 -14
@@ -4,7 +4,7 @@ module LabClient
4
4
  class Issues < Common
5
5
  doc 'Update' do
6
6
  title 'Todo'
7
- desc 'Manually creates a todo for the current user on an issue. [project id, merge request iid]'
7
+ desc 'Manually creates a todo for the current user on an issue. [Project ID, merge request iid]'
8
8
 
9
9
  example 'client.issues.todo(30, 1)'
10
10
 
@@ -4,7 +4,7 @@ module LabClient
4
4
  class Issues < Common
5
5
  doc 'Update' do
6
6
  title 'Unsubscribe'
7
- desc 'Unsubscribes the authenticated user from the issue to not receive notifications from it. [project id, issue iid]'
7
+ desc 'Unsubscribes the authenticated user from the issue to not receive notifications from it. [Project ID, Issue IID]'
8
8
 
9
9
  example 'client.issues.unsubscribe(343, 7)'
10
10
 
@@ -3,7 +3,7 @@ module LabClient
3
3
  # Specifics
4
4
  class Issues < Common
5
5
  doc 'Update' do
6
- desc 'Updates an existing project issue. This call is also used to mark an issue as closed. [project id, issue iid]'
6
+ desc 'Updates an existing project issue. This call is also used to mark an issue as closed. [Project ID, Issue IID]'
7
7
  example 'client.issues.update(5, 1, title: "Moar Fancy!")'
8
8
  result <<~DOC
9
9
  => #<Issue id: 1, title: Moar Fancy!, state: opened>
@@ -1,19 +1,21 @@
1
1
  # Top Namesapce
2
2
  module LabClient
3
3
  # Common Configuration for all Class Helpers
4
- class Klass < OpenStruct
4
+ class Klass < LabStruct
5
5
  include CurlHelper
6
6
 
7
7
  attr_reader :client, :response
8
+
8
9
  extend Docs
9
10
 
10
11
  def verbose
11
- ap self
12
+ ap self, ruby19_syntax: true
12
13
  end
13
14
 
14
15
  # API Methods here have to be explicitly documented / custom helpers
15
16
  # Assume no methods by default
16
- def help
17
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
18
+ def help(help_filter = nil)
17
19
  docs = LabClient::Docs.docs.dig(group_name, 'Reference')
18
20
  unless docs
19
21
  puts 'No Available Help'
@@ -25,6 +27,10 @@ module LabClient
25
27
  next unless doc[:options]
26
28
 
27
29
  doc[:options].each do |opt|
30
+ if help_filter
31
+ next unless (opt[:name] + opt[:text]).include? help_filter.to_s
32
+ end
33
+
28
34
  puts ' ' + opt[:name]
29
35
  puts " #{opt[:text]}\n"
30
36
  end
@@ -33,6 +39,27 @@ module LabClient
33
39
  # Ignore Output
34
40
  nil
35
41
  end
42
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
43
+
44
+ # Documented API Methods
45
+ def api_methods
46
+ docs = LabClient::Docs.docs.dig(group_name, 'Reference')
47
+
48
+ unless docs
49
+ puts 'No Available Help'
50
+ return false
51
+ end
52
+
53
+ LabClient::Docs.docs.dig(group_name, 'Reference').map do |doc|
54
+ doc[:options].map do |opt|
55
+ opt[:name]
56
+ end
57
+ end.flatten.sort
58
+ end
59
+
60
+ def valid_group_project_levels
61
+ %i[guest reporter developer maintainer owner]
62
+ end
36
63
 
37
64
  # TODO: Combine all of these?
38
65
  def collect_project_id(position = 1)
@@ -81,6 +108,11 @@ module LabClient
81
108
  end
82
109
  end
83
110
 
111
+ # Forward response success
112
+ def success?
113
+ @response.success?
114
+ end
115
+
84
116
  # Formatting Time Helper
85
117
  def format_time?(time)
86
118
  time.respond_to?(:to_time)
@@ -0,0 +1,17 @@
1
+ # Extensions for OpenStruct specific to LabClient
2
+ module LabClient
3
+ # Unique inherited class to not override top level openstruct
4
+ class LabStruct < OpenStruct
5
+ def keys
6
+ to_h.keys.sort
7
+ end
8
+
9
+ def inspect
10
+ to_h.inspect
11
+ end
12
+
13
+ def as_json(*args)
14
+ super.as_json['table']
15
+ end
16
+ end
17
+ end
@@ -32,12 +32,12 @@ module LabClient
32
32
  :expires_at => "2050-11-14",
33
33
  :historical_max => 0,
34
34
  :maximum_user_count => 48,
35
- :licensee => OpenStruct {
35
+ :licensee => LabStruct {
36
36
  :Name => "GitLab Henley",
37
37
  :Email => "test_user@gitlab.com",
38
38
  :Company => "GitLab, Inc."
39
39
  },
40
- :add_ons => OpenStruct {},
40
+ :add_ons => LabStruct {},
41
41
  :expired => false,
42
42
  :overage => 0,
43
43
  :user_limit => 100,
@@ -51,6 +51,7 @@ module LabClient
51
51
  option 'level', 'Humanized symbol of access level. e.g. :developer'
52
52
  option 'user', 'Collect user object.'
53
53
  option '<permission>?', 'True/False evaluation each guest?, developer? etc'
54
+ option 'greater_than', 'True/False if user has greater than [Permission Name]'
54
55
  end
55
56
  end
56
57
  end
@@ -4,13 +4,22 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Update' do
6
6
  title 'Accept'
7
- desc 'Merge changes submitted with MR. [project id, merge request iid]'
7
+ desc 'Merge changes submitted with MR. [Project ID, merge request iid]'
8
8
 
9
9
  markdown <<~DOC
10
- - <small>if merge request is unable to be accepted (ie: Work in Progress, Closed, Pipeline Pending Completion, or Failed while requiring Success) - you'll get a `405` and the error message 'Method Not Allowed'</small>
11
- - <small>If it has some conflicts and can not be merged - you'll get a `406` and the error message 'Branch cannot be merged'</small>
12
- - <small>If the `sha` parameter is passed and does not match the HEAD of the source - you'll get a `409` and the error message 'SHA </small>does not match HEAD of source branch'
13
- - <small>If you don't have permissions to accept this merge request - you'll get a `401`</small>
10
+ - <small>if merge request is unable to be accepted (ie: Work in Progress, Closed, Pipeline Pending Completion, or Failed while requiring Success) - you'll get a `405` and the error message 'Method Not Allowed'</small>
11
+ - <small>If it has some conflicts and can not be merged - you'll get a `406` and the error message 'Branch cannot be merged'</small>
12
+ - <small>If the `sha` parameter is passed and does not match the HEAD of the source - you'll get a `409` and the error message 'SHA </small>does not match HEAD of source branch'
13
+ - <small>If you don't have permissions to accept this merge request - you'll get a `401`</small>
14
+
15
+ | **Attribute** | **Attribute** |
16
+ | ---------------------------- | ------------------------------------------------------------------------------------------------- |
17
+ | merge_commit_message | Custom merge commit message |
18
+ | squash_commit_message | Custom squash commit message |
19
+ | squash | if true the commits will be squashed into a single commit on merge |
20
+ | should_remove_source_branch | if true removes the source branch |
21
+ | merge_when_pipeline_succeeds | if true the MR is merged when the pipeline succeeds |
22
+ | sha | if present, then this SHA must match the HEAD of the source branch, otherwise the merge will fail |
14
23
  DOC
15
24
 
16
25
  example 'client.merge_requests.accept(343, 3)'
@@ -29,11 +38,11 @@ module LabClient
29
38
  end
30
39
 
31
40
  # Accept
32
- def accept(project_id, merge_request_id)
41
+ def accept(project_id, merge_request_id, query = {})
33
42
  project_id = format_id(project_id)
34
43
  merge_request_id = format_id(merge_request_id)
35
44
 
36
- client.request(:put, "projects/#{project_id}/merge_requests/#{merge_request_id}/merge", MergeRequest)
45
+ client.request(:put, "projects/#{project_id}/merge_requests/#{merge_request_id}/merge", MergeRequest, query)
37
46
  end
38
47
  end
39
48
  end
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Update' do
6
6
  title 'Cancel Auto Merge'
7
- desc 'Cancel Automatic Merge When Pipeline Succeeds [project id, merge request iid]'
7
+ desc 'Cancel Automatic Merge When Pipeline Succeeds [Project ID, merge request iid]'
8
8
  markdown <<~DOC
9
9
  - If you don't have permissions to accept this merge request - you'll get a `401`
10
10
 
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Show' do
6
6
  title 'Changes'
7
- desc 'Shows information about the merge request including its files and changes. [project id, mr iid]'
7
+ desc 'Shows information about the merge request including its files and changes. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.changes(333,1)'
9
9
  result <<~DOC
10
10
  => #<Changes MR: 1, title: Update README.md>
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Show' do
6
6
  title 'Closes Issues'
7
- desc 'Get all the issues that would be closed by merging the provided merge request. [project id, mr iid]'
7
+ desc 'Get all the issues that would be closed by merging the provided merge request. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.closes_issues(343, 1)'
9
9
  result <<~DOC
10
10
  => => [#<Issue id: 1, title: Problem!, state: opened>]
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Show' do
6
6
  title 'Commits'
7
- desc 'Get a list of merge request commits. [project id, mr iid]'
7
+ desc 'Get a list of merge request commits. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.commits(333,1)'
9
9
  result <<~DOC
10
10
  => [#<Commit title: Update README.md, sha: 50c90734>, #<Commit title: Add new file, sha: 6534a685>]
@@ -41,6 +41,18 @@ module LabClient
41
41
  DOC
42
42
  end
43
43
 
44
+ doc 'Create' do
45
+ desc 'via Project'
46
+ example <<~DOC
47
+ project = client.projects.show(264)
48
+ project.merge_request_create(
49
+ title: 'New MR!',
50
+ source_branch: 'sweet-release',
51
+ target_branch: :master
52
+ )
53
+ DOC
54
+ end
55
+
44
56
  # Create
45
57
  def create(project_id, query)
46
58
  project_id = format_id(project_id)
@@ -3,7 +3,7 @@ module LabClient
3
3
  # Specifics
4
4
  class MergeRequests < Common
5
5
  doc 'Delete' do
6
- desc 'Only for admins and project owners. Deletes the merge request in question. [project id, merge request iid]'
6
+ desc 'Only for admins and project owners. Deletes the merge request in question. [Project ID, merge request iid]'
7
7
 
8
8
  example 'client.merge_requests.delete(343, 2)'
9
9
 
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Diff' do
6
6
  title 'Versions'
7
- desc 'Get a list of merge request diff versions. [project id, mr iid]'
7
+ desc 'Get a list of merge request diff versions. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.diff_versions(333,1)'
9
9
  result <<~DOC
10
10
  => [#<MergeRequestDiff id: 3, MR: 1, state: collected>, #<MergeRequestDiff id: 2, MR: 1, state: collected>, ..]
@@ -51,8 +51,8 @@ module LabClient
51
51
  client.merge_requests.delete(project_id, iid)
52
52
  end
53
53
 
54
- def accept
55
- client.merge_requests.accept(project_id, iid)
54
+ def accept(query = {})
55
+ client.merge_requests.accept(project_id, iid, query)
56
56
  end
57
57
 
58
58
  def merge_ref
@@ -99,6 +99,10 @@ module LabClient
99
99
  client.notes.merge_requests.list(project_id, iid)
100
100
  end
101
101
 
102
+ def note_create(query)
103
+ client.notes.merge_requests.create(project_id, iid, query)
104
+ end
105
+
102
106
  def todo
103
107
  client.merge_requests.todo(project_id, iid)
104
108
  end
@@ -166,9 +170,42 @@ module LabClient
166
170
  client.resource_labels.merge_requests.show(project_id, iid, resource_event_id)
167
171
  end
168
172
 
173
+ # Reload
174
+ def reload
175
+ update_self client.merge_requests.show(project_id, iid)
176
+ end
177
+
178
+ # Wait for Import / Set a Hard Limit
179
+ def wait_for_merge_status(total_time = 300, sleep_time = 15)
180
+ # :unchecked
181
+ # :cannot_be_merged_recheck
182
+ # :checking
183
+ # :cannot_be_merged_rechecking
184
+ # :can_be_merged
185
+ # :cannot_be_merged
186
+
187
+ # Success
188
+ # [unchecked, can_be_merged]
189
+
190
+ # Fail
191
+ # [cannot_be_merged cannot_be_merged_recheck]
192
+
193
+ Timeout.timeout(total_time) do
194
+ loop do
195
+ reload
196
+ puts "Waiting for Merge Status: #{merge_status}"
197
+ break if %w[can_be_merged unchecked].include? merge_status
198
+ raise "Cannot be merged! #{import_error}" if %w[cannot_be_merged cannot_be_merged_recheck].include? merge_status
199
+
200
+ sleep sleep_time
201
+ end
202
+ end
203
+ end
204
+
205
+ # rubocop:disable Metrics/BlockLength
169
206
  help do
170
207
  subtitle 'MergeRequest'
171
- option 'accept', 'Merge changes submitted'
208
+ option 'accept', 'Merge changes submitted [Hash]'
172
209
  option 'add_time_spent', 'Adds spent time. Accepts Duration or Human Format. (1.hour or "1h")'
173
210
  option 'changes', 'Show merge request changes'
174
211
  option 'closes_issues', 'Show issues that this merge request will close'
@@ -176,7 +213,13 @@ module LabClient
176
213
  option 'create_pipeline', 'Create new pipeline for this merge request.'
177
214
  option 'delete', 'Delete this merge request.'
178
215
  option 'merge_ref', 'Show Merge Ref'
179
- option 'notes', 'List notes/comments.'
216
+ option 'reload', 'Reload this merge request object (New API Call)'
217
+ option 'wait_for_merge_status', 'Looping, wait for merge request status [Timeout, Interval]'
218
+
219
+ # Notes
220
+ option 'notes', 'List notes/comments. [Hash]'
221
+ option 'note_create', 'Creates a new note. [Hash]'
222
+
180
223
  option 'participants', 'List participants in this merge request.'
181
224
  option 'pipelines', 'List pipelines in this merge request.'
182
225
  option 'reset_spent_time', 'Resets the spent time'
@@ -206,6 +249,8 @@ module LabClient
206
249
  option 'resource_labels', 'List of all label events'
207
250
  option 'resource_label', 'Show single label event [Resource Event ID]'
208
251
  end
252
+
253
+ # rubocop:enable Metrics/BlockLength
209
254
  end
210
255
  # rubocop:enable Metrics/ClassLength
211
256
  end
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Show' do
6
6
  title 'Participants'
7
- desc 'Get a list of merge request participants. [project id, mr iid]'
7
+ desc 'Get a list of merge request participants. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.participants(333,1)'
9
9
  result <<~DOC
10
10
  => [#<User id: 1, username: braum>, #<User id: 52, username: anivia>]
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Pipelines' do
6
6
  title 'List'
7
- desc 'Get a list of merge request pipelines. [project id, mr iid]'
7
+ desc 'Get a list of merge request pipelines. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.pipelines(343,1)'
9
9
  result <<~DOC
10
10
  => [#<Pipeline id: 4, ref: branch, status: success>]
@@ -33,7 +33,7 @@ module LabClient
33
33
 
34
34
  doc 'Pipelines' do
35
35
  title 'Create'
36
- desc 'Create a new pipeline for a merge request. Requires .gitlab-ci.yml to be configured with only: [merge_requests] to create jobs. [project id, mr iid]'
36
+ desc 'Create a new pipeline for a merge request. Requires .gitlab-ci.yml to be configured with only: [merge_requests] to create jobs. [Project ID, mr iid]'
37
37
  example 'client.merge_requests.create_pipeline(343, 1)'
38
38
  result <<~DOC
39
39
  => #<Pipeline id: 7, ref: refs/merge-requests/1/head, status: pending>
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Update' do
6
6
  title 'Rebase'
7
- desc 'Rebase a merge request [project id, merge request iid, skip_ci (true/false)]'
7
+ desc 'Rebase a merge request [Project ID, merge request iid, skip_ci (true/false)]'
8
8
  markdown <<~DOC
9
9
  - Automatically rebase the `source_branch` of the merge request against its `target_branch`.
10
10
 
@@ -3,7 +3,7 @@ module LabClient
3
3
  # Specifics
4
4
  class MergeRequests < Common
5
5
  doc 'Show' do
6
- desc 'Shows information about a single merge request. [project id, mr iid]'
6
+ desc 'Shows information about a single merge request. [Project ID, mr iid]'
7
7
  example 'client.merge_requests.show(333,1)'
8
8
  result <<~DOC
9
9
  => #<MergeRequest id: 37, title: Add new file>
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Update' do
6
6
  title 'Subscribe'
7
- desc 'Subscribes the authenticated user to a merge request to receive notification. [project id, merge request iid]'
7
+ desc 'Subscribes the authenticated user to a merge request to receive notification. [Project ID, merge request iid]'
8
8
 
9
9
  example 'client.merge_requests.subscribe(343, 7)'
10
10
 
@@ -4,7 +4,7 @@ module LabClient
4
4
  class MergeRequests < Common
5
5
  doc 'Time Stats' do
6
6
  title 'Show'
7
- desc 'Get time tracking stats. [project id, mr iid]'
7
+ desc 'Get time tracking stats. [Project ID, mr iid]'
8
8
  example 'client.merge_requests.time_stats(333, 1)'
9
9
  result <<~DOC
10
10
  => {:time_estimate=>0, :total_time_spent=>0, :human_time_estimate=>nil, :human_total_time_spent=>nil}
@@ -28,7 +28,7 @@ module LabClient
28
28
 
29
29
  doc 'Time Stats' do
30
30
  title 'Add'
31
- desc 'Adds spent time for this merge request. [project id, mr iid, duration]'
31
+ desc 'Adds spent time for this merge request. [Project ID, mr iid, duration]'
32
32
  markdown 'Duration accepts Human Format, or ActiveSupport::Duration (e.g. 1.hour)'
33
33
  end
34
34
 
@@ -67,7 +67,7 @@ module LabClient
67
67
 
68
68
  doc 'Time Stats' do
69
69
  title 'Estimate'
70
- desc 'Sets an estimated time of work for this merge request. [project id, mr iid, duration]'
70
+ desc 'Sets an estimated time of work for this merge request. [Project ID, mr iid, duration]'
71
71
  markdown 'Duration accepts Human Format, or ActiveSupport::Duration (e.g. 1.hour)'
72
72
  end
73
73
 
@@ -108,7 +108,7 @@ module LabClient
108
108
  doc 'Time Stats' do
109
109
  title 'Reset'
110
110
  subtitle 'Estimate'
111
- desc 'Resets the estimated time for this merge request to 0 seconds. [project id, mr iid]'
111
+ desc 'Resets the estimated time for this merge request to 0 seconds. [Project ID, mr iid]'
112
112
  example 'client.merge_requests.reset_time_estimate(333, 1)'
113
113
  result <<~DOC
114
114
  => {:time_estimate=>0, :total_time_spent=>0, :human_time_estimate=>nil, :human_total_time_spent=>nil}
@@ -132,7 +132,7 @@ module LabClient
132
132
 
133
133
  doc 'Time Stats' do
134
134
  subtitle 'Time Spent'
135
- desc 'Resets the estimated time for this merge request to 0 seconds. [project id, mr iid]'
135
+ desc 'Resets the estimated time for this merge request to 0 seconds. [Project ID, mr iid]'
136
136
  example 'client.merge_requests.reset_spent_time(333, 1)'
137
137
  result <<~DOC
138
138
  => {:time_estimate=>0, :total_time_spent=>0, :human_time_estimate=>nil, :human_total_time_spent=>nil}