github_workflow 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/github_workflow.gemspec +2 -2
- data/lib/github_workflow/cli.rb +19 -25
- data/lib/github_workflow/version.rb +1 -1
- metadata +15 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dd46613c2e0f1ff3275713640c8e5752d7bc3d0bcd01b3368c22f7909107ba2
|
4
|
+
data.tar.gz: 98988775af47addfbc43a3cd5d393884e02d67d5a06b01b5b9aa9bc9d40302b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65e5b2f17ecbc581627bebeeb1b22bdecf44a525cee027d649ad562c590f2956c65dd1c65adb8ee9395fc197f31c061d4468f33b58342f61d0e1e579885b3520
|
7
|
+
data.tar.gz: 5753a8dfb0252fc48c4625e024d417d3a086979079bd4ea1375a9fb3662b2072603bbcd9c5428d79b7cb3486c0c00a03fd43ca98f97cb530ff90e10039f23ed6
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/github_workflow.gemspec
CHANGED
@@ -17,8 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "thor", "~> 0.
|
21
|
-
spec.add_dependency "faraday", "~> 0.11"
|
20
|
+
spec.add_dependency "thor", "~> 1.0.1"
|
21
|
+
spec.add_dependency "faraday", "~> 0.11", "< 2.0"
|
22
22
|
spec.add_dependency "terminal-table", "~> 1.5"
|
23
23
|
spec.add_dependency "ruby-trello", "~> 2.1"
|
24
24
|
|
data/lib/github_workflow/cli.rb
CHANGED
@@ -12,7 +12,7 @@ module GithubWorkflow
|
|
12
12
|
|
13
13
|
include Thor::Actions
|
14
14
|
|
15
|
-
default_task :
|
15
|
+
default_task :trello
|
16
16
|
|
17
17
|
desc "start", "Create branch named with issue number and issue title"
|
18
18
|
method_option :issue_id, aliases: "-i", type: :string, required: true
|
@@ -182,7 +182,7 @@ module GithubWorkflow
|
|
182
182
|
title: trello_card.name,
|
183
183
|
body: issue_body_from_trello_card,
|
184
184
|
assignees: [current_github_username],
|
185
|
-
labels:
|
185
|
+
labels: trello_card.labels.map(&:name)
|
186
186
|
}
|
187
187
|
|
188
188
|
response = JSON.parse(github_client.post("repos/#{user_and_repo}/issues?access_token=#{oauth_token}", issue_params.to_json).body)
|
@@ -191,42 +191,35 @@ module GithubWorkflow
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def issue_body_from_trello_card
|
194
|
-
[trello_card.desc, trello_deploy_note].compact.join("\n\n")
|
194
|
+
[trello_card.desc, trello_deploy_note, trello_product_review_type, trello_pm].compact.join("\n\n")
|
195
195
|
end
|
196
196
|
|
197
|
-
def
|
198
|
-
custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "
|
197
|
+
def trello_pm
|
198
|
+
custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "PM" }
|
199
199
|
|
200
200
|
if custom_field.present?
|
201
|
-
"**
|
201
|
+
"**Responsible:** #{custom_field.option_value['text']}"
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
205
|
-
def
|
206
|
-
|
207
|
-
end
|
208
|
-
|
209
|
-
def issue_labels_from_trello_card
|
210
|
-
labels = trello_card.labels.map(&:name)
|
211
|
-
|
212
|
-
product_review_type = trello_card.custom_field_items.detect do |cfi|
|
213
|
-
cfi.custom_field.name == "Product Review"
|
214
|
-
end
|
205
|
+
def trello_deploy_note
|
206
|
+
custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "Deploy Note" }
|
215
207
|
|
216
|
-
if
|
217
|
-
|
208
|
+
if custom_field.present?
|
209
|
+
"**Deploy Note:** #{custom_field.value['text']}"
|
218
210
|
end
|
211
|
+
end
|
219
212
|
|
220
|
-
|
221
|
-
|
222
|
-
end
|
213
|
+
def trello_product_review_type
|
214
|
+
custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "Product Review" }
|
223
215
|
|
224
|
-
if
|
225
|
-
|
226
|
-
labels << "Priority: #{priority_titleized}"
|
216
|
+
if custom_field.present?
|
217
|
+
"**Product Review:** #{custom_field.option_value['text']}"
|
227
218
|
end
|
219
|
+
end
|
228
220
|
|
229
|
-
|
221
|
+
def current_github_username
|
222
|
+
JSON.parse(github_client.get("user?access_token=#{oauth_token}").body)["login"]
|
230
223
|
end
|
231
224
|
|
232
225
|
def set_trello_card
|
@@ -238,6 +231,7 @@ module GithubWorkflow
|
|
238
231
|
def trello_card
|
239
232
|
@trello_card
|
240
233
|
end
|
234
|
+
|
241
235
|
def ensure_github_config_present
|
242
236
|
unless project_config && project_config["oauth_token"] && project_config["user_and_repo"]
|
243
237
|
failure('Please add `.github` file containing `{ "oauth_token": "TOKEN", "user_and_repo": "user/repo" }`')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Liscio
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0.11'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2.0'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '0.11'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: terminal-table
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +114,7 @@ dependencies:
|
|
108
114
|
- - "~>"
|
109
115
|
- !ruby/object:Gem::Version
|
110
116
|
version: '10.0'
|
111
|
-
description:
|
117
|
+
description:
|
112
118
|
email:
|
113
119
|
- bliscio@daisybill.com
|
114
120
|
executables:
|
@@ -129,7 +135,7 @@ homepage: https://github.com/daisybill/github_workflow
|
|
129
135
|
licenses:
|
130
136
|
- MIT
|
131
137
|
metadata: {}
|
132
|
-
post_install_message:
|
138
|
+
post_install_message:
|
133
139
|
rdoc_options: []
|
134
140
|
require_paths:
|
135
141
|
- lib
|
@@ -144,9 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
150
|
- !ruby/object:Gem::Version
|
145
151
|
version: '0'
|
146
152
|
requirements: []
|
147
|
-
|
148
|
-
|
149
|
-
signing_key:
|
153
|
+
rubygems_version: 3.1.2
|
154
|
+
signing_key:
|
150
155
|
specification_version: 4
|
151
156
|
summary: DaisyBill's internal github workflows
|
152
157
|
test_files: []
|