ask-sentry 0.1.0 → 0.1.2

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: fc6dc184f307c3a0661dbc52d48c8caee86d7a5309ca627993cd37312686509f
4
- data.tar.gz: 5e7484e41f6915948497575f26a28d681da5665fee6f796189498458f4bb1d09
3
+ metadata.gz: c459eb70d05be7c610124e9f19253867d23cb9e729b3bd091d710d95e6483a19
4
+ data.tar.gz: abcc7d0d55dcdda71dbb36217236e3f9f0055466d57be5d8b35f564db2f22c71
5
5
  SHA512:
6
- metadata.gz: 4e2f9dce7c5a47978ecd41fe1696111472158c1e8e5c4f62db6b7d926483a91e8188267b8b27254e422d71d4e3a4831920020da7489a005cfdec816219c4a5d6
7
- data.tar.gz: 3ef0390e2ffa88cc75fdb6b1df2260c1da15a1e5c05548e5f4547899fd05c761309db5b03408835b2c826d9de0c8db420ce54d4f19f53305ad246012e3b9e228
6
+ metadata.gz: 9dfde1d5ea4914ac95c0cf839c3a1d97a6be838d9df6977f3c811d12b4a38abb8fff42f7b47af9677afd25f6d6f9725144d066e0f673429c8e607720939e764d
7
+ data.tar.gz: 54d3a356e91e1f3ffb19fdf05b7d0840edd60ce86007cc5b2036adff7c7cdcd092b1a56e9e2c386d8ec5f5c43e6e54ff542a5087f019d4de11c7df7d77b40357
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.1.2] - 2026-06-25
2
+
3
+ ### Changed
4
+ - Gemspec validation test. Infrastructure: rubocop, overcommit, bin/setup, CI matrix. VCR rake tasks.
1
5
  # Changelog
2
6
 
3
7
  ## 0.1.0 (2026-06-10)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Sentry
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: sentry.use_sentry
3
+ description: How to navigate the Sentry API — fetch issues, events, and error details
4
+ ---
5
+
6
+ Use this skill when you need to interact with Sentry — reviewing error issues,
7
+ checking event details, or debugging production errors.
8
+
9
+ ## Step 1: Get the Client
10
+
11
+ ```ruby
12
+ client = Ask::Sentry.client
13
+ ```
14
+
15
+ This returns an authenticated `Faraday::Connection` pointed at
16
+ `https://sentry.io/api/0/`. It expects a valid Sentry auth token resolved
17
+ via `Ask::Auth.resolve(:sentry_token)`.
18
+
19
+ ## Step 2: Explore the Context
20
+
21
+ ```ruby
22
+ Ask::Sentry::Context::DOCS_URL # Sentry API docs
23
+ Ask::Sentry::Context::QUICK_START # Copy-paste examples
24
+ ```
25
+
26
+ The `QUICK_START` has examples for listing issues and events.
27
+
28
+ ## Step 3: Use Convenience Helpers First
29
+
30
+ The gem ships with helpers for the most common operations:
31
+
32
+ ```ruby
33
+ # Recent errors for a project
34
+ issues = Ask::Sentry.recent_errors(organization: "myorg", project: "myapp", limit: 10)
35
+
36
+ # Events for a specific issue
37
+ events = Ask::Sentry.issue_events(ISSUE_ID, limit: 10)
38
+ ```
39
+
40
+ ## Step 4: Raw API Calls
41
+
42
+ For endpoints without convenience helpers:
43
+
44
+ ```ruby
45
+ client = Ask::Sentry.client
46
+
47
+ # List projects
48
+ client.get("projects/")
49
+
50
+ # List issues for a project
51
+ client.get("projects/ORG/PROJECT/issues/", limit: 20, query: "is:unresolved")
52
+
53
+ # Get event details
54
+ client.get("issues/ISSUE_ID/events/latest/")
55
+
56
+ # List releases
57
+ client.get("projects/ORG/PROJECT/releases/")
58
+ ```
59
+
60
+ Sentry's API uses path parameters — the base URL already includes `/api/0/`.
61
+
62
+ ## Step 5: Authentication & Common Errors
63
+
64
+ ```ruby
65
+ Ask::Sentry::Errors.status_code_description(401)
66
+ Ask::Sentry::Errors.status_code_description(429)
67
+ ```
68
+
69
+ Common scenarios:
70
+ - **401**: Token invalid or revoked → regenerate at Sentry auth token settings
71
+ - **403**: Token lacks scope → check token permissions
72
+ - **404**: Wrong org/project slug → verify slugs in Sentry dashboard
73
+ - **429**: Rate limited → wait and retry (Faraday auto-retries 3 times)
74
+
75
+ ## Step 6: Fallback Strategy
76
+
77
+ 1. Reference `Ask::Sentry::Context::DOCS_URL` for the full API reference
78
+ 2. Sentry's API is REST + JSON — standard GET requests with URL path parameters
79
+ 3. Organization and project slugs are required for most endpoints — get them
80
+ from the Sentry dashboard URL (`/organizations/{ORG}/projects/{PROJECT}/`)
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :vcr do
4
+ desc "Record VCR cassettes for a specific provider"
5
+ task :record, [:provider] do |_t, args|
6
+ provider = args[:provider] || "all"
7
+ cassette_dir = File.expand_path("../../test/cassettes", __dir__)
8
+
9
+ if provider == "all"
10
+ puts "Removing all cassettes..."
11
+ FileUtils.rm_rf(Dir[File.join(cassette_dir, "*.yml")])
12
+ else
13
+ puts "Removing cassettes for #{provider}..."
14
+ FileUtils.rm_rf(Dir[File.join(cassette_dir, "*#{provider}*.yml")])
15
+ end
16
+
17
+ puts "Running tests to re-record cassettes..."
18
+ system("bundle exec rake test")
19
+ end
20
+
21
+ desc "Verify cassettes are fresh (less than 30 days old)"
22
+ task :verify_freshness do
23
+ cassette_dir = File.expand_path("../../test/cassettes", __dir__)
24
+ stale = false
25
+
26
+ Dir[File.join(cassette_dir, "*.yml")].each do |cassette|
27
+ age_days = (Time.now - File.mtime(cassette)) / 86400.0
28
+ if age_days > 30
29
+ puts "STALE: #{File.basename(cassette)} is #{age_days.round(1)} days old"
30
+ stale = true
31
+ end
32
+ end
33
+
34
+ if stale
35
+ puts "\nSome cassettes are older than 30 days. Re-record them with:"
36
+ puts " bundle exec rake vcr:record[all]"
37
+ exit 1
38
+ else
39
+ puts "All cassettes are fresh (less than 30 days old)."
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-sentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -13,28 +13,28 @@ dependencies:
13
13
  name: ask-core
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: '0.1'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: '0.1'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ask-auth
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - "~>"
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0.1'
40
40
  - !ruby/object:Gem::Dependency
@@ -150,10 +150,13 @@ files:
150
150
  - lib/ask/sentry/context.rb
151
151
  - lib/ask/sentry/error_guide.rb
152
152
  - lib/ask/sentry/version.rb
153
+ - lib/ask/skills/sentry.use_sentry/SKILL.md
154
+ - lib/tasks/vcr.rake
153
155
  homepage: https://github.com/ask-rb/ask-sentry
154
156
  licenses:
155
157
  - MIT
156
158
  metadata:
159
+ homepage_uri: https://github.com/ask-rb/ask-sentry
157
160
  source_code_uri: https://github.com/ask-rb/ask-sentry
158
161
  changelog_uri: https://github.com/ask-rb/ask-sentry/blob/main/CHANGELOG.md
159
162
  rdoc_options: []