linear-cli 0.9.17 → 0.9.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.overcommit.yml +10 -0
- data/lib/linear/cli/version.rb +1 -1
- data/lib/linear/commands/issue/take.rb +1 -2
- data/lib/linear/commands/issue.rb +3 -2
- data/lib/linear/models/issue.rb +9 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8b5d0243a88d0bf959a14f147c7966fa661839059d2b4c17d4905c9ea7d9b8d
|
4
|
+
data.tar.gz: 3162551cd445f432cc01e42643c5d428ed86e3e4fad93cab4fc829519a1b0c96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f98055e6ecbb47cb3725609f01491648d43854bcb010b09eb7ec5c92a227e37c31cd6ef74a192ea08d726e3350b9401d038ea9ac383458555f82ec807727860
|
7
|
+
data.tar.gz: 3c5bc6ed193aaa0995625185f3dfb3c98f0eb5f83c960077b145bd5921382170623ae5c62c08bc361d6d5089e7e52366cadfab2af9755e7f6329726d31c8193b
|
data/.overcommit.yml
ADDED
data/lib/linear/cli/version.rb
CHANGED
@@ -20,9 +20,8 @@ module Rubyists
|
|
20
20
|
argument :issue_ids, type: :array, required: true, desc: 'Issue Identifiers'
|
21
21
|
|
22
22
|
def call(issue_ids:, **options)
|
23
|
-
me = Rubyists::Linear::User.me
|
24
23
|
updates = issue_ids.map do |issue_id|
|
25
|
-
gimme_da_issue! issue_id
|
24
|
+
gimme_da_issue! issue_id # gimme_da_issue! is defined in Rubyists::Linear::CLI::Issue
|
26
25
|
rescue NotFoundError => e
|
27
26
|
logger.warn e.message
|
28
27
|
next
|
@@ -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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linear-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tj (bougyman) Vanderpoel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -205,6 +205,7 @@ executables:
|
|
205
205
|
extensions: []
|
206
206
|
extra_rdoc_files: []
|
207
207
|
files:
|
208
|
+
- ".overcommit.yml"
|
208
209
|
- CHANGELOG.md
|
209
210
|
- LICENSE.txt
|
210
211
|
- Rakefile
|