geet 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2329057378f97cc59535b5821aeeca1f527bca27bd4ced6bb3250e46a55042c
4
- data.tar.gz: 680b9175785b58deac3d5df918b2b843168ac709aea396168bd35091b6b7810b
3
+ metadata.gz: 277ed0b36c021a28cc688fd768955c5639d0658885f60ff45f2a70c179a1e507
4
+ data.tar.gz: f181e99e34416ebf216d4fb603fd213217a9d188060d38ac2e9770e02aa5befb
5
5
  SHA512:
6
- metadata.gz: 9dbb35ae368c401562677fa3a84138b53e1f15d4741802b478dca6cc166e65c451bf892316dcc9c32add3ca503d031a53d7964ffcc8910713fd2255f4b7c0220
7
- data.tar.gz: ecba5a04fd823553108c83bc1e7a182d81d3a3e08d8e875584213e05f966153419fd30a4237f63126a419bcb8ce1007a1ad55e093ff24ea7d1f038ca3ad9c0cf
6
+ metadata.gz: 1b5a73ec3c4ffb45daf21dba976f1c6330b0c4a4f2ee0ea3065674710026745834287586dc897b7ec3a1a645e1ed7a3d60f7ca580a46b5f47dc2ed25b6031ee7
7
+ data.tar.gz: 0a4b834f9fcba3502c6f6408511001ab35fc08c5a5c4987b9c51ad5a4a16708ff714a7f47d993cdcd1decf0cf57dad75f4147deab2ac65363cad8cb6f37ee605
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 = '2021-06-08'
13
+ s.date = '2021-07-09'
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'
@@ -68,6 +68,7 @@ module Geet
68
68
  ['-A', '--automated-mode', "Automate the branch operations (see long help)"],
69
69
  ['-n', '--no-open-pr', "Don't open the PR link in the browser after creation"],
70
70
  ['-b', '--base develop', "Specify the base branch; defaults to the main branch"],
71
+ ['-d', '--draft', "Create as draft"],
71
72
  ['-l', '--labels "legacy,code review"', 'Labels'],
72
73
  ['-m', '--milestone 1.5.0', 'Milestone title pattern'],
73
74
  ['-r', '--reviewers john,tom,adrian,kevin', 'Reviewer logins'],
@@ -74,11 +74,11 @@ module Geet
74
74
  attempt_provider_call(:Milestone, :close, number, api_interface)
75
75
  end
76
76
 
77
- def create_pr(title, description, head, base)
77
+ def create_pr(title, description, head, base, draft)
78
78
  confirm(LOCAL_ACTION_ON_UPSTREAM_REPOSITORY_MESSAGE) if local_action_on_upstream_repository? && @warnings
79
79
  confirm(ACTION_ON_PROTECTED_REPOSITORY_MESSAGE) if action_on_protected_repository? && @warnings
80
80
 
81
- attempt_provider_call(:PR, :create, title, description, head, api_interface, base)
81
+ attempt_provider_call(:PR, :create, title, description, head, api_interface, base, draft: draft)
82
82
  end
83
83
 
84
84
  def prs(owner: nil, head: nil, milestone: nil)
@@ -8,7 +8,7 @@ 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, base)
11
+ def self.create(title, description, head, api_interface, base, draft: false)
12
12
  api_path = 'pulls'
13
13
 
14
14
  if api_interface.upstream?
@@ -16,7 +16,7 @@ module Geet
16
16
  head = "#{authenticated_user}:#{head}"
17
17
  end
18
18
 
19
- request_data = { title: title, body: description, head: head, base: base }
19
+ request_data = { title: title, body: description, head: head, base: base, draft: draft }
20
20
 
21
21
  response = api_interface.send_request(api_path, data: request_data)
22
22
 
@@ -25,7 +25,7 @@ module Geet
25
25
  #
26
26
  def execute(
27
27
  title, description, labels: nil, milestone: nil, reviewers: nil,
28
- base: nil, no_open_pr: nil, automated_mode: false, **
28
+ base: nil, draft: false, no_open_pr: nil, automated_mode: false, **
29
29
  )
30
30
  ensure_clean_tree if automated_mode
31
31
 
@@ -39,7 +39,7 @@ module Geet
39
39
 
40
40
  sync_with_upstream_branch if automated_mode
41
41
 
42
- pr = create_pr(title, description, base: base)
42
+ pr = create_pr(title, description, base: base, draft: draft)
43
43
 
44
44
  if user_has_write_permissions
45
45
  edit_pr(pr, selected_labels, selected_milestone, selected_reviewers)
@@ -95,12 +95,12 @@ module Geet
95
95
  end
96
96
  end
97
97
 
98
- def create_pr(title, description, base: nil)
98
+ def create_pr(title, description, base:, draft:)
99
99
  @out.puts 'Creating PR...'
100
100
 
101
101
  base ||= @git_client.main_branch
102
102
 
103
- @repository.create_pr(title, description, @git_client.current_branch, base)
103
+ @repository.create_pr(title, description, @git_client.current_branch, base, draft)
104
104
  end
105
105
 
106
106
  def edit_pr(pr, labels, milestone, reviewers)
data/lib/geet/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geet
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
@@ -686,7 +686,7 @@ http_interactions:
686
686
  uri: https://api.github.com/repos/donaldduck/testrepo_f/pulls
687
687
  body:
688
688
  encoding: UTF-8
689
- string: '{"title":"Title","body":"Description","head":"mybranch","base":"master"}'
689
+ string: '{"title":"Title","body":"Description","head":"mybranch","base":"master","draft":false}'
690
690
  headers:
691
691
  Accept-Encoding:
692
692
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
@@ -381,7 +381,7 @@ http_interactions:
381
381
  uri: https://api.github.com/repos/donaldduck/testrepo_f/pulls
382
382
  body:
383
383
  encoding: UTF-8
384
- string: '{"title":"Title","body":"Description","head":"mybranch","base":"master"}'
384
+ string: '{"title":"Title","body":"Description","head":"mybranch","base":"master","draft":false}'
385
385
  headers:
386
386
  Accept-Encoding:
387
387
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
@@ -381,7 +381,7 @@ http_interactions:
381
381
  uri: https://api.github.com/repos/donaldduck/testrepo_f/pulls
382
382
  body:
383
383
  encoding: UTF-8
384
- string: '{"title":"Title","body":"Description","head":"mybranch","base":"master"}'
384
+ string: '{"title":"Title","body":"Description","head":"mybranch","base":"master","draft":false}'
385
385
  headers:
386
386
  Accept-Encoding:
387
387
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
@@ -459,7 +459,7 @@ http_interactions:
459
459
  uri: https://api.github.com/repos/donald-fr/testrepo_u/pulls
460
460
  body:
461
461
  encoding: UTF-8
462
- string: '{"title":"Title","body":"Description","head":"donaldduck:mybranch","base":"master"}'
462
+ string: '{"title":"Title","body":"Description","head":"donaldduck:mybranch","base":"master","draft":false}'
463
463
  headers:
464
464
  Accept-Encoding:
465
465
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
@@ -230,7 +230,7 @@ http_interactions:
230
230
  uri: https://api.github.com/repos/donald-fr/testrepo_u/pulls
231
231
  body:
232
232
  encoding: UTF-8
233
- string: '{"title":"Title","body":"Description","head":"donaldduck:mybranch","base":"master"}'
233
+ string: '{"title":"Title","body":"Description","head":"donaldduck:mybranch","base":"master","draft":false}'
234
234
  headers:
235
235
  Accept-Encoding:
236
236
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
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.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-08 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.2.19
193
+ rubygems_version: 3.1.4
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Commandline interface for performing SCM host operations, eg. create a PR