labclient 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/labclient.rb +42 -39
- data/lib/labclient/common.rb +5 -0
- data/lib/labclient/groups/group.rb +9 -0
- data/lib/labclient/groups/stub.rb +8 -0
- data/lib/labclient/http.rb +5 -1
- data/lib/labclient/issues/agent_detail.rb +1 -1
- data/lib/labclient/issues/closed_by.rb +1 -1
- data/lib/labclient/issues/create.rb +15 -5
- data/lib/labclient/issues/delete.rb +1 -1
- data/lib/labclient/issues/move.rb +1 -1
- data/lib/labclient/issues/participants.rb +1 -1
- data/lib/labclient/issues/related_merge_requests.rb +1 -1
- data/lib/labclient/issues/show.rb +1 -1
- data/lib/labclient/issues/subscribe.rb +1 -1
- data/lib/labclient/issues/time_stats.rb +5 -5
- data/lib/labclient/issues/todo.rb +1 -1
- data/lib/labclient/issues/unsubscribe.rb +1 -1
- data/lib/labclient/issues/update.rb +1 -1
- data/lib/labclient/klass.rb +4 -0
- data/lib/labclient/merge_requests/accept.rb +1 -1
- data/lib/labclient/merge_requests/cancel_auto_merge.rb +1 -1
- data/lib/labclient/merge_requests/changes.rb +1 -1
- data/lib/labclient/merge_requests/closes_issues.rb +1 -1
- data/lib/labclient/merge_requests/commits.rb +1 -1
- data/lib/labclient/merge_requests/delete.rb +1 -1
- data/lib/labclient/merge_requests/diff_versions.rb +1 -1
- data/lib/labclient/merge_requests/participants.rb +1 -1
- data/lib/labclient/merge_requests/pipelines.rb +2 -2
- data/lib/labclient/merge_requests/rebase.rb +1 -1
- data/lib/labclient/merge_requests/show.rb +1 -1
- data/lib/labclient/merge_requests/subscribe.rb +1 -1
- data/lib/labclient/merge_requests/time_stats.rb +5 -5
- data/lib/labclient/merge_requests/todo.rb +1 -1
- data/lib/labclient/merge_requests/unsubscribe.rb +1 -1
- data/lib/labclient/merge_requests/update.rb +1 -1
- data/lib/labclient/overview.rb +18 -0
- data/lib/labclient/projects/access_requests/access_request.rb +0 -1
- data/lib/labclient/projects/badges/project_badge.rb +0 -1
- data/lib/labclient/projects/clusters/project_cluster.rb +0 -1
- data/lib/labclient/projects/create.rb +13 -0
- data/lib/labclient/projects/deployments/project_deployment.rb +1 -3
- data/lib/labclient/projects/environments/project_environment.rb +0 -1
- data/lib/labclient/projects/forks/existing.rb +0 -2
- data/lib/labclient/projects/forks/fork.rb +1 -1
- data/lib/labclient/projects/forks/list.rb +0 -1
- data/lib/labclient/projects/forks/remove.rb +0 -1
- data/lib/labclient/projects/hooks/project_hook.rb +0 -1
- data/lib/labclient/projects/labels/project_label.rb +0 -1
- data/lib/labclient/projects/methods.rb +5 -0
- data/lib/labclient/projects/mirrors/project_mirror.rb +0 -1
- data/lib/labclient/projects/reference.rb +3 -0
- data/lib/labclient/projects/release_links/project_release_link.rb +0 -1
- data/lib/labclient/projects/releases/project_release.rb +0 -1
- data/lib/labclient/projects/services/project_service.rb +0 -1
- data/lib/labclient/projects/stars/star.rb +0 -2
- data/lib/labclient/projects/stars/starred_projects.rb +0 -2
- data/lib/labclient/projects/stars/starrers.rb +1 -1
- data/lib/labclient/projects/triggers/project_trigger.rb +0 -1
- data/lib/labclient/projects/variables/project_variable.rb +0 -1
- data/lib/labclient/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cfc44546096a710f5e2a8ed0b500b202825150b03a029738d8b870cf4258e94
|
4
|
+
data.tar.gz: c965712946b26eef38ae7546a483688eae0ae20cc82480dad59262aa050ba18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77a79ac90bfa375a488633c9aa530581a8235c3b5c0d00fd24644ccb962fd39152facc298e77a016cffb200f65b301e6d2c7a1ed883f2dfd2ea0dc6d96ea185d
|
7
|
+
data.tar.gz: cc4cb427458a49007775e063fc065df0623c76f4abe05f0b93279e3ca1638b9b0c024074cb8ac57e7ab732543c39da7cb9f436f2ca85263995c72bbf083d1df9
|
data/lib/labclient.rb
CHANGED
@@ -49,45 +49,6 @@ require 'labclient/users/delete'
|
|
49
49
|
require 'labclient/users/delete_identity'
|
50
50
|
require 'labclient/users/user'
|
51
51
|
|
52
|
-
# User Keys
|
53
|
-
require 'labclient/users/keys/client'
|
54
|
-
require 'labclient/users/keys/list'
|
55
|
-
require 'labclient/users/keys/show'
|
56
|
-
require 'labclient/users/keys/create'
|
57
|
-
require 'labclient/users/keys/delete'
|
58
|
-
|
59
|
-
# Notifications
|
60
|
-
require 'labclient/notifications/list'
|
61
|
-
require 'labclient/notifications/update'
|
62
|
-
|
63
|
-
# User GPG Keys
|
64
|
-
require 'labclient/users/gpg/client'
|
65
|
-
require 'labclient/users/gpg/list'
|
66
|
-
require 'labclient/users/gpg/show'
|
67
|
-
require 'labclient/users/gpg/create'
|
68
|
-
require 'labclient/users/gpg/delete'
|
69
|
-
require 'labclient/users/gpg/gpg_key'
|
70
|
-
|
71
|
-
# User Emails
|
72
|
-
require 'labclient/users/email/client'
|
73
|
-
require 'labclient/users/email/list'
|
74
|
-
require 'labclient/users/email/show'
|
75
|
-
require 'labclient/users/email/create'
|
76
|
-
require 'labclient/users/email/delete'
|
77
|
-
require 'labclient/users/email/email'
|
78
|
-
|
79
|
-
# Impersonation Tokens
|
80
|
-
require 'labclient/impersonation_tokens/impersonation_token'
|
81
|
-
require 'labclient/impersonation_tokens/list'
|
82
|
-
require 'labclient/impersonation_tokens/show'
|
83
|
-
require 'labclient/impersonation_tokens/create'
|
84
|
-
require 'labclient/impersonation_tokens/revoke'
|
85
|
-
|
86
|
-
# Namespaces
|
87
|
-
require 'labclient/namespaces/namespace'
|
88
|
-
require 'labclient/namespaces/list'
|
89
|
-
require 'labclient/namespaces/show'
|
90
|
-
|
91
52
|
# ===============================================
|
92
53
|
# Projects
|
93
54
|
# ===============================================
|
@@ -116,6 +77,9 @@ require 'labclient/projects/restore'
|
|
116
77
|
require 'labclient/projects/snapshot'
|
117
78
|
require 'labclient/projects/github_import'
|
118
79
|
|
80
|
+
# Group Stub / Docs ORder
|
81
|
+
require 'labclient/groups/stub'
|
82
|
+
|
119
83
|
# Project Forks
|
120
84
|
require 'labclient/projects/forks/list'
|
121
85
|
require 'labclient/projects/forks/fork'
|
@@ -684,6 +648,45 @@ require 'labclient/notes/epics/delete'
|
|
684
648
|
require 'labclient/notes/note'
|
685
649
|
# -----------------------------------
|
686
650
|
|
651
|
+
# User Keys
|
652
|
+
require 'labclient/users/keys/client'
|
653
|
+
require 'labclient/users/keys/list'
|
654
|
+
require 'labclient/users/keys/show'
|
655
|
+
require 'labclient/users/keys/create'
|
656
|
+
require 'labclient/users/keys/delete'
|
657
|
+
|
658
|
+
# Notifications
|
659
|
+
require 'labclient/notifications/list'
|
660
|
+
require 'labclient/notifications/update'
|
661
|
+
|
662
|
+
# User GPG Keys
|
663
|
+
require 'labclient/users/gpg/client'
|
664
|
+
require 'labclient/users/gpg/list'
|
665
|
+
require 'labclient/users/gpg/show'
|
666
|
+
require 'labclient/users/gpg/create'
|
667
|
+
require 'labclient/users/gpg/delete'
|
668
|
+
require 'labclient/users/gpg/gpg_key'
|
669
|
+
|
670
|
+
# User Emails
|
671
|
+
require 'labclient/users/email/client'
|
672
|
+
require 'labclient/users/email/list'
|
673
|
+
require 'labclient/users/email/show'
|
674
|
+
require 'labclient/users/email/create'
|
675
|
+
require 'labclient/users/email/delete'
|
676
|
+
require 'labclient/users/email/email'
|
677
|
+
|
678
|
+
# Impersonation Tokens
|
679
|
+
require 'labclient/impersonation_tokens/impersonation_token'
|
680
|
+
require 'labclient/impersonation_tokens/list'
|
681
|
+
require 'labclient/impersonation_tokens/show'
|
682
|
+
require 'labclient/impersonation_tokens/create'
|
683
|
+
require 'labclient/impersonation_tokens/revoke'
|
684
|
+
|
685
|
+
# Namespaces
|
686
|
+
require 'labclient/namespaces/namespace'
|
687
|
+
require 'labclient/namespaces/list'
|
688
|
+
require 'labclient/namespaces/show'
|
689
|
+
|
687
690
|
# Runners
|
688
691
|
require 'labclient/runners/list'
|
689
692
|
require 'labclient/runners/all'
|
data/lib/labclient/common.rb
CHANGED
@@ -72,6 +72,11 @@ module LabClient
|
|
72
72
|
CGI.escape obj_id.to_s
|
73
73
|
end
|
74
74
|
|
75
|
+
def format_query_id(key, query)
|
76
|
+
query[key] = format_id(query[key]) if query.key? key
|
77
|
+
query[key.to_s] = format_id(query[key.to_s]) if query.key? key.to_s
|
78
|
+
end
|
79
|
+
|
75
80
|
def format_query_ids(key, query)
|
76
81
|
query[key] = query[key].map { |x| format_id(x) } if query.key? key
|
77
82
|
|
@@ -49,10 +49,17 @@ module LabClient
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
def project_create(query)
|
53
|
+
query[:namespace_id] = id
|
54
|
+
client.projects.create(query)
|
55
|
+
end
|
56
|
+
|
52
57
|
def ldap_list
|
53
58
|
client.groups.ldap.list(id)
|
54
59
|
end
|
55
60
|
|
61
|
+
alias ldap_links ldap_list
|
62
|
+
|
56
63
|
def ldap_sync
|
57
64
|
client.groups.ldap.sync(id)
|
58
65
|
end
|
@@ -247,12 +254,14 @@ module LabClient
|
|
247
254
|
option 'audit_events', "List this group's AuditEvents"
|
248
255
|
option 'audit_event', 'Show a specific AuditEvents [Audit Event ID]'
|
249
256
|
option 'projects', 'List direct Projects [Hash]'
|
257
|
+
option 'project_create', 'Create a project in this Group [Hash]'
|
250
258
|
option 'details', 'Get all details [Hash]'
|
251
259
|
option 'search', 'Search by scope within group [scope, search_string]'
|
252
260
|
option 'delete', 'Delete this Group'
|
253
261
|
option 'restore', 'Restore if marked for deletion'
|
254
262
|
option 'transfer', 'Transfer project to this group [Project ID]'
|
255
263
|
option 'ldap_list', 'Lists LDAP group links'
|
264
|
+
option 'ldap_links', 'Alias for ldap_list'
|
256
265
|
option 'ldap_sync', 'Syncs the group with its linked LDAP group'
|
257
266
|
option 'ldap_create', 'Adds an LDAP group link. [Hash]'
|
258
267
|
option 'ldap_delete', 'Deletes an LDAP group link. [CN, Provider(optional)]'
|
data/lib/labclient/http.rb
CHANGED
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Show' do
|
6
6
|
title 'Agent Detail'
|
7
|
-
desc 'Get user agent details [
|
7
|
+
desc 'Get user agent details [Project ID, Issue IID]'
|
8
8
|
example 'client.issues.agent_detail(30, 1)'
|
9
9
|
result <<~DOC
|
10
10
|
=> {:user_agent=>"Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0", :ip_address=>"10.0.0.14", :akismet_submitted=>false}
|
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Show' do
|
6
6
|
subtitle 'Closed By'
|
7
|
-
desc 'Get all the merge requests that will close issue when merged. [
|
7
|
+
desc 'Get all the merge requests that will close issue when merged. [Project ID, Issue IID]'
|
8
8
|
example 'client.issues.closed_by(5, 1)'
|
9
9
|
result <<~DOC
|
10
10
|
=> [#<MergeRequest id: 5, title: Update README.md, state: opened>]
|
@@ -3,7 +3,7 @@ module LabClient
|
|
3
3
|
# Specifics
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Create' do
|
6
|
-
desc 'Creates a new project issue. [
|
6
|
+
desc 'Creates a new project issue. [Project ID]'
|
7
7
|
example 'client.issues.create(5, title: "Fancy!")'
|
8
8
|
result <<~DOC
|
9
9
|
=> #<Issue id: 1, title: Fancy!, state: opened>
|
@@ -14,10 +14,20 @@ module LabClient
|
|
14
14
|
markdown <<~DOC
|
15
15
|
See [API docs here](https://docs.gitlab.com/ee/api/issues.html#new-issue) for full list of attributes
|
16
16
|
|
17
|
-
| Attribute
|
18
|
-
|
19
|
-
| title
|
20
|
-
| description
|
17
|
+
| Attribute | Type | Required | Description |
|
18
|
+
|-------------|----------------|----------|--------------|
|
19
|
+
| title | string | yes | The title of an issue |
|
20
|
+
| description | string | no | The description of an issue. Limited to 1,048,576 characters. |
|
21
|
+
|
22
|
+
|
23
|
+
DOC
|
24
|
+
end
|
25
|
+
|
26
|
+
doc 'Create' do
|
27
|
+
desc 'Via Project [Hash]'
|
28
|
+
example <<~DOC
|
29
|
+
project = client.projects.show(16)
|
30
|
+
project.issue_create(title: "Fancy!")
|
21
31
|
DOC
|
22
32
|
end
|
23
33
|
|
@@ -3,7 +3,7 @@ module LabClient
|
|
3
3
|
# Specifics
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Delete' do
|
6
|
-
desc 'Updates an existing project issue. This call is also used to mark an issue as closed. [
|
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.delete(5, 1)'
|
8
8
|
result <<~DOC
|
9
9
|
=> #<Issue id: 1, title: Moar Fancy!, state: opened>
|
@@ -3,7 +3,7 @@ module LabClient
|
|
3
3
|
# Specifics
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Move' do
|
6
|
-
desc 'Moves an issue to a different project. [
|
6
|
+
desc 'Moves an issue to a different project. [Project ID, issue iid, target project id]'
|
7
7
|
example 'client.issues.move(5, 1, 6)'
|
8
8
|
result <<~DOC
|
9
9
|
=> #<Issue id: 1, title: Moar Fancy!, state: opened>
|
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Show' do
|
6
6
|
title 'Participants'
|
7
|
-
desc 'Get a list of issue participants. [
|
7
|
+
desc 'Get a list of issue participants. [Project ID, Issue IID]'
|
8
8
|
example 'client.issues.participants(30,1)'
|
9
9
|
result <<~DOC
|
10
10
|
=> [#<User id: 1, username: braum>, #<User id: 52, username: anivia>]
|
@@ -5,7 +5,7 @@ module LabClient
|
|
5
5
|
doc 'Show' do
|
6
6
|
title 'Merge Requests'
|
7
7
|
subtitle 'Related'
|
8
|
-
desc 'Get all the merge requests that are related to the issue. [
|
8
|
+
desc 'Get all the merge requests that are related to the issue. [Project ID, Issue IID]'
|
9
9
|
example 'client.issues.related_merge_requests(5, 1)'
|
10
10
|
result <<~DOC
|
11
11
|
=> [#<MergeRequest id: 5, title: Update README.md, state: opened>]
|
@@ -3,7 +3,7 @@ module LabClient
|
|
3
3
|
# Specifics
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Show' do
|
6
|
-
desc 'Get a single project issue. [project,
|
6
|
+
desc 'Get a single project issue. [project, Issue IID]'
|
7
7
|
example 'client.issues.show(343, 1)'
|
8
8
|
result <<~DOC
|
9
9
|
=> #<Issue id: 1, title: Front-line global approach, state: opened>
|
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Update' do
|
6
6
|
title 'Subscribe'
|
7
|
-
desc 'Subscribes the authenticated user to an issue to receive notifications. [
|
7
|
+
desc 'Subscribes the authenticated user to an issue to receive notifications. [Project ID, Issue IID]'
|
8
8
|
|
9
9
|
example 'client.issues.subscribe(343, 7)'
|
10
10
|
|
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class Issues < Common
|
5
5
|
doc 'Time Stats' do
|
6
6
|
title 'Show'
|
7
|
-
desc 'Get time tracking stats. [
|
7
|
+
desc 'Get time tracking stats. [Project ID, Issue IID]'
|
8
8
|
example 'client.issues.time_stats(30, 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. [
|
31
|
+
desc 'Adds spent time for this merge request. [Project ID, issue 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. [
|
70
|
+
desc 'Sets an estimated time of work for this merge request. [Project ID, issue 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. [
|
111
|
+
desc 'Resets the estimated time for this merge request to 0 seconds. [Project ID, Issue IID]'
|
112
112
|
example 'client.issues.reset_time_estimate(30, 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. [
|
135
|
+
desc 'Resets the estimated time for this merge request to 0 seconds. [Project ID, Issue IID]'
|
136
136
|
example 'client.issues.reset_spent_time(30, 1)'
|
137
137
|
result <<~DOC
|
138
138
|
=> {:time_estimate=>0, :total_time_spent=>0, :human_time_estimate=>nil, :human_total_time_spent=>nil}
|
@@ -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. [
|
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. [
|
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. [
|
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>
|
data/lib/labclient/klass.rb
CHANGED
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class MergeRequests < Common
|
5
5
|
doc 'Update' do
|
6
6
|
title 'Accept'
|
7
|
-
desc 'Merge changes submitted with MR. [
|
7
|
+
desc 'Merge changes submitted with MR. [Project ID, merge request iid]'
|
8
8
|
|
9
9
|
markdown <<~DOC
|
10
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>
|
@@ -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 [
|
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. [
|
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. [
|
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. [
|
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>]
|
@@ -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. [
|
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. [
|
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>, ..]
|
@@ -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. [
|
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. [
|
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. [
|
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 [
|
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. [
|
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. [
|
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. [
|
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. [
|
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. [
|
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. [
|
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. [
|
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}
|
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class MergeRequests < Common
|
5
5
|
doc 'Update' do
|
6
6
|
title 'Todo'
|
7
|
-
desc 'Manually creates a todo for the current user on a merge request. [
|
7
|
+
desc 'Manually creates a todo for the current user on a merge request. [Project ID, merge request iid]'
|
8
8
|
|
9
9
|
example 'client.merge_requests.todo(343, 7)'
|
10
10
|
|
@@ -4,7 +4,7 @@ module LabClient
|
|
4
4
|
class MergeRequests < Common
|
5
5
|
doc 'Update' do
|
6
6
|
title 'Unsubscribe'
|
7
|
-
desc 'Subscribes the authenticated user to a merge request to receive notification. [
|
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.unsubscribe(343, 7)'
|
10
10
|
|
@@ -3,7 +3,7 @@ module LabClient
|
|
3
3
|
# Specifics
|
4
4
|
class MergeRequests < Common
|
5
5
|
doc 'Update' do
|
6
|
-
desc 'Updates an existing merge request. You can change the target branch, title, or even close the MR. [
|
6
|
+
desc 'Updates an existing merge request. You can change the target branch, title, or even close the MR. [Project ID, merge request iid]'
|
7
7
|
|
8
8
|
example <<~DOC
|
9
9
|
client.merge_requests.update(343, 2, {
|
data/lib/labclient/overview.rb
CHANGED
@@ -173,6 +173,24 @@ module LabClient
|
|
173
173
|
DOC
|
174
174
|
end
|
175
175
|
|
176
|
+
doc 'Other' do
|
177
|
+
title 'Object Helpers'
|
178
|
+
markdown <<~DOC
|
179
|
+
Each created object will have additional helper methods
|
180
|
+
DOC
|
181
|
+
|
182
|
+
result <<~DOC
|
183
|
+
project = client.projects.show(5)
|
184
|
+
|
185
|
+
# Awesome Print all details
|
186
|
+
project.verbose
|
187
|
+
|
188
|
+
# Awesome Print all details
|
189
|
+
project.valid_group_project_levels
|
190
|
+
# => [:guest, :reporter, :developer, :maintainer, :owner]
|
191
|
+
DOC
|
192
|
+
end
|
193
|
+
|
176
194
|
doc 'Other' do
|
177
195
|
title 'Object IDs'
|
178
196
|
|
@@ -32,6 +32,16 @@ module LabClient
|
|
32
32
|
example 'client.projects.create(name: "Verbal", description: "hes gone", visibility: :private)'
|
33
33
|
end
|
34
34
|
|
35
|
+
doc 'Create' do
|
36
|
+
desc 'Via Group'
|
37
|
+
example <<~DOC
|
38
|
+
group = client.groups.show(51)
|
39
|
+
group.project_create(name: "Hobby", description: "We do have time for your darned hobbies!")
|
40
|
+
DOC
|
41
|
+
|
42
|
+
example 'client.projects.create(name: "Verbal", description: "hes gone", visibility: :private)'
|
43
|
+
end
|
44
|
+
|
35
45
|
doc 'Create' do
|
36
46
|
title 'For User'
|
37
47
|
desc 'Creates a new project owned by the specified user [user id, params]'
|
@@ -42,7 +52,10 @@ module LabClient
|
|
42
52
|
client.request(:post, "projects/user/#{user_id}", Project, query)
|
43
53
|
end
|
44
54
|
|
55
|
+
# TODO: Test Project/Group Creation
|
56
|
+
# TODO: Create helper for group
|
45
57
|
def create(query = {})
|
58
|
+
format_query_id(:namespace_id, query)
|
46
59
|
client.request(:post, 'projects', Project, query)
|
47
60
|
end
|
48
61
|
end
|
@@ -28,11 +28,9 @@ module LabClient
|
|
28
28
|
user_attrs %i[user]
|
29
29
|
|
30
30
|
help do
|
31
|
-
|
32
|
-
subtitle 'ProjectDeployment'
|
31
|
+
subtitle 'Project Deployment'
|
33
32
|
option 'project', 'Show Project'
|
34
33
|
option 'update', 'Update this deployment [Hash]'
|
35
|
-
option 'delete', 'Delete this deployment'
|
36
34
|
option 'stop', 'Stop this deployment'
|
37
35
|
end
|
38
36
|
end
|
@@ -75,10 +75,15 @@ module LabClient
|
|
75
75
|
update_self(client.projects.fork_existing(id, target_id))
|
76
76
|
end
|
77
77
|
|
78
|
+
# Issues
|
78
79
|
def issues(query = {})
|
79
80
|
client.issues.project_issues(id, query)
|
80
81
|
end
|
81
82
|
|
83
|
+
def issue_create(query)
|
84
|
+
client.issues.create(id, query)
|
85
|
+
end
|
86
|
+
|
82
87
|
# Hooks
|
83
88
|
def hooks
|
84
89
|
client.projects.hooks.list(id)
|
@@ -12,7 +12,10 @@ module LabClient
|
|
12
12
|
option 'fork_remove', 'Remove Fork Relationshgip'
|
13
13
|
option 'fork', 'Fork this project, accepts hash, [namespace, path, name]'
|
14
14
|
option 'forks', 'List forks of this project'
|
15
|
+
|
16
|
+
# Issues
|
15
17
|
option 'issues', 'List project issues [Hash]'
|
18
|
+
option 'issue_create', 'Create a new issue in this project [Hash]'
|
16
19
|
|
17
20
|
option 'housekeeping', 'Start the Housekeeping'
|
18
21
|
option 'languages', 'Get percentage value of languages used.'
|
data/lib/labclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: labclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Davin Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -442,6 +442,7 @@ files:
|
|
442
442
|
- lib/labclient/groups/runners.rb
|
443
443
|
- lib/labclient/groups/search.rb
|
444
444
|
- lib/labclient/groups/show.rb
|
445
|
+
- lib/labclient/groups/stub.rb
|
445
446
|
- lib/labclient/groups/subgroups.rb
|
446
447
|
- lib/labclient/groups/transfer.rb
|
447
448
|
- lib/labclient/groups/update.rb
|