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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +0 -1
  3. data/README.md +8 -17
  4. data/geet.gemspec +1 -1
  5. data/lib/geet/git/repository.rb +36 -70
  6. data/lib/geet/helpers/services_workflow_helper.rb +1 -1
  7. data/lib/geet/services/add_upstream_repo.rb +3 -1
  8. data/lib/geet/services/close_milestones.rb +3 -1
  9. data/lib/geet/services/comment_pr.rb +3 -1
  10. data/lib/geet/services/create_gist.rb +2 -0
  11. data/lib/geet/services/create_issue.rb +29 -28
  12. data/lib/geet/services/create_label.rb +4 -2
  13. data/lib/geet/services/create_milestone.rb +4 -2
  14. data/lib/geet/services/create_pr.rb +21 -27
  15. data/lib/geet/services/list_issues.rb +5 -3
  16. data/lib/geet/services/list_labels.rb +3 -1
  17. data/lib/geet/services/list_milestones.rb +9 -7
  18. data/lib/geet/services/list_prs.rb +3 -1
  19. data/lib/geet/services/merge_pr.rb +4 -2
  20. data/lib/geet/services/open_pr.rb +1 -1
  21. data/lib/geet/utils/attributes_selection_manager.rb +2 -0
  22. data/lib/geet/utils/git_client.rb +0 -11
  23. data/lib/geet/version.rb +1 -1
  24. data/spec/integration/create_label_spec.rb +0 -21
  25. data/spec/integration/create_pr_spec.rb +0 -1
  26. data/spec/integration/list_issues_spec.rb +0 -46
  27. data/spec/integration/list_labels_spec.rb +0 -27
  28. data/spec/integration/list_milestones_spec.rb +0 -27
  29. data/spec/integration/merge_pr_spec.rb +0 -30
  30. data/spec/spec_helper.rb +0 -3
  31. metadata +2 -16
  32. data/lib/geet/github/remote_repository.rb +0 -53
  33. data/lib/geet/gitlab/api_interface.rb +0 -212
  34. data/lib/geet/gitlab/issue.rb +0 -62
  35. data/lib/geet/gitlab/label.rb +0 -66
  36. data/lib/geet/gitlab/milestone.rb +0 -78
  37. data/lib/geet/gitlab/pr.rb +0 -114
  38. data/lib/geet/gitlab/user.rb +0 -52
  39. data/lib/geet/services/abstract_create_issue.rb +0 -21
  40. data/spec/vcr_cassettes/gitlab_com/create_label.yml +0 -64
  41. data/spec/vcr_cassettes/gitlab_com/list_issues.yml +0 -84
  42. data/spec/vcr_cassettes/gitlab_com/list_issues_with_assignee.yml +0 -162
  43. data/spec/vcr_cassettes/gitlab_com/list_labels.yml +0 -80
  44. data/spec/vcr_cassettes/gitlab_com/list_milestones.yml +0 -397
  45. 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: 56d8605066d017d02b54dceb6f2fb7cc84c2e34c253f6577006fee0691481d1b
4
- data.tar.gz: 5eefc3385768406184ae9245f522302a1e9c64566f664a7f4a729814ae86fdaa
3
+ metadata.gz: 6aa24d63c1117666e8647bdd0569d359f8b6cb9c380134522de39cefa9dc6fae
4
+ data.tar.gz: 9067ba5d4a8eb41f4f9871c5923c62b818bfb16089a05c1c0c2b4b10cab62954
5
5
  SHA512:
6
- metadata.gz: 56fb31c44c9c8c9be8fa9f608c21c1b2db6cf7f1ac365adda08b3b3a0290bb3fc8640f4b6dc7e37933cca2e29b04ab724ee8740e017b9a838a289498f0b742cf
7
- data.tar.gz: ec404c7c7431db88112240b77acce533ee2ec7e28378d6ff3951e12c73b9ec67fe8a1a14035ef05fe044e307d34ed03488e6f9d190acd4f52b7bb54071677e68
6
+ metadata.gz: ecf5a66024e83c6d6bd8470c8deeeb7529092757f9386a234a1e3b482236f1bc51687725fe58408b9ccf2b4a668d991d215cf462492c8517a0681e7248e8878d
7
+ data.tar.gz: 0c5dc68513f260dfb195e072d928f8be4696a7f5fe986005c92865209a7617784ef7c578e020c2306e2c415a6b1a512d0cf3953c92ea00163e71b9557afa6187
@@ -8,7 +8,6 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
  env:
10
10
  GITHUB_API_TOKEN: foo
11
- GITLAB_API_TOKEN: bar
12
11
  strategy:
13
12
  matrix:
14
13
  ruby-version: [head, 4.0, 3.4, 3.3, 3.2]
data/README.md CHANGED
@@ -2,28 +2,20 @@
2
2
 
3
3
  # Geet
4
4
 
5
- Command line interface for performing Git hosting service operations.
5
+ Command line interface for performing GitHub operations.
6
6
 
7
- This tool is a provider-independent version of [Hub](https://github.com/github/hub) and [Lab](https://github.com/zaquestion/lab).
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
- ## Operation/providers support
16
-
17
- The functionalities currently supported are:
13
+ ## Supported operations
18
14
 
19
- - Github/Gitlab:
20
- - create label
21
- - list issues, labels, milestones, MR/PRs
22
- - merge MR/PR
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 # for GitHub
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-20"
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"
@@ -37,14 +37,14 @@ module Geet
37
37
 
38
38
  # REMOTE FUNCTIONALITIES (REPOSITORY)
39
39
 
40
- sig { returns(T.any(T::Array[Github::User], T::Array[Gitlab::User])) }
40
+ sig { returns(T::Array[Github::User]) }
41
41
  def collaborators
42
- attempt_provider_call(:User, :list_collaborators, api_interface)
42
+ Github::User.list_collaborators(api_interface)
43
43
  end
44
44
 
45
- sig { returns(T.any(T::Array[Github::Label], T::Array[Gitlab::Label])) }
45
+ sig { returns(T::Array[Github::Label]) }
46
46
  def labels
47
- attempt_provider_call(:Label, :list, api_interface)
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(T.any(Github::Issue, Gitlab::Issue))
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
- attempt_provider_call(:Issue, :create, title, description, api_interface)
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(T.any(Github::Label, Gitlab::Label))
69
+ .returns(Github::Label)
70
70
  }
71
71
  def create_label(name, color)
72
- attempt_provider_call(:Label, :create, name, color, api_interface)
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
- attempt_provider_call(:Branch, :delete, name, api_interface)
77
+ Github::Branch.delete(name, api_interface)
78
78
  end
79
79
 
80
80
  sig {
81
81
  params(
82
- assignee: T.nilable(T.any(Github::User, Gitlab::User)),
83
- milestone: T.nilable(T.any(Github::Milestone, Gitlab::Milestone))
82
+ assignee: T.nilable(Github::User),
83
+ milestone: T.nilable(Github::Milestone)
84
84
  )
85
- .returns(T.any(T::Array[Github::AbstractIssue], T::Array[Gitlab::Issue]))
85
+ .returns(T::Array[Github::AbstractIssue])
86
86
  }
87
87
  def issues(assignee: nil, milestone: nil)
88
- attempt_provider_call(:Issue, :list, api_interface, assignee:, milestone:)
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(T.any(Github::Milestone, Gitlab::Milestone))
95
+ .returns(Github::Milestone)
96
96
  }
97
97
  def create_milestone(title)
98
- attempt_provider_call(:Milestone, :create, title, api_interface)
98
+ Github::Milestone.create(title, api_interface)
99
99
  end
100
100
 
101
- sig { returns(T.any(T::Array[Github::Milestone], T::Array[Gitlab::Milestone])) }
101
+ sig { returns(T::Array[Github::Milestone]) }
102
102
  def milestones
103
- attempt_provider_call(:Milestone, :list, api_interface)
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
- attempt_provider_call(:Milestone, :close, number, api_interface)
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(T.any(Github::PR, Gitlab::PR))
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
- attempt_provider_call(:PR, :create, title, description, head, api_interface, base, draft: draft)
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(T.any(Github::Milestone, Gitlab::Milestone))
132
+ milestone: T.nilable(Github::Milestone)
133
133
  )
134
- .returns(T.any(T::Array[Github::PR], T::Array[Gitlab::PR]))
134
+ .returns(T::Array[Github::PR])
135
135
  }
136
136
  def prs(owner: nil, head: nil, milestone: nil)
137
- attempt_provider_call(:PR, :list, api_interface, owner:, head:, milestone:)
137
+ Github::PR.list(api_interface, owner:, head:, milestone:)
138
138
  end
139
139
 
140
- # Returns the RemoteRepository instance.
140
+ # Returns the parent repository path, or nil if this is not a fork.
141
141
  #
142
- sig { returns(Github::RemoteRepository) }
143
- def remote
144
- attempt_provider_call(:RemoteRepository, :find, api_interface)
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
- attempt_provider_call(:User, :authenticated, api_interface)
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(T.any(Github::ApiInterface, Gitlab::ApiInterface)) }
197
+ sig { returns(Github::ApiInterface) }
230
198
  def api_interface
231
- path = @git_client.path(upstream: @upstream)
232
- attempt_provider_call(:ApiInterface, :new, @api_token, repo_path: path, upstream: @upstream)
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 provider_name
239
- T.must(@git_client.provider_domain[/(.*)\.\w+/, 1])
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
@@ -24,7 +24,7 @@ module Geet
24
24
  #
25
25
  # Requires: @out, @repository.
26
26
  #
27
- sig { returns(T.any(Geet::Github::PR, Geet::Gitlab::PR)) }
27
+ sig { returns(Github::PR) }
28
28
  def checked_find_branch_pr
29
29
  owner = if @repository.upstream?
30
30
  @repository.authenticated_user.username
@@ -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.remote.parent_path
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[T.any(Github::Milestone, Gitlab::Milestone)])
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(T.any(Github::PR, Gitlab::PR))
30
+ .returns(Github::PR)
29
31
  }
30
32
  def execute(comment, open_browser: false)
31
33
  pr = checked_find_branch_pr
@@ -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 CreateGist
@@ -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 < AbstractCreateIssue
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(T.any(Github::Issue, Gitlab::Issue))
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[T.any(Github::Label, Gitlab::Label)]),
64
- T.nilable(T.any(Github::Milestone, Gitlab::Milestone)),
65
- T.nilable(T::Array[T.any(Github::User, Gitlab::User)]),
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[T.any(Github::Label, Gitlab::Label)])) if labels
78
- selected_milestone = T.cast(selected_attributes.shift, T.nilable(T.any(Github::Milestone, Gitlab::Milestone))) if milestone
79
- selected_assignees = T.cast(selected_attributes.shift, T.nilable(T::Array[T.any(Github::User, Gitlab::User)])) if assignees
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(T.any(Github::Issue, Gitlab::Issue))
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: T.any(Github::Issue, Gitlab::Issue),
99
- labels: T.nilable(T::Array[T.any(Github::Label, Gitlab::Label)]),
100
- milestone: T.nilable(T.any(Github::Milestone, Gitlab::Milestone)),
101
- assignees: T.nilable(T::Array[T.any(Github::User, Gitlab::User)])
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: T.any(Github::Issue, Gitlab::Issue),
125
- selected_labels: T::Array[T.any(Github::Label, Gitlab::Label)]
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: T.any(Github::Issue, Gitlab::Issue),
143
- milestone: T.any(Github::Milestone, Gitlab::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: T.any(Github::Issue, Gitlab::Issue),
159
- users: T::Array[T.any(Github::User, Gitlab::User)]
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: T.any(Github::Issue, Gitlab::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(T.any(Github::Label, Gitlab::Label))
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(T.any(Github::Label, Gitlab::Label))
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(T.any(Github::Milestone, Gitlab::Milestone)) }
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(T.any(Github::Milestone, Gitlab::Milestone)) }
24
+ sig { params(title: String).returns(Github::Milestone) }
23
25
  def create_milestone(title)
24
26
  @out.puts "Creating milestone..."
25
27