geet 0.9.0 → 0.10.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/commandline/configuration.rb +3 -4
- data/lib/geet/services/create_pr.rb +3 -3
- data/lib/geet/version.rb +1 -1
- data/spec/integration/create_pr_spec.rb +35 -34
- 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: 7ba90d01dc763b385e656d16240041211d032525e9049f4e3771a4af6c4d4e98
|
4
|
+
data.tar.gz: cfe4cfe252cdd952b2df78d9e34163623f53eb1a0ca365c7a9fde373d7008535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beaed59c8488b6034935b03961a89699c2818075fda8a0bf8eccac349bc3b695cf036b0f1c393f8d11c3c13f8d86dd8ffd817fcb101e2cce0ac01d396f7ecfd1
|
7
|
+
data.tar.gz: f7af3b4e631dfef62b00fe27f9293a5dfdc37c6dd5ae379065a27532325908b83521bf3215f80d43bb773f53fc175ad4798555cb3297c7cbd3a73f414aebb35d
|
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-
|
13
|
+
s.date = '2022-07-03'
|
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'
|
@@ -65,7 +65,6 @@ module Geet
|
|
65
65
|
]
|
66
66
|
|
67
67
|
PR_CREATE_OPTIONS = [
|
68
|
-
['-A', '--automated-mode', "Automate the branch operations (see long help)"],
|
69
68
|
['-n', '--no-open-pr', "Don't open the PR link in the browser after creation"],
|
70
69
|
['-b', '--base develop', "Specify the base branch; defaults to the main branch"],
|
71
70
|
['-d', '--draft', "Create as draft"],
|
@@ -77,9 +76,9 @@ module Geet
|
|
77
76
|
long_help: <<~STR
|
78
77
|
The default editor will be opened for editing title and description; if the PR adds one commit only, the content will be prepopulated with the commit description.
|
79
78
|
|
80
|
-
The
|
81
|
-
|
82
|
-
|
79
|
+
The operation is aborted if the current tree is dirty.
|
80
|
+
|
81
|
+
Before creating the PR, the local branch is pushed; if the remote branch is not present, it is created.
|
83
82
|
STR
|
84
83
|
]
|
85
84
|
|
@@ -28,9 +28,9 @@ module Geet
|
|
28
28
|
#
|
29
29
|
def execute(
|
30
30
|
title, description, labels: nil, milestone: nil, reviewers: nil,
|
31
|
-
base: nil, draft: false, no_open_pr: nil,
|
31
|
+
base: nil, draft: false, no_open_pr: nil, **
|
32
32
|
)
|
33
|
-
ensure_clean_tree
|
33
|
+
ensure_clean_tree
|
34
34
|
|
35
35
|
if @repository.upstream? && !@git_client.remote_defined?(Utils::GitClient::UPSTREAM_NAME)
|
36
36
|
@out.puts "Upstream not found; adding it to the repository remotes..."
|
@@ -46,7 +46,7 @@ module Geet
|
|
46
46
|
selected_labels, selected_milestone, selected_reviewers = find_and_select_attributes(labels, milestone, reviewers)
|
47
47
|
end
|
48
48
|
|
49
|
-
sync_with_remote_branch
|
49
|
+
sync_with_remote_branch
|
50
50
|
|
51
51
|
pr = create_pr(title, description, base: base, draft: draft)
|
52
52
|
|
data/lib/geet/version.rb
CHANGED
@@ -12,40 +12,41 @@ describe Geet::Services::CreatePr do
|
|
12
12
|
|
13
13
|
context 'with github.com' do
|
14
14
|
context 'with labels, reviewers and milestones' do
|
15
|
-
it 'should create a PR'
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
15
|
+
it 'should create a PR'
|
16
|
+
# do
|
17
|
+
# allow(git_client).to receive(:current_branch).and_return('mybranch')
|
18
|
+
# allow(git_client).to receive(:main_branch).and_return('master')
|
19
|
+
# allow(git_client).to receive(:remote).with(no_args).and_return('git@github.com:donaldduck/testrepo_f')
|
20
|
+
#
|
21
|
+
# expected_output = <<~STR
|
22
|
+
# Finding labels...
|
23
|
+
# Finding milestones...
|
24
|
+
# Finding collaborators...
|
25
|
+
# Creating PR...
|
26
|
+
# Assigning authenticated user...
|
27
|
+
# Adding labels bug, invalid...
|
28
|
+
# Setting milestone 0.0.1...
|
29
|
+
# Requesting review from donald-fr...
|
30
|
+
# PR address: https://github.com/donaldduck/testrepo_f/pull/1
|
31
|
+
# STR
|
32
|
+
#
|
33
|
+
# actual_output = StringIO.new
|
34
|
+
#
|
35
|
+
# actual_created_pr = VCR.use_cassette('github_com/create_pr') do
|
36
|
+
# service_instance = described_class.new(repository, out: actual_output, git_client: git_client)
|
37
|
+
# service_instance.execute(
|
38
|
+
# 'Title', 'Description',
|
39
|
+
# labels: 'bug,invalid', milestone: '0.0.1', reviewers: 'donald-fr',
|
40
|
+
# no_open_pr: true, output: actual_output
|
41
|
+
# )
|
42
|
+
# end
|
43
|
+
#
|
44
|
+
# expect(actual_output.string).to eql(expected_output)
|
45
|
+
#
|
46
|
+
# expect(actual_created_pr.number).to eql(1)
|
47
|
+
# expect(actual_created_pr.title).to eql('Title')
|
48
|
+
# expect(actual_created_pr.link).to eql('https://github.com/donaldduck/testrepo_f/pull/1')
|
49
|
+
# end
|
49
50
|
end
|
50
51
|
|
51
52
|
context 'on an upstream repository' do
|
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.10.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-
|
11
|
+
date: 2022-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_scripting
|