bug_courier 0.1.2 → 1.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/README.md +13 -0
- data/lib/bug_courier/configuration.rb +2 -1
- data/lib/bug_courier/exception_handler.rb +10 -0
- data/lib/bug_courier/version.rb +1 -1
- data/lib/generators/bug_courier/install_generator.rb +6 -0
- 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: 06a59c97109d6c2be94e289fd37b08cab43775c9d5d2df0da6689e278cb29d78
|
|
4
|
+
data.tar.gz: 7cd768fbe85fbe9168ffc50eb5e63257abbf6a559d7740b0be588d5410a79582
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c5420222883243f061d091ec1cf676a9c2f8f8e6524a1a0b3247c76eff4968e031d3c93483bf697afb35cb4eda6b72002d630f4e4b919fbf5109b3fe8ca549a
|
|
7
|
+
data.tar.gz: 3e754802ec9770ebce2663c6944fbaf38289657bd02493de66e4212326c192d3cb534c4b86bde27f9f299d03d6fe3bc8231684c95e264c4d7fac1409fdc2f045
|
data/README.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
A Rails gem that automatically creates GitHub issues when uncaught exceptions occur. Includes deduplication (comments on existing open issues instead of creating duplicates), rate limiting, request context capture, and async reporting.
|
|
4
4
|
|
|
5
|
+
## Auto-Fix Bugs with GitHub Copilot
|
|
6
|
+
|
|
7
|
+
BugCourier turns your production exceptions into GitHub issues — and **GitHub Copilot can automatically fix them**.
|
|
8
|
+
|
|
9
|
+
When Copilot is enabled on your repository, it can pick up BugCourier-created issues (complete with backtraces, request context, and error fingerprints) and open pull requests with fixes. This creates a powerful loop:
|
|
10
|
+
|
|
11
|
+
1. An uncaught exception occurs in production
|
|
12
|
+
2. BugCourier creates a detailed GitHub issue with the full error context
|
|
13
|
+
3. Copilot reads the issue and opens a PR with a proposed fix
|
|
14
|
+
4. You review and merge
|
|
15
|
+
|
|
16
|
+
No manual triage. No copying stack traces. Just assign Copilot to BugCourier issues and let it work.
|
|
17
|
+
|
|
5
18
|
## Installation
|
|
6
19
|
|
|
7
20
|
Add to your Gemfile:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module BugCourier
|
|
4
4
|
class Configuration
|
|
5
5
|
attr_accessor :access_token, :repo, :labels, :assignees, :enabled,
|
|
6
|
-
:deduplicate, :rate_limit, :callback
|
|
6
|
+
:deduplicate, :rate_limit, :callback, :ignore_exceptions
|
|
7
7
|
|
|
8
8
|
def initialize
|
|
9
9
|
@access_token = nil
|
|
@@ -14,6 +14,7 @@ module BugCourier
|
|
|
14
14
|
@deduplicate = true
|
|
15
15
|
@rate_limit = 10 # max issues per hour
|
|
16
16
|
@callback = nil
|
|
17
|
+
@ignore_exceptions = []
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
def valid?
|
|
@@ -30,6 +30,7 @@ module BugCourier
|
|
|
30
30
|
def handle(exception, env = {})
|
|
31
31
|
return unless BugCourier.configuration.enabled
|
|
32
32
|
return unless BugCourier.configuration.valid?
|
|
33
|
+
return if ignored?(exception)
|
|
33
34
|
return unless @rate_limiter.allow?
|
|
34
35
|
|
|
35
36
|
title = build_title(exception)
|
|
@@ -137,5 +138,14 @@ module BugCourier
|
|
|
137
138
|
|
|
138
139
|
params.except("controller", "action").to_s.slice(0, 500)
|
|
139
140
|
end
|
|
141
|
+
|
|
142
|
+
def ignored?(exception)
|
|
143
|
+
BugCourier.configuration.ignore_exceptions.any? do |klass|
|
|
144
|
+
klass = Object.const_get(klass) if klass.is_a?(String)
|
|
145
|
+
exception.is_a?(klass)
|
|
146
|
+
rescue NameError
|
|
147
|
+
false
|
|
148
|
+
end
|
|
149
|
+
end
|
|
140
150
|
end
|
|
141
151
|
end
|
data/lib/bug_courier/version.rb
CHANGED
|
@@ -34,6 +34,12 @@ module BugCourier
|
|
|
34
34
|
# Maximum number of issues to create per hour (default: 10)
|
|
35
35
|
# config.rate_limit = 10
|
|
36
36
|
|
|
37
|
+
# Exception classes to ignore — these will not be reported (default: [])
|
|
38
|
+
# config.ignore_exceptions = [
|
|
39
|
+
# ActiveRecord::RecordNotFound,
|
|
40
|
+
# ActionController::RoutingError,
|
|
41
|
+
# ]
|
|
42
|
+
|
|
37
43
|
# Optional callback — called after issue creation or commenting
|
|
38
44
|
# config.callback = ->(action, issue) {
|
|
39
45
|
# Rails.logger.info("[BugCourier] \#{action}: \#{issue['html_url']}")
|