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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 877f72a744295aab29d7782564f80dc3cc849c8edc9be48f906d4a0b649d4b50
4
- data.tar.gz: 564602e02fb9a9452908ae2de23ac47e731050c84dd30b0b55996e24114b49e6
3
+ metadata.gz: b89224f3bcb9eb69b009ea2f9ac7c4c95670130dc71aaa9bd001ef146f015b27
4
+ data.tar.gz: 051e79e4933a9150de8dd9383d8ccaa8550ba9ddc12424808c1dab60f61d8af6
5
5
  SHA512:
6
- metadata.gz: fcdaa759b4b22db34d4914522502b7e6fa7815ebd0e75746a604f8bffc1f4e2c8c467ec6b17399ac212dea93aed24a1c65dab9364040eacc69878bd3c73d254e
7
- data.tar.gz: 12adad1cc8c2f9ab03548f5257ebc63b46f7adb7378336ef95571d46df1f184edf77a5e1ce860726f3dd82239efddfc4f842c1a6b6331c8cb072e2133db4ec57
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 (Read-Only)
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:** Issues are **read-only** via the API. You cannot update status, resolve, or add comments through the CLI.
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
- error('Team UUID required') && exit(1) unless uuid
95
- parse_format_options!(args[1..])
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
- error('Project ID required') && exit(1) unless id
132
- parse_format_options!(args[1..])
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
- error('Issue UUID required') && exit(1) unless uuid
182
- parse_format_options!(args[1..])
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
- error('Event UUID required') && exit(1) unless uuid
205
- parse_format_options!(args[1..])
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
- error('Release UUID required') && exit(1) unless uuid
230
- parse_format_options!(args[1..])
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 (read-only)
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: Issues and Events are READ-ONLY via the API. Write operations are not supported.
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 (READ-ONLY)
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: Issues are READ-ONLY. No write operations available in API.
548
+ Note: Resolve returns 409 if the issue is already resolved.
512
549
  HELP
513
550
  when 'events'
514
551
  puts <<~HELP
@@ -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 = {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bugsink
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsink-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Kopernik