bugsink-cli 0.1.1 → 0.1.3
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/README.md +9 -3
- data/lib/bugsink/cli.rb +52 -15
- data/lib/bugsink/client.rb +6 -0
- data/lib/bugsink/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: b89224f3bcb9eb69b009ea2f9ac7c4c95670130dc71aaa9bd001ef146f015b27
|
|
4
|
+
data.tar.gz: 051e79e4933a9150de8dd9383d8ccaa8550ba9ddc12424808c1dab60f61d8af6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd7e41a833fbbf36c268b731128a27335321496f2b90a6dec08e83e4788f244bea60ee1cac43117ecd3ab771d535af5f908f448402cd0ba663f8a32990ee1678
|
|
7
|
+
data.tar.gz: 8ca173e5b7280f9940dd57bcc157771f05319a1378c0a902ea94f9bade34f4bf0e9edd4d0952fb412f8892465c501179bbb22639b43f912c20dbc0cf18cfafeb
|
data/README.md
CHANGED
|
@@ -126,7 +126,7 @@ bugsink projects create '{
|
|
|
126
126
|
bugsink projects update <id> '{"name":"New Name","alert_on_new_issue":false}'
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
#### Issues
|
|
129
|
+
#### Issues
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
132
|
# List issues for a project
|
|
@@ -137,9 +137,12 @@ bugsink issues list --project=<id> \
|
|
|
137
137
|
|
|
138
138
|
# Get issue details
|
|
139
139
|
bugsink issues get <uuid> [--json]
|
|
140
|
+
|
|
141
|
+
# Resolve an issue
|
|
142
|
+
bugsink issues resolve <uuid> [--json]
|
|
140
143
|
```
|
|
141
144
|
|
|
142
|
-
**Note:**
|
|
145
|
+
**Note:** The `resolve` command requires [bugsink-fork](https://github.com/landovsky/bugsink-fork), which adds the resolve API endpoint. Using it against upstream BugSink will return a 404 error.
|
|
143
146
|
|
|
144
147
|
#### Events (Read-Only)
|
|
145
148
|
|
|
@@ -266,11 +269,11 @@ ee4f4572-0957-4346-b433-3c605acbfa2a
|
|
|
266
269
|
|
|
267
270
|
- **Teams:** Create, Update
|
|
268
271
|
- **Projects:** Create, Update
|
|
272
|
+
- **Issues:** Resolve (requires [bugsink-fork](https://github.com/landovsky/bugsink-fork))
|
|
269
273
|
- **Releases:** Create
|
|
270
274
|
|
|
271
275
|
### Read-Only Resources
|
|
272
276
|
|
|
273
|
-
- **Issues:** Cannot update status, resolve, or add comments
|
|
274
277
|
- **Events:** Created automatically via Sentry SDK ingestion only
|
|
275
278
|
|
|
276
279
|
### Not Supported
|
|
@@ -297,6 +300,9 @@ teams = response.data
|
|
|
297
300
|
# Get project
|
|
298
301
|
project = client.project_get(8)
|
|
299
302
|
|
|
303
|
+
# Resolve an issue (requires bugsink-fork)
|
|
304
|
+
issue = client.issue_resolve('issue-uuid')
|
|
305
|
+
|
|
300
306
|
# Create release
|
|
301
307
|
release = client.release_create(
|
|
302
308
|
project_id: 8,
|
data/lib/bugsink/cli.rb
CHANGED
|
@@ -91,8 +91,11 @@ module Bugsink
|
|
|
91
91
|
output_list(response.data, format: @options[:format])
|
|
92
92
|
when 'get'
|
|
93
93
|
uuid = args[0]
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
unless uuid
|
|
95
|
+
error('Team UUID required')
|
|
96
|
+
exit 1
|
|
97
|
+
end
|
|
98
|
+
parse_format_options!(args[1..] || [])
|
|
96
99
|
team = @client.team_get(uuid)
|
|
97
100
|
output_single(team, format: @options[:format])
|
|
98
101
|
when 'create'
|
|
@@ -128,8 +131,11 @@ module Bugsink
|
|
|
128
131
|
output_list(response.data, format: @options[:format])
|
|
129
132
|
when 'get'
|
|
130
133
|
id = args[0]
|
|
131
|
-
|
|
132
|
-
|
|
134
|
+
unless id
|
|
135
|
+
error('Project ID required')
|
|
136
|
+
exit 1
|
|
137
|
+
end
|
|
138
|
+
parse_format_options!(args[1..] || [])
|
|
133
139
|
project = @client.project_get(id.to_i)
|
|
134
140
|
output_single(project, format: @options[:format])
|
|
135
141
|
when 'create'
|
|
@@ -178,13 +184,25 @@ module Bugsink
|
|
|
178
184
|
output_list(response.data, format: @options[:format])
|
|
179
185
|
when 'get'
|
|
180
186
|
uuid = args[0]
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
unless uuid
|
|
188
|
+
error('Issue UUID required')
|
|
189
|
+
exit 1
|
|
190
|
+
end
|
|
191
|
+
parse_format_options!(args[1..] || [])
|
|
183
192
|
issue = @client.issue_get(uuid)
|
|
184
193
|
output_single(issue, format: @options[:format])
|
|
194
|
+
when 'resolve'
|
|
195
|
+
uuid = args[0]
|
|
196
|
+
unless uuid
|
|
197
|
+
error('Issue UUID required')
|
|
198
|
+
exit 1
|
|
199
|
+
end
|
|
200
|
+
parse_format_options!(args[1..] || [])
|
|
201
|
+
issue = @client.issue_resolve(uuid)
|
|
202
|
+
output_single(issue, format: @options[:format])
|
|
203
|
+
success("Issue #{uuid} resolved")
|
|
185
204
|
else
|
|
186
205
|
error("Unknown issues action: #{action}")
|
|
187
|
-
info('Note: Issues are read-only. Write operations not available in API.')
|
|
188
206
|
exit 1
|
|
189
207
|
end
|
|
190
208
|
end
|
|
@@ -201,8 +219,11 @@ module Bugsink
|
|
|
201
219
|
output_list(response.data, format: @options[:format])
|
|
202
220
|
when 'get'
|
|
203
221
|
uuid = args[0]
|
|
204
|
-
|
|
205
|
-
|
|
222
|
+
unless uuid
|
|
223
|
+
error('Event UUID required')
|
|
224
|
+
exit 1
|
|
225
|
+
end
|
|
226
|
+
parse_format_options!(args[1..] || [])
|
|
206
227
|
event = @client.event_get(uuid)
|
|
207
228
|
output_single(event, format: @options[:format])
|
|
208
229
|
when 'stacktrace'
|
|
@@ -226,8 +247,11 @@ module Bugsink
|
|
|
226
247
|
output_list(response.data, format: @options[:format])
|
|
227
248
|
when 'get'
|
|
228
249
|
uuid = args[0]
|
|
229
|
-
|
|
230
|
-
|
|
250
|
+
unless uuid
|
|
251
|
+
error('Release UUID required')
|
|
252
|
+
exit 1
|
|
253
|
+
end
|
|
254
|
+
parse_format_options!(args[1..] || [])
|
|
231
255
|
release = @client.release_get(uuid)
|
|
232
256
|
output_single(release, format: @options[:format])
|
|
233
257
|
when 'create'
|
|
@@ -246,6 +270,8 @@ module Bugsink
|
|
|
246
270
|
end
|
|
247
271
|
|
|
248
272
|
def parse_format_options!(args)
|
|
273
|
+
return if args.nil? || args.empty?
|
|
274
|
+
|
|
249
275
|
OptionParser.new do |opts|
|
|
250
276
|
opts.on('--json', 'Output as JSON') { @options[:format] = 'json' }
|
|
251
277
|
opts.on('--quiet', 'Minimal output') { @options[:format] = 'quiet' }
|
|
@@ -253,6 +279,8 @@ module Bugsink
|
|
|
253
279
|
end
|
|
254
280
|
|
|
255
281
|
def parse_project_options!(args)
|
|
282
|
+
return if args.nil? || args.empty?
|
|
283
|
+
|
|
256
284
|
OptionParser.new do |opts|
|
|
257
285
|
opts.on('--team=UUID', 'Filter by team UUID') { |v| @options[:team] = v }
|
|
258
286
|
opts.on('--json', 'Output as JSON') { @options[:format] = 'json' }
|
|
@@ -261,6 +289,8 @@ module Bugsink
|
|
|
261
289
|
end
|
|
262
290
|
|
|
263
291
|
def parse_issue_options!(args)
|
|
292
|
+
return if args.nil? || args.empty?
|
|
293
|
+
|
|
264
294
|
OptionParser.new do |opts|
|
|
265
295
|
opts.on('--project=ID', 'Project ID') { |v| @options[:project_id] = v.to_i }
|
|
266
296
|
opts.on('--sort=FIELD', 'Sort field') { |v| @options[:sort] = v }
|
|
@@ -271,6 +301,8 @@ module Bugsink
|
|
|
271
301
|
end
|
|
272
302
|
|
|
273
303
|
def parse_event_options!(args)
|
|
304
|
+
return if args.nil? || args.empty?
|
|
305
|
+
|
|
274
306
|
OptionParser.new do |opts|
|
|
275
307
|
opts.on('--issue=UUID', 'Issue UUID (required)') { |v| @options[:issue] = v }
|
|
276
308
|
opts.on('--order=ORDER', 'Sort order (asc|desc)') { |v| @options[:order] = v }
|
|
@@ -280,6 +312,8 @@ module Bugsink
|
|
|
280
312
|
end
|
|
281
313
|
|
|
282
314
|
def parse_release_options!(args)
|
|
315
|
+
return if args.nil? || args.empty?
|
|
316
|
+
|
|
283
317
|
OptionParser.new do |opts|
|
|
284
318
|
opts.on('--project=ID', 'Project ID') { |v| @options[:project_id] = v.to_i }
|
|
285
319
|
opts.on('--json', 'Output as JSON') { @options[:format] = 'json' }
|
|
@@ -366,7 +400,7 @@ module Bugsink
|
|
|
366
400
|
config - Configuration management
|
|
367
401
|
teams - Team operations
|
|
368
402
|
projects - Project operations
|
|
369
|
-
issues - Issue operations
|
|
403
|
+
issues - Issue operations
|
|
370
404
|
events - Event operations (read-only)
|
|
371
405
|
releases - Release operations
|
|
372
406
|
|
|
@@ -388,6 +422,7 @@ module Bugsink
|
|
|
388
422
|
|
|
389
423
|
bugsink issues list --project=<id> List issues for project
|
|
390
424
|
bugsink issues get <uuid> Get issue details
|
|
425
|
+
bugsink issues resolve <uuid> Resolve an issue
|
|
391
426
|
|
|
392
427
|
bugsink events list --issue=<uuid> List events for issue
|
|
393
428
|
bugsink events stacktrace <uuid> Get formatted stacktrace
|
|
@@ -418,7 +453,7 @@ module Bugsink
|
|
|
418
453
|
# Get stacktrace for an event
|
|
419
454
|
bugsink events stacktrace <event-uuid>
|
|
420
455
|
|
|
421
|
-
Note:
|
|
456
|
+
Note: Events are READ-ONLY via the API.
|
|
422
457
|
HELP
|
|
423
458
|
end
|
|
424
459
|
|
|
@@ -493,11 +528,12 @@ module Bugsink
|
|
|
493
528
|
HELP
|
|
494
529
|
when 'issues'
|
|
495
530
|
puts <<~HELP
|
|
496
|
-
bugsink issues - Issue operations
|
|
531
|
+
bugsink issues - Issue operations
|
|
497
532
|
|
|
498
533
|
Actions:
|
|
499
534
|
list --project=<id> [--sort=<field>] [--order=<asc|desc>]
|
|
500
535
|
get <uuid>
|
|
536
|
+
resolve <uuid>
|
|
501
537
|
|
|
502
538
|
Options:
|
|
503
539
|
--project=<id> Project ID (required for list)
|
|
@@ -507,8 +543,9 @@ module Bugsink
|
|
|
507
543
|
Examples:
|
|
508
544
|
bugsink issues list --project=8 --sort=last_seen --order=desc
|
|
509
545
|
bugsink issues get <uuid> --json
|
|
546
|
+
bugsink issues resolve <uuid>
|
|
510
547
|
|
|
511
|
-
Note:
|
|
548
|
+
Note: Resolve returns 409 if the issue is already resolved.
|
|
512
549
|
HELP
|
|
513
550
|
when 'events'
|
|
514
551
|
puts <<~HELP
|
data/lib/bugsink/client.rb
CHANGED
|
@@ -165,6 +165,12 @@ module Bugsink
|
|
|
165
165
|
response.parsed_response
|
|
166
166
|
end
|
|
167
167
|
|
|
168
|
+
def issue_resolve(uuid)
|
|
169
|
+
response = self.class.post("/api/canonical/0/issues/#{uuid}/resolve/")
|
|
170
|
+
check_response(response)
|
|
171
|
+
response.parsed_response
|
|
172
|
+
end
|
|
173
|
+
|
|
168
174
|
# Events
|
|
169
175
|
def events_list(issue_uuid:, order: 'desc', limit: 250, cursor: nil)
|
|
170
176
|
query = {
|
data/lib/bugsink/version.rb
CHANGED