geet 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/geet +5 -3
- data/geet.gemspec +1 -1
- data/lib/geet/commandline/configuration.rb +1 -0
- data/lib/geet/git/repository.rb +2 -2
- data/lib/geet/github/pr.rb +3 -2
- data/lib/geet/services/create_pr.rb +4 -4
- data/lib/geet/version.rb +1 -1
- 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: 65b80e94214a854c8cf6407560d97051f4882cdd11b34f9c3031b2b288a9a2c6
|
4
|
+
data.tar.gz: b9eba4b14a9238c3ea09cb9d370ad91a6768ce8ca4d3ca5a4b7c93d29bc56bad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07c2b9f337bc0f3e3b991f4bd6e95d61f5827a2fcb00fafb265efe260ca73636e4c0fcf29ba688038ee670032cbca84a620ef65aaa4ddebb25f0cb337ba5a86e
|
7
|
+
data.tar.gz: 1f56fce624d2f9252d3b99ce9ddc0b71bf0674e8ff2e0339a219edf35fc0a4faa094c42030ff97f88798e0df724d38f72465dad2e0d7b6bd2a8d6fae4090e971
|
data/bin/geet
CHANGED
@@ -49,7 +49,7 @@ class GeetLauncher
|
|
49
49
|
when MILESTONE_LIST_COMMAND
|
50
50
|
Services::ListMilestones.new(repository).execute
|
51
51
|
when PR_CREATE_COMMAND
|
52
|
-
summary = options[:summary] || edit_pr_summary
|
52
|
+
summary = options[:summary] || edit_pr_summary(base: options[:base])
|
53
53
|
title, description = split_summary(summary)
|
54
54
|
|
55
55
|
options = default_to_manual_selection(options, :labels, :milestone, :reviewers)
|
@@ -66,11 +66,13 @@ class GeetLauncher
|
|
66
66
|
|
67
67
|
private
|
68
68
|
|
69
|
-
def edit_pr_summary
|
69
|
+
def edit_pr_summary(base: nil)
|
70
|
+
base ||= 'master'
|
71
|
+
|
70
72
|
# Tricky. It would be best to have Git logic exlusively inside the services,
|
71
73
|
# but at the same time, the summary editing should be out.
|
72
74
|
git = Utils::GitClient.new
|
73
|
-
pr_commits = git.cherry(
|
75
|
+
pr_commits = git.cherry(base)
|
74
76
|
|
75
77
|
if pr_commits.size == 1
|
76
78
|
prepopulated_summary = git.show_description('HEAD')
|
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 = '2018-04-
|
13
|
+
s.date = '2018-04-12'
|
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 (eg. GitHub) operations (eg. PR creation).'
|
@@ -52,6 +52,7 @@ module Geet
|
|
52
52
|
PR_CREATE_OPTIONS = [
|
53
53
|
['-A', '--automated-mode', "Automate the branch operations (see long help)"],
|
54
54
|
['-n', '--no-open-pr', "Don't open the PR link in the browser after creation"],
|
55
|
+
['-b', '--base develop', "Specify the base branch; defaults to `master`"],
|
55
56
|
['-l', '--labels "legacy,code review"', 'Labels'],
|
56
57
|
['-m', '--milestone 1.5.0', 'Milestone title pattern'],
|
57
58
|
['-r', '--reviewers john,tom,adrian,kevin', 'Reviewer logins'],
|
data/lib/geet/git/repository.rb
CHANGED
@@ -70,11 +70,11 @@ module Geet
|
|
70
70
|
attempt_provider_call(:Milestone, :list, api_interface)
|
71
71
|
end
|
72
72
|
|
73
|
-
def create_pr(title, description, head)
|
73
|
+
def create_pr(title, description, head, base: nil)
|
74
74
|
confirm(LOCAL_ACTION_ON_UPSTREAM_REPOSITORY_MESSAGE) if local_action_on_upstream_repository? && @warnings
|
75
75
|
confirm(ACTION_ON_PROTECTED_REPOSITORY_MESSAGE) if action_on_protected_repository? && @warnings
|
76
76
|
|
77
|
-
attempt_provider_call(:PR, :create, title, description, head, api_interface)
|
77
|
+
attempt_provider_call(:PR, :create, title, description, head, api_interface, base: base)
|
78
78
|
end
|
79
79
|
|
80
80
|
def prs(head: nil)
|
data/lib/geet/github/pr.rb
CHANGED
@@ -8,15 +8,16 @@ module Geet
|
|
8
8
|
class PR < AbstractIssue
|
9
9
|
# See https://developer.github.com/v3/pulls/#create-a-pull-request
|
10
10
|
#
|
11
|
-
def self.create(title, description, head, api_interface)
|
11
|
+
def self.create(title, description, head, api_interface, base: nil)
|
12
12
|
api_path = 'pulls'
|
13
|
+
base ||= 'master'
|
13
14
|
|
14
15
|
if api_interface.upstream?
|
15
16
|
authenticated_user = Geet::Github::User.authenticated(api_interface).username
|
16
17
|
head = "#{authenticated_user}:#{head}"
|
17
18
|
end
|
18
19
|
|
19
|
-
request_data = { title: title, body: description, head: head, base:
|
20
|
+
request_data = { title: title, body: description, head: head, base: base }
|
20
21
|
|
21
22
|
response = api_interface.send_request(api_path, data: request_data)
|
22
23
|
|
@@ -23,7 +23,7 @@ module Geet
|
|
23
23
|
#
|
24
24
|
def execute(
|
25
25
|
title, description, labels: nil, milestone: nil, reviewers: nil,
|
26
|
-
no_open_pr: nil, automated_mode: false, **
|
26
|
+
base: nil, no_open_pr: nil, automated_mode: false, **
|
27
27
|
)
|
28
28
|
ensure_clean_tree if automated_mode
|
29
29
|
|
@@ -37,7 +37,7 @@ module Geet
|
|
37
37
|
|
38
38
|
sync_with_upstream_branch if automated_mode
|
39
39
|
|
40
|
-
pr = create_pr(title, description)
|
40
|
+
pr = create_pr(title, description, base)
|
41
41
|
|
42
42
|
if user_has_write_permissions
|
43
43
|
edit_pr(pr, selected_labels, selected_milestone, selected_reviewers)
|
@@ -93,10 +93,10 @@ module Geet
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
def create_pr(title, description)
|
96
|
+
def create_pr(title, description, base)
|
97
97
|
@out.puts 'Creating PR...'
|
98
98
|
|
99
|
-
@repository.create_pr(title, description, @git_client.current_branch)
|
99
|
+
@repository.create_pr(title, description, @git_client.current_branch, base: base)
|
100
100
|
end
|
101
101
|
|
102
102
|
def edit_pr(pr, labels, milestone, reviewers)
|
data/lib/geet/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saverio Miroddi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_scripting
|