geet 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/geet.gemspec +1 -1
- data/lib/geet/services/create_pr.rb +0 -11
- data/lib/geet/version.rb +1 -1
- data/spec/integration/create_pr_spec.rb +26 -25
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4f8d85a0f499afb70bb5a01c5e22664f70fbbc942a42109006bd725a314c8b7
|
4
|
+
data.tar.gz: 8b56dc95ce11072b21f4154b39dad49680fcd4f0601dd44bd4e407b7811b9df7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a6126ddc595b50dc9391c547533149d5c67496c1046f61e3173022c5ac143d71e51a0a4ca3c78344917cd2eab6549ca9d080c9d09258ab4c57092cd10db806a
|
7
|
+
data.tar.gz: 3a374c0aca85a391457e519caa0be56cc25ab2322f98ed81250792d4ea817865d72b57cc10ef45d09d699f54d1e55231e2ae4677cacc681d4ec8fc255835f9d2
|
data/geet.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
11
|
s.required_ruby_version = '>= 2.3.0'
|
12
12
|
s.authors = ['Saverio Miroddi']
|
13
|
-
s.date = '2022-07
|
13
|
+
s.date = '2022-08-07'
|
14
14
|
s.email = ['saverio.pub2@gmail.com']
|
15
15
|
s.homepage = 'https://github.com/saveriomiroddi/geet'
|
16
16
|
s.summary = 'Commandline interface for performing SCM host operations, eg. create a PR on GitHub'
|
@@ -136,28 +136,17 @@ module Geet
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def edit_pr(pr, labels, milestone, reviewers)
|
139
|
-
assign_user_thread = assign_authenticated_user(pr)
|
140
|
-
|
141
139
|
# labels/reviewers can be nil (parameter not passed) or empty array (parameter passed, but
|
142
140
|
# nothing selected)
|
143
141
|
add_labels_thread = add_labels(pr, labels) if labels && !labels.empty?
|
144
142
|
set_milestone_thread = set_milestone(pr, milestone) if milestone
|
145
143
|
request_review_thread = request_review(pr, reviewers) if reviewers && !reviewers.empty?
|
146
144
|
|
147
|
-
assign_user_thread.join
|
148
145
|
add_labels_thread&.join
|
149
146
|
set_milestone_thread&.join
|
150
147
|
request_review_thread&.join
|
151
148
|
end
|
152
149
|
|
153
|
-
def assign_authenticated_user(pr)
|
154
|
-
@out.puts 'Assigning authenticated user...'
|
155
|
-
|
156
|
-
Thread.new do
|
157
|
-
pr.assign_users(@repository.authenticated_user.username)
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
150
|
def add_labels(pr, selected_labels)
|
162
151
|
labels_list = selected_labels.map(&:name).join(', ')
|
163
152
|
|
data/lib/geet/version.rb
CHANGED
@@ -158,31 +158,32 @@ describe Geet::Services::CreatePr do
|
|
158
158
|
# expect(actual_output.string).to eql(expected_output)
|
159
159
|
# end
|
160
160
|
|
161
|
-
it "should create a remote branch, when there isn't one (is not tracked)"
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
161
|
+
it "should create a remote branch, when there isn't one (is not tracked)"
|
162
|
+
# do
|
163
|
+
# allow(git_client).to receive(:working_tree_clean?).and_return(true)
|
164
|
+
# allow(git_client).to receive(:current_branch).and_return('mybranch')
|
165
|
+
# allow(git_client).to receive(:main_branch).and_return('master')
|
166
|
+
# expect(git_client).to receive(:remote_branch).and_return(nil)
|
167
|
+
# expect(git_client).to receive(:push).with(remote_branch: 'mybranch')
|
168
|
+
#
|
169
|
+
# allow(git_client).to receive(:remote).with(no_args).and_return('git@github.com:donaldduck/testrepo_f')
|
170
|
+
#
|
171
|
+
# expected_output = <<~STR
|
172
|
+
# Creating remote branch "mybranch"...
|
173
|
+
# Creating PR...
|
174
|
+
# Assigning authenticated user...
|
175
|
+
# PR address: https://github.com/donaldduck/testrepo_f/pull/4
|
176
|
+
# STR
|
177
|
+
#
|
178
|
+
# actual_output = StringIO.new
|
179
|
+
#
|
180
|
+
# actual_created_pr = VCR.use_cassette('github_com/create_pr_in_auto_mode_create_upstream') do
|
181
|
+
# service_instance = described_class.new(repository, out: actual_output, git_client: git_client)
|
182
|
+
# service_instance.execute('Title', 'Description', output: actual_output, automated_mode: true, no_open_pr: true)
|
183
|
+
# end
|
184
|
+
#
|
185
|
+
# expect(actual_output.string).to eql(expected_output)
|
186
|
+
# end
|
186
187
|
end
|
187
188
|
end # context 'with github.com'
|
188
189
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saverio Miroddi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07
|
11
|
+
date: 2022-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_scripting
|