linear-cli 0.9.17 → 0.9.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linear/cli/version.rb +1 -1
- data/lib/linear/commands/issue.rb +3 -2
- data/lib/linear/models/issue.rb +9 -3
- 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: fdfa5217a71c9c72e813abafa1d9b84173f7cc84fbba9346ade9ff9b9a4a656a
|
4
|
+
data.tar.gz: 306e2f48788f60e3f89b721bfa31116dc671897e57d6279f7de32cbb430f45b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8a499e75976dd0877fa02d93b2f2a911b521633e917d702fad681e0e378e9d5b1fa0d79706b9fb54ecae910f32bd78dcfeb6c1c5fa6c5ff9bc63e3d601b90c4
|
7
|
+
data.tar.gz: 4967fc24d83629772911e084a4210c10bfa1dfb379fa56ca4e48df9f26e9dcbb700809f73a26b1001533e3fd893680cdb954acd5853c13369f302030c45e6847
|
data/lib/linear/cli/version.rb
CHANGED
@@ -36,7 +36,7 @@ module Rubyists
|
|
36
36
|
def cancel_issue(issue, **options)
|
37
37
|
reason = reason_for(options[:reason], four: "cancelling #{issue.identifier} - #{issue.title}")
|
38
38
|
issue_comment issue, reason
|
39
|
-
cancel_state =
|
39
|
+
cancel_state = cancelled_state_for(issue)
|
40
40
|
issue.close! state: cancel_state, trash: options[:trash]
|
41
41
|
prompt.ok "#{issue.identifier} was cancelled"
|
42
42
|
end
|
@@ -70,9 +70,10 @@ module Rubyists
|
|
70
70
|
prompt.ok "#{issue.identifier} was attached to #{project.name}"
|
71
71
|
end
|
72
72
|
|
73
|
-
def update_issue(issue, **options)
|
73
|
+
def update_issue(issue, **options) # rubocop:disable Metrics/AbcSize
|
74
74
|
issue_comment(issue, options[:comment]) if options[:comment]
|
75
75
|
return close_issue(issue, **options) if options[:close]
|
76
|
+
return cancel_issue(issue, **options) if options[:cancel]
|
76
77
|
return issue_pr(issue) if options[:pr]
|
77
78
|
return attach_project(issue, options[:project]) if options[:project]
|
78
79
|
return if options[:comment]
|
data/lib/linear/models/issue.rb
CHANGED
@@ -66,16 +66,22 @@ module Rubyists
|
|
66
66
|
def close_mutation(close_state, trash: false)
|
67
67
|
id_for_this = identifier
|
68
68
|
input = { stateId: close_state.id }
|
69
|
-
input[:
|
69
|
+
input[:trashed] = true if trash
|
70
70
|
mutation { issueUpdate(id: id_for_this, input:) { issue { ___ Issue.full_fragment } } }
|
71
71
|
end
|
72
72
|
|
73
|
-
def close!(state: nil, trash: false)
|
73
|
+
def close!(state: nil, trash: false) # rubocop:disable Metrics/MethodLength
|
74
74
|
logger.warn "Using first completed state found: #{completed_states.first}" if state.nil?
|
75
75
|
state ||= completed_states.first
|
76
76
|
query_data = Api.query close_mutation(state, trash:)
|
77
|
+
unless query_data.respond_to?(:dig)
|
78
|
+
raise SmellsBad, "Unknown response (#{query_data || "NULL"}) updating #{self} to #{state}, trash: #{trash}"
|
79
|
+
end
|
80
|
+
|
77
81
|
updated = query_data.dig(:issueUpdate, :issue)
|
78
|
-
|
82
|
+
if updated.nil?
|
83
|
+
raise SmellsBad, "Unknown response for issue close: #{query_data} (should have :issueUpdate key)"
|
84
|
+
end
|
79
85
|
|
80
86
|
@data = @updated_data = updated
|
81
87
|
self
|