octopolo 1.8.1 → 1.9.0

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
- SHA256:
3
- metadata.gz: f7d2ef051ddbac71ff373b711306d4bde24e5fedc70c1eb0009a9b44bd523778
4
- data.tar.gz: 0b1a2db7a06228c60b398ee66e18a6a1f33e207831439124fc243508ab9d3a65
2
+ SHA1:
3
+ metadata.gz: 99207cf6d908d02747dfa354364fcb7a5489c4d1
4
+ data.tar.gz: 2becf7b4837964d9f40aa460ec65d42674e801b0
5
5
  SHA512:
6
- metadata.gz: bf4e358f76c011d7b5d44560939209d1930c1d02e3d91cc1bf4dfd76dc12e3475e1d772ecb305cd671908fb7d493963d139d67bdbf3e87687e4600a56d4148ac
7
- data.tar.gz: 9973ef58b4ba30d15e46757d7837794d44a4cc60618b489f3dbaff5e7cc0cc754832f4e00cfe34c9df8269dfb3611afff4f6bdd4edc57a969fb0b64dadc3c8c2
6
+ metadata.gz: 314f19aacdd2ee12e72717812eea2d7f864f3de87c216b75011843a32e83fadd2ac0c74c0a6dd71ba71357e7b82426c6aed33ad1129e09f0b4a86d7d67f7c438
7
+ data.tar.gz: e29c63d641279110743350e2a1bc5808f7addb32144f2ef5f13c1f73820f19884744ccd3226748ab9aa85dd8e967976f3d16ac5ebbcc4b8abb212c2aa829febb
@@ -1,3 +1,5 @@
1
+ #### v1.10.0
2
+ #### v1.9.0
1
3
  #### v1.8.1
2
4
  * Update Ruby Versions for CI
3
5
 
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'gli'
4
+ require_relative '../lib/octopolo'
5
+
6
+ include GLI::App
7
+
8
+ program_desc 'GitHub workflow scripts. From the Ngineers at Sport Ngin.'
9
+ version Octopolo::VERSION
10
+
11
+ autocomplete_commands false
12
+ wrap_help_text :verbatim
13
+
14
+ program_long_desc """
15
+ DOCUMENTATION
16
+ For documentation and help in setting up your configuration files,
17
+ see Octopolo's GitHub repo: https://github.com/sportngin/octopolo
18
+ """
19
+
20
+ commands_from File.expand_path(File.dirname(__FILE__) + '/../lib/octopolo/commands')
21
+
22
+ exit run(ARGV)
@@ -3,6 +3,9 @@ command 'pull-request' do |c|
3
3
  c.desc "Branch to create the pull request against"
4
4
  c.flag [:d, :dest, :destination], :arg_name => "destination_branch", :default_value => Octopolo.config.deploy_branch
5
5
 
6
+ c.desc "Pass -x to skip the prompt and infer from branch. Expects the branch to be in this format: JIRA-123_describe_pr"
7
+ c.switch [:x, :expedite], :arg_name => "expedite"
8
+
6
9
  c.desc "Use $EDITOR to update PR description before creating"
7
10
  c.switch [:e, :editor], :default_value => Octopolo.user_config.editor
8
11
 
@@ -27,7 +27,13 @@ module Octopolo
27
27
 
28
28
  def execute
29
29
  GitHub.connect do
30
- ask_questionaire
30
+
31
+ if options[:expedite]
32
+ infer_questionaire
33
+ else
34
+ ask_questionaire
35
+ end
36
+
31
37
  create_pull_request
32
38
  update_pivotal
33
39
  update_jira
@@ -47,6 +53,27 @@ module Octopolo
47
53
  end
48
54
  private :ask_questionaire
49
55
 
56
+ def infer_questionaire
57
+ alert_reserved_and_exit if git.reserved_branch?
58
+ check_branch_format
59
+ branch_arr = git.current_branch.split('_')
60
+ issue = branch_arr[0].upcase
61
+ descr = branch_arr[1..-1].join(' ')
62
+
63
+ self.title = "#{issue} #{descr}"
64
+ self.pivotal_ids = [issue] if config.use_pivotal_tracker
65
+ self.jira_ids = [issue] if config.use_jira
66
+ end
67
+ private :infer_questionaire
68
+
69
+ def check_branch_format
70
+ return if /.*-\d+_.*/ =~ git.current_branch
71
+
72
+ cli.say "Branch must match format like 'iss-123_describe_branch' to expedite"
73
+ exit 1
74
+ end
75
+ private :check_branch_format
76
+
50
77
  # Private: Announce to the user the branches the pull request will reference
51
78
  def announce
52
79
  cli.say "Preparing a pull request for #{config.github_repo}/#{git.current_branch} to #{config.github_repo}/#{destination_branch}."
@@ -1,3 +1,3 @@
1
1
  module Octopolo
2
- VERSION = "1.8.1"
2
+ VERSION = "1.9.0"
3
3
  end
@@ -13,7 +13,8 @@ module Octopolo
13
13
  })
14
14
  end
15
15
  let(:cli) { stub(:cli) }
16
- let(:git) { stub(:Git, current_branch: "bug-123-something", reserved_branch?: false) }
16
+ let(:current_branch) { "bug-123-something" }
17
+ let(:git) { stub(:Git, current_branch: current_branch, reserved_branch?: false) }
17
18
  let(:pull_request_url) { "http://github.com/tstmedia/octopolo/pull/0" }
18
19
  let(:pull_request) { stub(:pull_request) }
19
20
 
@@ -97,6 +98,37 @@ module Octopolo
97
98
  end
98
99
  end
99
100
 
101
+ context "#expedite" do
102
+ subject { PullRequest.new(nil, { expedite: true }) }
103
+
104
+ context 'good format' do
105
+ let(:current_branch) { 'abc-123_so_fast'}
106
+
107
+ it 'likes the issue-123_blah branch format' do
108
+ subject.send(:infer_questionaire)
109
+ expect(subject.jira_ids).to eq(['ABC-123'])
110
+ expect(subject.title).to eq('ABC-123 so fast')
111
+ end
112
+ end
113
+
114
+ context 'bad branch format' do
115
+ let(:current_branch) { 'not_enough'}
116
+
117
+ it 'does not like other branch format' do
118
+ subject.git.stub(:reserved_branch?).and_return false
119
+ cli.should_receive(:say)
120
+ expect { subject.send(:infer_questionaire) }.to raise_error(SystemExit)
121
+ end
122
+ end
123
+
124
+ it 'does not process reserved' do
125
+ subject.git.stub(:reserved_branch?).and_return true
126
+ subject.should_receive(:alert_reserved_and_exit).and_call_original
127
+ cli.should_receive(:say)
128
+ expect { subject.send(:infer_questionaire) }.to raise_error(SystemExit)
129
+ end
130
+ end
131
+
100
132
  context "#announce" do
101
133
  before do
102
134
  subject.destination_branch = "foo"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
@@ -10,230 +10,230 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-02-22 00:00:00.000000000 Z
13
+ date: 2019-03-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gli
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '2.13'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '2.13'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: hashie
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ~>
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
35
  version: '1.2'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '1.2'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: octokit
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: '4.0'
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ~>
54
+ - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: '4.0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: public_suffix
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ~>
61
+ - - "~>"
62
62
  - !ruby/object:Gem::Version
63
63
  version: '2.0'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ~>
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: '2.0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: highline
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ~>
75
+ - - "~>"
76
76
  - !ruby/object:Gem::Version
77
77
  version: '1.6'
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ~>
82
+ - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: '1.6'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: pivotal-tracker
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ~>
89
+ - - "~>"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0.5'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ~>
96
+ - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0.5'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: jiralicious
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ~>
103
+ - - "~>"
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0.4'
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ~>
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0.4'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: semantic
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ~>
117
+ - - "~>"
118
118
  - !ruby/object:Gem::Version
119
119
  version: '1.3'
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ~>
124
+ - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '1.3'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: nokogiri-happymapper
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ~>
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
133
  version: 0.6.0
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ~>
138
+ - - "~>"
139
139
  - !ruby/object:Gem::Version
140
140
  version: 0.6.0
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: rake
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ~>
145
+ - - "~>"
146
146
  - !ruby/object:Gem::Version
147
147
  version: '10.1'
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ~>
152
+ - - "~>"
153
153
  - !ruby/object:Gem::Version
154
154
  version: '10.1'
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: bundler
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - ~>
159
+ - - "~>"
160
160
  - !ruby/object:Gem::Version
161
161
  version: '1.16'
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - ~>
166
+ - - "~>"
167
167
  - !ruby/object:Gem::Version
168
168
  version: '1.16'
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: rspec
171
171
  requirement: !ruby/object:Gem::Requirement
172
172
  requirements:
173
- - - ~>
173
+ - - "~>"
174
174
  - !ruby/object:Gem::Version
175
175
  version: '2.99'
176
176
  type: :development
177
177
  prerelease: false
178
178
  version_requirements: !ruby/object:Gem::Requirement
179
179
  requirements:
180
- - - ~>
180
+ - - "~>"
181
181
  - !ruby/object:Gem::Version
182
182
  version: '2.99'
183
183
  - !ruby/object:Gem::Dependency
184
184
  name: guard
185
185
  requirement: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - ~>
187
+ - - "~>"
188
188
  - !ruby/object:Gem::Version
189
189
  version: '2.6'
190
190
  type: :development
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
193
193
  requirements:
194
- - - ~>
194
+ - - "~>"
195
195
  - !ruby/object:Gem::Version
196
196
  version: '2.6'
197
197
  - !ruby/object:Gem::Dependency
198
198
  name: guard-rspec
199
199
  requirement: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - ~>
201
+ - - "~>"
202
202
  - !ruby/object:Gem::Version
203
203
  version: '4.3'
204
204
  type: :development
205
205
  prerelease: false
206
206
  version_requirements: !ruby/object:Gem::Requirement
207
207
  requirements:
208
- - - ~>
208
+ - - "~>"
209
209
  - !ruby/object:Gem::Version
210
210
  version: '4.3'
211
211
  - !ruby/object:Gem::Dependency
212
212
  name: hitimes
213
213
  requirement: !ruby/object:Gem::Requirement
214
214
  requirements:
215
- - - ~>
215
+ - - "~>"
216
216
  - !ruby/object:Gem::Version
217
217
  version: 1.2.6
218
218
  type: :development
219
219
  prerelease: false
220
220
  version_requirements: !ruby/object:Gem::Requirement
221
221
  requirements:
222
- - - ~>
222
+ - - "~>"
223
223
  - !ruby/object:Gem::Version
224
224
  version: 1.2.6
225
225
  - !ruby/object:Gem::Dependency
226
226
  name: octopolo-plugin-example
227
227
  requirement: !ruby/object:Gem::Requirement
228
228
  requirements:
229
- - - ~>
229
+ - - "~>"
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  type: :development
233
233
  prerelease: false
234
234
  version_requirements: !ruby/object:Gem::Requirement
235
235
  requirements:
236
- - - ~>
236
+ - - "~>"
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
239
  description: A set of GitHub workflow scripts.
@@ -247,12 +247,12 @@ executables:
247
247
  extensions: []
248
248
  extra_rdoc_files: []
249
249
  files:
250
- - .gitignore
251
- - .octopolo.yml
252
- - .ruby-gemset
253
- - .ruby-version
254
- - .soyuz.yml
255
- - .travis.yml
250
+ - ".gitignore"
251
+ - ".octopolo.yml"
252
+ - ".ruby-gemset"
253
+ - ".ruby-version"
254
+ - ".soyuz.yml"
255
+ - ".travis.yml"
256
256
  - CHANGELOG.markdown
257
257
  - Gemfile
258
258
  - Guardfile
@@ -379,17 +379,17 @@ require_paths:
379
379
  - lib
380
380
  required_ruby_version: !ruby/object:Gem::Requirement
381
381
  requirements:
382
- - - '>='
382
+ - - ">="
383
383
  - !ruby/object:Gem::Version
384
384
  version: '0'
385
385
  required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  requirements:
387
- - - '>='
387
+ - - ">="
388
388
  - !ruby/object:Gem::Version
389
389
  version: '0'
390
390
  requirements: []
391
391
  rubyforge_project:
392
- rubygems_version: 2.7.8
392
+ rubygems_version: 2.4.8
393
393
  signing_key:
394
394
  specification_version: 4
395
395
  summary: A set of GitHub workflow scripts to provide a smooth development process
@@ -1 +0,0 @@
1
- bin/op