geordi 12.0.0 → 12.1.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/CHANGELOG.md +1 -0
- data/Gemfile.lock +4 -8
- data/cucumber.yml +1 -0
- data/lib/geordi/gitlinear.rb +61 -35
- data/lib/geordi/settings.rb +6 -1
- data/lib/geordi/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b0ad63b0055ae689422b0aab1ccbf95093e010448e609ba98dec160d32120bb
|
4
|
+
data.tar.gz: bcf3cc151f954a1bc92301b1badc3ce4ccf607a5731b971789b66567cb4b620d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ad4cd385ff82debfbc9cc1efc5475142e2bbe88c6af52925ef681a45679bf51faadbd995bb2cd500118c732187cd8190bd585f6d1ed0315f79a9cccac7c109f
|
7
|
+
data.tar.gz: 60e6c101c9eed979a55150f4b2c0e2dcc3566e949f168eb921b30ab0dd939c458fecb7349abe4e4f6185deb7eab4a35a9273b92437733132fd4cb23de8ab3d80
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
geordi (12.
|
4
|
+
geordi (12.1.0)
|
5
5
|
thor (~> 1)
|
6
6
|
|
7
7
|
GEM
|
@@ -50,16 +50,14 @@ GEM
|
|
50
50
|
cucumber-tag-expressions (6.1.2)
|
51
51
|
diff-lcs (1.6.0)
|
52
52
|
ffi (1.12.2)
|
53
|
-
highline (
|
54
|
-
reline
|
55
|
-
io-console (0.8.0)
|
53
|
+
highline (2.1.0)
|
56
54
|
launchy (2.5.0)
|
57
55
|
addressable (~> 2.7)
|
58
56
|
method_source (1.1.0)
|
59
57
|
mini_mime (1.1.5)
|
60
58
|
multi_test (1.1.0)
|
61
59
|
parallel (1.19.2)
|
62
|
-
parallel_tests (4.
|
60
|
+
parallel_tests (4.7.1)
|
63
61
|
parallel
|
64
62
|
pry (0.14.2)
|
65
63
|
coderay (~> 1.1)
|
@@ -69,8 +67,6 @@ GEM
|
|
69
67
|
pry (>= 0.13, < 0.15)
|
70
68
|
public_suffix (3.1.1)
|
71
69
|
rake (12.3.3)
|
72
|
-
reline (0.6.0)
|
73
|
-
io-console (~> 0.5)
|
74
70
|
rspec (3.10.0)
|
75
71
|
rspec-core (~> 3.10.0)
|
76
72
|
rspec-expectations (~> 3.10.0)
|
@@ -103,4 +99,4 @@ DEPENDENCIES
|
|
103
99
|
rspec
|
104
100
|
|
105
101
|
BUNDLED WITH
|
106
|
-
2.
|
102
|
+
2.4.22
|
data/cucumber.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
default: --publish-quiet # Do not advertise to publish Cucumber results
|
data/lib/geordi/gitlinear.rb
CHANGED
@@ -20,7 +20,7 @@ module Geordi
|
|
20
20
|
No staged changes. Will create an empty commit.
|
21
21
|
WARNING
|
22
22
|
|
23
|
-
issue = choose_issue
|
23
|
+
issue = issue_from_branch || choose_issue
|
24
24
|
create_commit "[#{issue['identifier']}] #{issue['title']}", "Issue: #{issue['url']}", *git_args
|
25
25
|
end
|
26
26
|
|
@@ -93,6 +93,23 @@ module Geordi
|
|
93
93
|
nil
|
94
94
|
end
|
95
95
|
|
96
|
+
def issue_from_branch
|
97
|
+
issue = if Util.testing?
|
98
|
+
dummy_issue_for_testing if ENV['GEORDI_TESTING_ISSUE_MATCHES'] == 'true'
|
99
|
+
else
|
100
|
+
current_branch = Util.current_branch
|
101
|
+
issue = fetch_linear_issues.find { |issue| issue['branchName'] == current_branch }
|
102
|
+
end
|
103
|
+
|
104
|
+
return unless issue
|
105
|
+
|
106
|
+
id = issue['identifier']
|
107
|
+
title = issue['title']
|
108
|
+
|
109
|
+
Interaction.note "Auto-detected issue #{HighLine::BOLD}[#{id}] #{title}#{HighLine::RESET} from branch name."
|
110
|
+
Interaction.prompt("Use it?", "y", /y|yes/i) ? issue : nil
|
111
|
+
end
|
112
|
+
|
96
113
|
def dummy_issue_for_testing
|
97
114
|
settings.linear_api_key
|
98
115
|
ENV['GEORDI_TESTING_NO_LINEAR_ISSUES'] == 'true' ? Geordi::Interaction.fail('No issues to offer.') : {
|
@@ -112,41 +129,43 @@ module Geordi
|
|
112
129
|
end
|
113
130
|
|
114
131
|
def fetch_linear_issues
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
"
|
119
|
-
"
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
"
|
124
|
-
"
|
132
|
+
@linear_issues ||= begin
|
133
|
+
team_ids = settings.linear_team_ids
|
134
|
+
filter = {
|
135
|
+
"team": {
|
136
|
+
"id": {
|
137
|
+
"in": team_ids,
|
138
|
+
}
|
139
|
+
},
|
140
|
+
"state": {
|
141
|
+
"type": {
|
142
|
+
"eq": "started"
|
143
|
+
}
|
125
144
|
}
|
126
145
|
}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
146
|
+
response = query_api(<<~GRAPHQL, filter: filter)
|
147
|
+
query Issues($filter: IssueFilter) {
|
148
|
+
issues(filter: $filter) {
|
149
|
+
nodes {
|
150
|
+
title
|
151
|
+
identifier
|
152
|
+
url
|
153
|
+
branchName
|
154
|
+
assignee {
|
155
|
+
displayName
|
156
|
+
isMe
|
157
|
+
}
|
158
|
+
state {
|
159
|
+
name
|
160
|
+
position
|
161
|
+
}
|
139
162
|
}
|
140
|
-
state {
|
141
|
-
name
|
142
|
-
position
|
143
|
-
}
|
144
163
|
}
|
145
164
|
}
|
146
|
-
|
147
|
-
GRAPHQL
|
165
|
+
GRAPHQL
|
148
166
|
|
149
|
-
|
167
|
+
response.dig(*%w[issues nodes])
|
168
|
+
end
|
150
169
|
end
|
151
170
|
|
152
171
|
def query_api(attributes, variables)
|
@@ -158,7 +177,7 @@ module Geordi
|
|
158
177
|
https = Net::HTTP.new(uri.host, uri.port)
|
159
178
|
https.use_ssl = true
|
160
179
|
|
161
|
-
query =
|
180
|
+
query = { query: attributes.split.join(' '), variables: variables }.to_json
|
162
181
|
|
163
182
|
request = Net::HTTP::Post.new(uri.path)
|
164
183
|
request.body = query
|
@@ -167,13 +186,20 @@ module Geordi
|
|
167
186
|
request['Authorization'] = settings.linear_api_key
|
168
187
|
|
169
188
|
response = https.request(request)
|
170
|
-
|
189
|
+
parsed_response = JSON.parse(response.body)
|
171
190
|
|
172
|
-
parsed_response = JSON.parse(response.body)[0]
|
173
191
|
if parsed_response.key?('errors')
|
174
|
-
|
192
|
+
errors = parsed_response['errors'].map do |error|
|
193
|
+
msg = error.delete('message')
|
194
|
+
"#{msg} #{error.inspect}"
|
195
|
+
end
|
196
|
+
Interaction.fail <<~MSG.strip
|
197
|
+
API request failed:
|
198
|
+
#{errors.join("\n")}
|
199
|
+
MSG
|
175
200
|
else
|
176
|
-
|
201
|
+
print clear_loading_message
|
202
|
+
parsed_response.dig('data')
|
177
203
|
end
|
178
204
|
end
|
179
205
|
|
data/lib/geordi/settings.rb
CHANGED
@@ -110,7 +110,12 @@ module Geordi
|
|
110
110
|
def save_global_settings
|
111
111
|
global_path = GLOBAL_SETTINGS_FILE_NAME
|
112
112
|
global_directory = File.dirname(global_path)
|
113
|
-
|
113
|
+
|
114
|
+
unless File.directory?(global_directory)
|
115
|
+
require 'fileutils'
|
116
|
+
FileUtils.mkdir_p(global_directory)
|
117
|
+
end
|
118
|
+
|
114
119
|
File.open(global_path, 'w') do |file|
|
115
120
|
file.write @global_settings.to_yaml
|
116
121
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
|
+
autorequire:
|
8
9
|
bindir: exe
|
9
10
|
cert_chain: []
|
10
|
-
date: 2025-
|
11
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: thor
|
@@ -44,6 +45,7 @@ files:
|
|
44
45
|
- LICENSE
|
45
46
|
- README.md
|
46
47
|
- Rakefile
|
48
|
+
- cucumber.yml
|
47
49
|
- exe/b
|
48
50
|
- exe/dumple
|
49
51
|
- exe/geordi
|
@@ -107,6 +109,7 @@ metadata:
|
|
107
109
|
bug_tracker_uri: https://github.com/makandra/geordi/issues
|
108
110
|
changelog_uri: https://github.com/makandra/geordi/blob/master/CHANGELOG.md
|
109
111
|
rubygems_mfa_required: 'true'
|
112
|
+
post_install_message:
|
110
113
|
rdoc_options: []
|
111
114
|
require_paths:
|
112
115
|
- lib
|
@@ -121,7 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
124
|
- !ruby/object:Gem::Version
|
122
125
|
version: '0'
|
123
126
|
requirements: []
|
124
|
-
rubygems_version: 3.6
|
127
|
+
rubygems_version: 3.1.6
|
128
|
+
signing_key:
|
125
129
|
specification_version: 4
|
126
130
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails
|
127
131
|
and Linux at makandra.
|