geet 0.27.8 → 0.28.1
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/.github/workflows/ci.yml +0 -1
- data/README.md +8 -17
- data/geet.gemspec +1 -1
- data/lib/geet/git/repository.rb +36 -70
- data/lib/geet/helpers/services_workflow_helper.rb +1 -1
- data/lib/geet/services/add_upstream_repo.rb +3 -1
- data/lib/geet/services/close_milestones.rb +3 -1
- data/lib/geet/services/comment_pr.rb +3 -1
- data/lib/geet/services/create_gist.rb +2 -0
- data/lib/geet/services/create_issue.rb +29 -28
- data/lib/geet/services/create_label.rb +4 -2
- data/lib/geet/services/create_milestone.rb +4 -2
- data/lib/geet/services/create_pr.rb +21 -27
- data/lib/geet/services/list_issues.rb +5 -3
- data/lib/geet/services/list_labels.rb +3 -1
- data/lib/geet/services/list_milestones.rb +9 -7
- data/lib/geet/services/list_prs.rb +3 -1
- data/lib/geet/services/merge_pr.rb +4 -2
- data/lib/geet/services/open_pr.rb +1 -1
- data/lib/geet/utils/attributes_selection_manager.rb +2 -0
- data/lib/geet/utils/git_client.rb +0 -11
- data/lib/geet/version.rb +1 -1
- data/spec/integration/create_label_spec.rb +0 -21
- data/spec/integration/create_pr_spec.rb +0 -1
- data/spec/integration/list_issues_spec.rb +0 -46
- data/spec/integration/list_labels_spec.rb +0 -27
- data/spec/integration/list_milestones_spec.rb +0 -27
- data/spec/integration/merge_pr_spec.rb +0 -30
- data/spec/spec_helper.rb +0 -3
- metadata +2 -16
- data/lib/geet/github/remote_repository.rb +0 -53
- data/lib/geet/gitlab/api_interface.rb +0 -212
- data/lib/geet/gitlab/issue.rb +0 -62
- data/lib/geet/gitlab/label.rb +0 -66
- data/lib/geet/gitlab/milestone.rb +0 -78
- data/lib/geet/gitlab/pr.rb +0 -114
- data/lib/geet/gitlab/user.rb +0 -52
- data/lib/geet/services/abstract_create_issue.rb +0 -21
- data/spec/vcr_cassettes/gitlab_com/create_label.yml +0 -64
- data/spec/vcr_cassettes/gitlab_com/list_issues.yml +0 -84
- data/spec/vcr_cassettes/gitlab_com/list_issues_with_assignee.yml +0 -162
- data/spec/vcr_cassettes/gitlab_com/list_labels.yml +0 -80
- data/spec/vcr_cassettes/gitlab_com/list_milestones.yml +0 -397
- data/spec/vcr_cassettes/gitlab_com/merge_pr.yml +0 -144
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6aa24d63c1117666e8647bdd0569d359f8b6cb9c380134522de39cefa9dc6fae
|
|
4
|
+
data.tar.gz: 9067ba5d4a8eb41f4f9871c5923c62b818bfb16089a05c1c0c2b4b10cab62954
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ecf5a66024e83c6d6bd8470c8deeeb7529092757f9386a234a1e3b482236f1bc51687725fe58408b9ccf2b4a668d991d215cf462492c8517a0681e7248e8878d
|
|
7
|
+
data.tar.gz: 0c5dc68513f260dfb195e072d928f8be4696a7f5fe986005c92865209a7617784ef7c578e020c2306e2c415a6b1a512d0cf3953c92ea00163e71b9557afa6187
|
data/.github/workflows/ci.yml
CHANGED
data/README.md
CHANGED
|
@@ -2,28 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
# Geet
|
|
4
4
|
|
|
5
|
-
Command line interface for performing
|
|
5
|
+
Command line interface for performing GitHub operations.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
In the past, Geet supported multiple providers, including GitLab; it was originally conceived as a provider-independent version of [Hub](https://github.com/github/hub) and [Lab](https://github.com/zaquestion/lab).
|
|
8
8
|
|
|
9
9
|
## Development status/plan
|
|
10
10
|
|
|
11
|
-
The current focus is implementing Gitlab functionalities (0.3.x series).
|
|
12
|
-
|
|
13
11
|
Everything is tracked in detail via [issues](https://github.com/saveriomiroddi/geet/issues) and [milestones](https://github.com/saveriomiroddi/geet/milestones).
|
|
14
12
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
The functionalities currently supported are:
|
|
13
|
+
## Supported operations
|
|
18
14
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- open repository
|
|
24
|
-
- Github:
|
|
25
|
-
- comment PR
|
|
26
|
-
- create gist, issue, milestone, PR
|
|
15
|
+
- create label, gist, issue, milestone, PR
|
|
16
|
+
- list issues, labels, milestones, PRs
|
|
17
|
+
- merge PR, comment PR
|
|
18
|
+
- open repository
|
|
27
19
|
|
|
28
20
|
## Samples
|
|
29
21
|
|
|
@@ -31,8 +23,7 @@ The functionalities currently supported are:
|
|
|
31
23
|
|
|
32
24
|
Geet requires the API token environment variable to be set, eg:
|
|
33
25
|
|
|
34
|
-
export GITHUB_API_TOKEN=0123456789abcdef0123456789abcdef
|
|
35
|
-
export GITLAB_API_TOKEN=0123456789abcd-ef0-1 # for GitLab
|
|
26
|
+
export GITHUB_API_TOKEN=0123456789abcdef0123456789abcdef
|
|
36
27
|
|
|
37
28
|
All the commands need to be run from the git repository.
|
|
38
29
|
|
data/geet.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
|
9
9
|
s.required_ruby_version = ">= 3.2.0"
|
|
10
10
|
s.authors = ["Saverio Miroddi"]
|
|
11
|
-
s.date = "2026-02-
|
|
11
|
+
s.date = "2026-02-21"
|
|
12
12
|
s.email = ["saverio.pub2@gmail.com"]
|
|
13
13
|
s.homepage = "https://github.com/saveriomiroddi/geet"
|
|
14
14
|
s.summary = "Commandline interface for performing SCM host operations, eg. create a PR on GitHub"
|
data/lib/geet/git/repository.rb
CHANGED
|
@@ -37,14 +37,14 @@ module Geet
|
|
|
37
37
|
|
|
38
38
|
# REMOTE FUNCTIONALITIES (REPOSITORY)
|
|
39
39
|
|
|
40
|
-
sig { returns(T
|
|
40
|
+
sig { returns(T::Array[Github::User]) }
|
|
41
41
|
def collaborators
|
|
42
|
-
|
|
42
|
+
Github::User.list_collaborators(api_interface)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
sig { returns(T
|
|
45
|
+
sig { returns(T::Array[Github::Label]) }
|
|
46
46
|
def labels
|
|
47
|
-
|
|
47
|
+
Github::Label.list(api_interface)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
sig {
|
|
@@ -52,13 +52,13 @@ module Geet
|
|
|
52
52
|
title: String,
|
|
53
53
|
description: String
|
|
54
54
|
)
|
|
55
|
-
.returns(
|
|
55
|
+
.returns(Github::Issue)
|
|
56
56
|
}
|
|
57
57
|
def create_issue(title, description)
|
|
58
58
|
confirm(LOCAL_ACTION_ON_UPSTREAM_REPOSITORY_MESSAGE) if local_action_on_upstream_repository? && @warnings
|
|
59
59
|
confirm(ACTION_ON_PROTECTED_REPOSITORY_MESSAGE) if action_on_protected_repository? && @warnings
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Github::Issue.create(title, description, api_interface)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
sig {
|
|
@@ -66,46 +66,46 @@ module Geet
|
|
|
66
66
|
name: String,
|
|
67
67
|
color: String
|
|
68
68
|
)
|
|
69
|
-
.returns(
|
|
69
|
+
.returns(Github::Label)
|
|
70
70
|
}
|
|
71
71
|
def create_label(name, color)
|
|
72
|
-
|
|
72
|
+
Github::Label.create(name, color, api_interface)
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
sig { params(name: String).void }
|
|
76
76
|
def delete_branch(name)
|
|
77
|
-
|
|
77
|
+
Github::Branch.delete(name, api_interface)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
sig {
|
|
81
81
|
params(
|
|
82
|
-
assignee: T.nilable(
|
|
83
|
-
milestone: T.nilable(
|
|
82
|
+
assignee: T.nilable(Github::User),
|
|
83
|
+
milestone: T.nilable(Github::Milestone)
|
|
84
84
|
)
|
|
85
|
-
.returns(T
|
|
85
|
+
.returns(T::Array[Github::AbstractIssue])
|
|
86
86
|
}
|
|
87
87
|
def issues(assignee: nil, milestone: nil)
|
|
88
|
-
|
|
88
|
+
Github::Issue.list(api_interface, assignee:, milestone:)
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
sig {
|
|
92
92
|
params(
|
|
93
93
|
title: String
|
|
94
94
|
)
|
|
95
|
-
.returns(
|
|
95
|
+
.returns(Github::Milestone)
|
|
96
96
|
}
|
|
97
97
|
def create_milestone(title)
|
|
98
|
-
|
|
98
|
+
Github::Milestone.create(title, api_interface)
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
sig { returns(T
|
|
101
|
+
sig { returns(T::Array[Github::Milestone]) }
|
|
102
102
|
def milestones
|
|
103
|
-
|
|
103
|
+
Github::Milestone.list(api_interface)
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
sig { params(number: Integer).void }
|
|
107
107
|
def close_milestone(number)
|
|
108
|
-
|
|
108
|
+
Github::Milestone.close(number, api_interface)
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
sig {
|
|
@@ -116,39 +116,42 @@ module Geet
|
|
|
116
116
|
base: String, # target branch
|
|
117
117
|
draft: T::Boolean
|
|
118
118
|
)
|
|
119
|
-
.returns(
|
|
119
|
+
.returns(Github::PR)
|
|
120
120
|
}
|
|
121
121
|
def create_pr(title, description, head, base, draft)
|
|
122
122
|
confirm(LOCAL_ACTION_ON_UPSTREAM_REPOSITORY_MESSAGE) if local_action_on_upstream_repository? && @warnings
|
|
123
123
|
confirm(ACTION_ON_PROTECTED_REPOSITORY_MESSAGE) if action_on_protected_repository? && @warnings
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
Github::PR.create(title, description, head, api_interface, base, draft: draft)
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
sig {
|
|
129
129
|
params(
|
|
130
130
|
owner: T.nilable(String), # filter by repository owner
|
|
131
131
|
head: T.nilable(String), # filter by source branch
|
|
132
|
-
milestone: T.nilable(
|
|
132
|
+
milestone: T.nilable(Github::Milestone)
|
|
133
133
|
)
|
|
134
|
-
.returns(T
|
|
134
|
+
.returns(T::Array[Github::PR])
|
|
135
135
|
}
|
|
136
136
|
def prs(owner: nil, head: nil, milestone: nil)
|
|
137
|
-
|
|
137
|
+
Github::PR.list(api_interface, owner:, head:, milestone:)
|
|
138
138
|
end
|
|
139
139
|
|
|
140
|
-
# Returns the
|
|
140
|
+
# Returns the parent repository path, or nil if this is not a fork.
|
|
141
141
|
#
|
|
142
|
-
sig { returns(
|
|
143
|
-
def
|
|
144
|
-
|
|
142
|
+
sig { returns(T.nilable(String)) }
|
|
143
|
+
def parent_path
|
|
144
|
+
api_path = "/repos/#{api_interface.repository_path}"
|
|
145
|
+
response = T.cast(api_interface.send_request(api_path), T::Hash[String, T.untyped])
|
|
146
|
+
parent_hash = T.cast(response["parent"], T.nilable(T::Hash[String, T.untyped]))
|
|
147
|
+
T.cast(parent_hash&.fetch("full_name"), T.nilable(String))
|
|
145
148
|
end
|
|
146
149
|
|
|
147
150
|
# REMOTE FUNCTIONALITIES (ACCOUNT)
|
|
148
151
|
|
|
149
152
|
sig { returns(Github::User) }
|
|
150
153
|
def authenticated_user
|
|
151
|
-
|
|
154
|
+
Github::User.authenticated(api_interface)
|
|
152
155
|
end
|
|
153
156
|
|
|
154
157
|
# OTHER/CONVENIENCE FUNCTIONALITIES
|
|
@@ -169,41 +172,6 @@ module Geet
|
|
|
169
172
|
|
|
170
173
|
private
|
|
171
174
|
|
|
172
|
-
# PROVIDER
|
|
173
|
-
|
|
174
|
-
sig { returns(String) }
|
|
175
|
-
def extract_env_api_token
|
|
176
|
-
env_variable_name = "#{provider_name.upcase}_API_TOKEN"
|
|
177
|
-
|
|
178
|
-
ENV[env_variable_name] || raise("#{env_variable_name} not set!")
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
# Attempt to find the provider class and send the specified method, returning a friendly
|
|
182
|
-
# error (functionality X [Y] is missing) when a class/method is missing.
|
|
183
|
-
sig { params(class_name: Symbol, meth: Symbol, args: T.untyped).returns(T.untyped) }
|
|
184
|
-
def attempt_provider_call(class_name, meth, *args)
|
|
185
|
-
module_name = provider_name.capitalize
|
|
186
|
-
|
|
187
|
-
full_class_name = "Geet::#{module_name}::#{class_name}"
|
|
188
|
-
|
|
189
|
-
# Use const_get directly to trigger Zeitwerk autoloading
|
|
190
|
-
begin
|
|
191
|
-
klass = Object.const_get(full_class_name)
|
|
192
|
-
rescue NameError
|
|
193
|
-
raise "The class referenced (#{full_class_name}) is not currently supported!"
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
if !klass.respond_to?(meth)
|
|
197
|
-
raise "The functionality invoked (#{class_name}.#{meth}) is not currently supported!"
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
# Can't use ruby2_keywords, because the method definitions use named keyword arguments.
|
|
201
|
-
#
|
|
202
|
-
kwargs = args.last.is_a?(Hash) ? args.pop : {}
|
|
203
|
-
|
|
204
|
-
klass.send(meth, *args, **kwargs)
|
|
205
|
-
end
|
|
206
|
-
|
|
207
175
|
# WARNINGS
|
|
208
176
|
|
|
209
177
|
sig { params(message: String).void }
|
|
@@ -226,17 +194,15 @@ module Geet
|
|
|
226
194
|
|
|
227
195
|
# OTHER HELPERS
|
|
228
196
|
|
|
229
|
-
sig { returns(
|
|
197
|
+
sig { returns(Github::ApiInterface) }
|
|
230
198
|
def api_interface
|
|
231
|
-
|
|
232
|
-
|
|
199
|
+
@api_interface = T.let(@api_interface, T.nilable(Github::ApiInterface))
|
|
200
|
+
@api_interface ||= Github::ApiInterface.new(@api_token, repo_path: @git_client.path(upstream: @upstream), upstream: @upstream)
|
|
233
201
|
end
|
|
234
202
|
|
|
235
|
-
# Bare downcase provider name, eg. `github`
|
|
236
|
-
#
|
|
237
203
|
sig { returns(String) }
|
|
238
|
-
def
|
|
239
|
-
|
|
204
|
+
def extract_env_api_token
|
|
205
|
+
ENV["GITHUB_API_TOKEN"] || raise("GITHUB_API_TOKEN not set!")
|
|
240
206
|
end
|
|
241
207
|
end
|
|
242
208
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: strict
|
|
3
3
|
|
|
4
|
+
require "stringio"
|
|
5
|
+
|
|
4
6
|
module Geet
|
|
5
7
|
module Services
|
|
6
8
|
# Add the upstream repository to the current repository (configuration).
|
|
@@ -21,7 +23,7 @@ module Geet
|
|
|
21
23
|
def execute
|
|
22
24
|
raise "Upstream remote already existing!" if @git_client.remote_defined?(Utils::GitClient::UPSTREAM_NAME)
|
|
23
25
|
|
|
24
|
-
parent_path = @repository.
|
|
26
|
+
parent_path = @repository.parent_path
|
|
25
27
|
|
|
26
28
|
if parent_path
|
|
27
29
|
parent_url = compose_parent_url(parent_path)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: strict
|
|
3
3
|
|
|
4
|
+
require "stringio"
|
|
5
|
+
|
|
4
6
|
module Geet
|
|
5
7
|
module Services
|
|
6
8
|
class CloseMilestones
|
|
@@ -31,7 +33,7 @@ module Geet
|
|
|
31
33
|
|
|
32
34
|
selection_manager.add_attribute(:milestones, "milestone", numbers, SELECTION_MULTIPLE, name_method: :title)
|
|
33
35
|
|
|
34
|
-
milestones = T.cast(selection_manager.select_attributes[0], T::Array[
|
|
36
|
+
milestones = T.cast(selection_manager.select_attributes[0], T::Array[Github::Milestone])
|
|
35
37
|
|
|
36
38
|
milestones.map(&:number)
|
|
37
39
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: strict
|
|
3
3
|
|
|
4
|
+
require "stringio"
|
|
5
|
+
|
|
4
6
|
module Geet
|
|
5
7
|
module Services
|
|
6
8
|
# Add a comment to the PR for the current branch.
|
|
@@ -25,7 +27,7 @@ module Geet
|
|
|
25
27
|
comment: String,
|
|
26
28
|
open_browser: T::Boolean
|
|
27
29
|
)
|
|
28
|
-
.returns(
|
|
30
|
+
.returns(Github::PR)
|
|
29
31
|
}
|
|
30
32
|
def execute(comment, open_browser: false)
|
|
31
33
|
pr = checked_find_branch_pr
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: strict
|
|
3
3
|
|
|
4
|
+
require "stringio"
|
|
5
|
+
|
|
4
6
|
module Geet
|
|
5
7
|
module Services
|
|
6
|
-
class CreateIssue
|
|
8
|
+
class CreateIssue
|
|
7
9
|
extend T::Sig
|
|
8
10
|
|
|
11
|
+
include Geet::Helpers::OsHelper
|
|
9
12
|
include Geet::Shared::RepoPermissions
|
|
10
13
|
include Geet::Shared::Selection
|
|
11
14
|
|
|
15
|
+
sig { params(repository: Git::Repository, out: T.any(IO, StringIO)).void }
|
|
16
|
+
def initialize(repository, out: $stdout)
|
|
17
|
+
@repository = repository
|
|
18
|
+
@out = out
|
|
19
|
+
end
|
|
20
|
+
|
|
12
21
|
sig {
|
|
13
22
|
params(
|
|
14
23
|
title: String,
|
|
@@ -17,7 +26,7 @@ module Geet
|
|
|
17
26
|
milestone: T.nilable(String), # Number or description pattern
|
|
18
27
|
assignees: T.nilable(String),
|
|
19
28
|
open_browser: T::Boolean
|
|
20
|
-
).returns(
|
|
29
|
+
).returns(Github::Issue)
|
|
21
30
|
}
|
|
22
31
|
def execute(
|
|
23
32
|
title, description,
|
|
@@ -60,9 +69,9 @@ module Geet
|
|
|
60
69
|
milestone: T.nilable(String),
|
|
61
70
|
assignees: T.nilable(String)
|
|
62
71
|
).returns([
|
|
63
|
-
T.nilable(T::Array[
|
|
64
|
-
T.nilable(
|
|
65
|
-
T.nilable(T::Array[
|
|
72
|
+
T.nilable(T::Array[Github::Label]),
|
|
73
|
+
T.nilable(Github::Milestone),
|
|
74
|
+
T.nilable(T::Array[Github::User]),
|
|
66
75
|
])
|
|
67
76
|
}
|
|
68
77
|
def find_and_select_attributes(labels, milestone, assignees)
|
|
@@ -74,9 +83,9 @@ module Geet
|
|
|
74
83
|
|
|
75
84
|
selected_attributes = selection_manager.select_attributes
|
|
76
85
|
|
|
77
|
-
selected_labels = T.cast(selected_attributes.shift, T.nilable(T::Array[
|
|
78
|
-
selected_milestone = T.cast(selected_attributes.shift, T.nilable(
|
|
79
|
-
selected_assignees = T.cast(selected_attributes.shift, T.nilable(T::Array[
|
|
86
|
+
selected_labels = T.cast(selected_attributes.shift, T.nilable(T::Array[Github::Label])) if labels
|
|
87
|
+
selected_milestone = T.cast(selected_attributes.shift, T.nilable(Github::Milestone)) if milestone
|
|
88
|
+
selected_assignees = T.cast(selected_attributes.shift, T.nilable(T::Array[Github::User])) if assignees
|
|
80
89
|
|
|
81
90
|
[selected_labels, selected_milestone, selected_assignees]
|
|
82
91
|
end
|
|
@@ -85,7 +94,7 @@ module Geet
|
|
|
85
94
|
params(
|
|
86
95
|
title: String,
|
|
87
96
|
description: String
|
|
88
|
-
).returns(
|
|
97
|
+
).returns(Github::Issue)
|
|
89
98
|
}
|
|
90
99
|
def create_issue(title, description)
|
|
91
100
|
@out.puts "Creating the issue..."
|
|
@@ -95,10 +104,10 @@ module Geet
|
|
|
95
104
|
|
|
96
105
|
sig {
|
|
97
106
|
params(
|
|
98
|
-
issue:
|
|
99
|
-
labels: T.nilable(T::Array[
|
|
100
|
-
milestone: T.nilable(
|
|
101
|
-
assignees: T.nilable(T::Array[
|
|
107
|
+
issue: Github::Issue,
|
|
108
|
+
labels: T.nilable(T::Array[Github::Label]),
|
|
109
|
+
milestone: T.nilable(Github::Milestone),
|
|
110
|
+
assignees: T.nilable(T::Array[Github::User])
|
|
102
111
|
).void
|
|
103
112
|
}
|
|
104
113
|
def edit_issue(issue, labels, milestone, assignees)
|
|
@@ -121,13 +130,11 @@ module Geet
|
|
|
121
130
|
|
|
122
131
|
sig {
|
|
123
132
|
params(
|
|
124
|
-
issue:
|
|
125
|
-
selected_labels: T::Array[
|
|
133
|
+
issue: Github::Issue,
|
|
134
|
+
selected_labels: T::Array[Github::Label]
|
|
126
135
|
).returns(Thread)
|
|
127
136
|
}
|
|
128
137
|
def add_labels(issue, selected_labels)
|
|
129
|
-
raise "Functionality unsupported on GitLab!" if issue.is_a?(Gitlab::Issue)
|
|
130
|
-
|
|
131
138
|
labels_list = selected_labels.map(&:name).join(", ")
|
|
132
139
|
|
|
133
140
|
@out.puts "Adding labels #{labels_list}..."
|
|
@@ -139,13 +146,11 @@ module Geet
|
|
|
139
146
|
|
|
140
147
|
sig {
|
|
141
148
|
params(
|
|
142
|
-
issue:
|
|
143
|
-
milestone:
|
|
149
|
+
issue: Github::Issue,
|
|
150
|
+
milestone: Github::Milestone
|
|
144
151
|
).returns(Thread)
|
|
145
152
|
}
|
|
146
153
|
def set_milestone(issue, milestone)
|
|
147
|
-
raise "Functionality unsupported on GitLab!" if issue.is_a?(Gitlab::Issue)
|
|
148
|
-
|
|
149
154
|
@out.puts "Setting milestone #{milestone.title}..."
|
|
150
155
|
|
|
151
156
|
Thread.new do
|
|
@@ -155,13 +160,11 @@ module Geet
|
|
|
155
160
|
|
|
156
161
|
sig {
|
|
157
162
|
params(
|
|
158
|
-
issue:
|
|
159
|
-
users: T::Array[
|
|
163
|
+
issue: Github::Issue,
|
|
164
|
+
users: T::Array[Github::User]
|
|
160
165
|
).returns(Thread)
|
|
161
166
|
}
|
|
162
167
|
def assign_users(issue, users)
|
|
163
|
-
raise "Functionality unsupported on GitLab!" if issue.is_a?(Gitlab::Issue)
|
|
164
|
-
|
|
165
168
|
usernames = users.map(&:username)
|
|
166
169
|
|
|
167
170
|
@out.puts "Assigning users #{usernames.join(', ')}..."
|
|
@@ -173,12 +176,10 @@ module Geet
|
|
|
173
176
|
|
|
174
177
|
sig {
|
|
175
178
|
params(
|
|
176
|
-
issue:
|
|
179
|
+
issue: Github::Issue
|
|
177
180
|
).returns(Thread)
|
|
178
181
|
}
|
|
179
182
|
def assign_authenticated_user(issue)
|
|
180
|
-
raise "Functionality unsupported on GitLab!" if issue.is_a?(Gitlab::Issue)
|
|
181
|
-
|
|
182
183
|
@out.puts "Assigning authenticated user..."
|
|
183
184
|
|
|
184
185
|
Thread.new do
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: strict
|
|
3
3
|
|
|
4
|
+
require "stringio"
|
|
5
|
+
|
|
4
6
|
module Geet
|
|
5
7
|
module Services
|
|
6
8
|
class CreateLabel
|
|
@@ -17,7 +19,7 @@ module Geet
|
|
|
17
19
|
name: String,
|
|
18
20
|
color: String
|
|
19
21
|
)
|
|
20
|
-
.returns(
|
|
22
|
+
.returns(Github::Label)
|
|
21
23
|
}
|
|
22
24
|
def execute(name, color: generate_random_color)
|
|
23
25
|
label = create_label(name, color)
|
|
@@ -34,7 +36,7 @@ module Geet
|
|
|
34
36
|
name: String,
|
|
35
37
|
color: String
|
|
36
38
|
)
|
|
37
|
-
.returns(
|
|
39
|
+
.returns(Github::Label)
|
|
38
40
|
}
|
|
39
41
|
def create_label(name, color)
|
|
40
42
|
@out.puts "Creating label..."
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: strict
|
|
3
3
|
|
|
4
|
+
require "stringio"
|
|
5
|
+
|
|
4
6
|
module Geet
|
|
5
7
|
module Services
|
|
6
8
|
class CreateMilestone
|
|
@@ -12,14 +14,14 @@ module Geet
|
|
|
12
14
|
@out = out
|
|
13
15
|
end
|
|
14
16
|
|
|
15
|
-
sig { params(title: String).returns(
|
|
17
|
+
sig { params(title: String).returns(Github::Milestone) }
|
|
16
18
|
def execute(title)
|
|
17
19
|
create_milestone(title)
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
private
|
|
21
23
|
|
|
22
|
-
sig { params(title: String).returns(
|
|
24
|
+
sig { params(title: String).returns(Github::Milestone) }
|
|
23
25
|
def create_milestone(title)
|
|
24
26
|
@out.puts "Creating milestone..."
|
|
25
27
|
|