brainiac-fizzy 0.0.43 → 0.0.44
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/lib/brainiac/plugins/fizzy/hooks.rb +16 -19
- data/lib/brainiac/plugins/fizzy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c290f711243211d67abdd35bf34d3abd9676461f81bfd104b03f6b53e243328
|
|
4
|
+
data.tar.gz: 72e650801901d0c6150f231ac16104124ceff67df87ffc39cbd3abf09b915e30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e03a9c0438cbb058848b27bc9f66af30392eca388212740a6eb1a7f0c82f7c257c2b8d09dfde839d9a37feee4549f484546f2e4da77af417c1b4202f686bf6c
|
|
7
|
+
data.tar.gz: 185febcad0410ecb6a75020887d1d04e00ef753e6dd3d9193b8cfecb21eaf24d6df226ba3a7b608e85673ef655cb4cde4baad62a7bb1e582db27e6453a23c010
|
|
@@ -245,22 +245,24 @@ module Brainiac
|
|
|
245
245
|
tags = ctx[:tags] || []
|
|
246
246
|
assign_to = ctx[:assign_to]
|
|
247
247
|
|
|
248
|
-
# Resolve tag IDs
|
|
249
248
|
agent_env = agent_env_for("Threepio")
|
|
250
249
|
spawn_env = agent_env.empty? ? {} : agent_env
|
|
251
|
-
tag_ids = resolve_tag_ids(tags, spawn_env)
|
|
252
250
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
251
|
+
# fizzy 4 has no tag flag on create, so tags go on afterwards
|
|
252
|
+
output, status = Open3.capture2e(spawn_env, "fizzy", "card", "create", "--board", board_id,
|
|
253
|
+
"--title", title, "--description", description)
|
|
254
|
+
unless status.success?
|
|
255
|
+
LOG.error "[Fizzy] fizzy card create failed: #{output.strip[0, 300]}" if defined?(LOG)
|
|
256
|
+
next nil
|
|
257
|
+
end
|
|
258
258
|
|
|
259
259
|
card_data = JSON.parse(output)
|
|
260
260
|
card_number = card_data.dig("data", "number")
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
if card_number
|
|
263
|
+
tag_card(card_number, tags, spawn_env)
|
|
264
|
+
assign_card(card_number, assign_to, spawn_env) if assign_to
|
|
265
|
+
end
|
|
264
266
|
|
|
265
267
|
{ number: card_number, url: card_data.dig("data", "url"), title: title }
|
|
266
268
|
rescue StandardError => e
|
|
@@ -416,17 +418,12 @@ module Brainiac
|
|
|
416
418
|
closed
|
|
417
419
|
end
|
|
418
420
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
tag_names.filter_map do |name|
|
|
425
|
-
tag = all_tags.find { |t| t["title"].downcase == name.downcase }
|
|
426
|
-
tag&.dig("id")
|
|
421
|
+
# `fizzy card tag` toggles, which is safe on a card that was just created.
|
|
422
|
+
def tag_card(card_number, tag_names, spawn_env)
|
|
423
|
+
tag_names.each do |name|
|
|
424
|
+
output, status = Open3.capture2e(spawn_env, "fizzy", "card", "tag", card_number.to_s, "--tag", name)
|
|
425
|
+
LOG.warn "[Fizzy] Couldn't tag card ##{card_number} #{name}: #{output.strip[0, 200]}" if !status.success? && defined?(LOG)
|
|
427
426
|
end
|
|
428
|
-
rescue StandardError
|
|
429
|
-
[]
|
|
430
427
|
end
|
|
431
428
|
|
|
432
429
|
def assign_card(card_number, agent_name, spawn_env)
|