github_workflow 0.2.4 → 0.3.1
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 +23 -38
- 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: 5ca781e1f4ca8c31e5bcb694f2d8985c35807fa5410107c8d1f0972c7bdf52c2
|
4
|
+
data.tar.gz: 2a9b9af7a96c2ddec30758458c704191d0ba3dae33cc2b4545cfc6a1ba2d5eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c12e1aa74a8c5b8b8186834d6389ac3201ef5770c30685cd027b6be4845ae3acfafe84a883400b4cbddda32c8217fa14eff34bf7476f02925ea7c0e66562ff7
|
7
|
+
data.tar.gz: f61e626629fabea130fbe8bc5ec0a6e12f7d92546ae5dce0e09f345c7c3a460c5022be8dce190b6d5cff83711d5223700a0ebce5f4e5831e45abddc27363d821
|
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
|
@@ -20,8 +20,8 @@ module GithubWorkflow
|
|
20
20
|
def start
|
21
21
|
ensure_github_config_present
|
22
22
|
stash
|
23
|
-
|
24
|
-
|
23
|
+
checkout_main
|
24
|
+
rebase_main
|
25
25
|
create_branch
|
26
26
|
stash_pop
|
27
27
|
end
|
@@ -144,8 +144,8 @@ module GithubWorkflow
|
|
144
144
|
set_trello_card
|
145
145
|
create_issue_from_trello_card
|
146
146
|
stash
|
147
|
-
|
148
|
-
|
147
|
+
checkout_main
|
148
|
+
rebase_main
|
149
149
|
create_branch
|
150
150
|
stash_pop
|
151
151
|
end
|
@@ -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,7 +191,15 @@ module GithubWorkflow
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def issue_body_from_trello_card
|
194
|
-
[trello_card.desc, trello_deploy_note, trello_product_review_type].compact.join("\n\n")
|
194
|
+
[trello_card.desc, trello_deploy_note, trello_product_review_type, trello_pm].compact.join("\n\n")
|
195
|
+
end
|
196
|
+
|
197
|
+
def trello_pm
|
198
|
+
custom_field = trello_card.custom_field_items.detect { |cfi| cfi.custom_field.name == "PM" }
|
199
|
+
|
200
|
+
if custom_field.present?
|
201
|
+
"**Responsible:** #{custom_field.option_value['text']}"
|
202
|
+
end
|
195
203
|
end
|
196
204
|
|
197
205
|
def trello_deploy_note
|
@@ -214,29 +222,6 @@ module GithubWorkflow
|
|
214
222
|
JSON.parse(github_client.get("user?access_token=#{oauth_token}").body)["login"]
|
215
223
|
end
|
216
224
|
|
217
|
-
def issue_labels_from_trello_card
|
218
|
-
labels = trello_card.labels.map(&:name)
|
219
|
-
|
220
|
-
product_review_type = trello_card.custom_field_items.detect do |cfi|
|
221
|
-
cfi.custom_field.name == "Product Review"
|
222
|
-
end
|
223
|
-
|
224
|
-
if product_review_type && ["Review App", "Screenshot"].include?(product_review_type.option_value["text"])
|
225
|
-
labels << "Product Review Required"
|
226
|
-
end
|
227
|
-
|
228
|
-
priority = trello_card.custom_field_items.detect do |cfi|
|
229
|
-
cfi.custom_field.name == "Priority"
|
230
|
-
end
|
231
|
-
|
232
|
-
if priority && priority.option_value["text"].present?
|
233
|
-
priority_titleized = priority.option_value["text"]
|
234
|
-
labels << "Priority: #{priority_titleized}"
|
235
|
-
end
|
236
|
-
|
237
|
-
labels.compact
|
238
|
-
end
|
239
|
-
|
240
225
|
def set_trello_card
|
241
226
|
say_info("Fetching trello card")
|
242
227
|
trello_board = Trello::Board.find(project_config["trello_board_id"])
|
@@ -316,7 +301,7 @@ module GithubWorkflow
|
|
316
301
|
JSON.generate(
|
317
302
|
{
|
318
303
|
head: current_branch,
|
319
|
-
base: options[:base_branch] || "
|
304
|
+
base: options[:base_branch] || "main",
|
320
305
|
issue: issue_number_from_branch.to_i
|
321
306
|
}
|
322
307
|
)
|
@@ -355,8 +340,8 @@ module GithubWorkflow
|
|
355
340
|
end
|
356
341
|
end
|
357
342
|
|
358
|
-
def
|
359
|
-
say_info("Fetching changes and rebasing
|
343
|
+
def rebase_main
|
344
|
+
say_info("Fetching changes and rebasing main")
|
360
345
|
|
361
346
|
if success?("git pull --rebase")
|
362
347
|
pass("Fetched and rebased")
|
@@ -365,13 +350,13 @@ module GithubWorkflow
|
|
365
350
|
end
|
366
351
|
end
|
367
352
|
|
368
|
-
def
|
369
|
-
say_info("Checking out
|
353
|
+
def checkout_main
|
354
|
+
say_info("Checking out main")
|
370
355
|
|
371
|
-
if success?("git checkout
|
372
|
-
pass("Checked out
|
356
|
+
if success?("git checkout main")
|
357
|
+
pass("Checked out main")
|
373
358
|
else
|
374
|
-
failure("Failed to checkout
|
359
|
+
failure("Failed to checkout main")
|
375
360
|
end
|
376
361
|
end
|
377
362
|
|
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.1
|
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: 2021-02-03 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: []
|