hawk-ruby 0.1.0 → 0.1.1
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 +26 -1
- data/README.md +26 -28
- data/docs/public-api.md +33 -0
- data/docs/releasing.md +7 -4
- data/lib/hawk/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9a71442090adcd7b76fdf5ea4de73e23c32dd4fd1d2c16320b6bea56cb8f729
|
|
4
|
+
data.tar.gz: 3a5be0475ee73759a6413a7ab1883892a08562c2f683bd1f5973276aab542207
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7eb5a415bc25de6ecbb8febc98d950dcc1a7af93efaf62d54ca3b00edd9a18933c8b0b4a5f0de3631c80f362df19704d48f23770f738e0576e4223ff8bad62d2
|
|
7
|
+
data.tar.gz: 9fd1d563a3e681d6919d18cc505b755a0b9469d8fc90fc2e66bc97f8a7466e4a145da2a1e2678c305f444a8cb6f433390115bc58bed3524e3c4a24c68496d276
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project are documented here, following [Keep a Changelog 2.0.0](https://keepachangelog.com/en/2.0.0/).
|
|
4
|
+
|
|
5
|
+
Versions follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) for the [declared public API](docs/public-api.md).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.1] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Document the public API, contribution process, and private reporting channels.
|
|
14
|
+
- Publish an inventory of the packaged files and runtime requirements, with signed provenance for release assets.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Clarify installation, first capture, and default privacy controls.
|
|
19
|
+
- Require approval before publication and upload provenance with the gem to RubyGems.
|
|
20
|
+
- Check pull requests for new dependency vulnerabilities and report existing findings each week.
|
|
21
|
+
|
|
22
|
+
## [0.1.0] - 2026-10-29
|
|
4
23
|
|
|
5
24
|
Initial release of the Hawk Ruby error reporting gem.
|
|
6
25
|
|
|
26
|
+
### Added
|
|
27
|
+
|
|
7
28
|
- Report exceptions and messages with backtraces, source snippets, breadcrumbs, user data, context, severity, and application release identifiers.
|
|
8
29
|
- Add optional Rack, Rails, Rails error reporter, Action Cable, Active Job, Solid Queue, Sidekiq, Resque, Delayed Job, and Rake integration.
|
|
9
30
|
- Provide bounded asynchronous delivery, execution-local scopes, duplicate suppression, fork recovery, privacy filters, and event hooks.
|
|
10
31
|
- Ship RBS signatures and enforce complete type coverage, 100% line and branch coverage, and measured CRAP scores no greater than 10.
|
|
32
|
+
|
|
33
|
+
[Unreleased]: https://github.com/svyatov/hawk.ruby/compare/v0.1.1...HEAD
|
|
34
|
+
[0.1.1]: https://github.com/svyatov/hawk.ruby/compare/v0.1.0...v0.1.1
|
|
35
|
+
[0.1.0]: https://github.com/svyatov/hawk.ruby/releases/tag/v0.1.0
|
data/README.md
CHANGED
|
@@ -2,51 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
Ruby error reporting for [Hawk](https://hawk.so), with optional Rails and background job integrations.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Runs on CRuby 3.3 or later, with optional Rails and background job adapters.
|
|
6
|
+
- Built for Hawk: sends events directly to its native collector without a forwarding service.
|
|
7
|
+
- The default client bounds delivery to one background thread and a queue of 100 events.
|
|
8
|
+
- Excludes request bodies, headers, cookies, and job arguments by default.
|
|
6
9
|
|
|
7
10
|
## Install
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```ruby
|
|
12
|
-
gem "hawk-ruby", "~> 0.1.0", require: "hawk"
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
bundle install
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
To test a built artifact locally:
|
|
12
|
+
Run this command from your application's directory, which must contain a Gemfile:
|
|
20
13
|
|
|
21
14
|
```sh
|
|
22
|
-
|
|
23
|
-
gem install ./hawk-ruby-0.1.0.gem
|
|
15
|
+
bundle add hawk-ruby --version "~> 0.1.1" --require hawk
|
|
24
16
|
```
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Configure and capture
|
|
29
|
-
|
|
30
|
-
Copy the integration token from your Hawk project into `HAWK_TOKEN`.
|
|
18
|
+
Copy the integration token from your Hawk project into `HAWK_TOKEN`. Save this example as `report.rb`:
|
|
31
19
|
|
|
32
20
|
```ruby
|
|
33
21
|
require "hawk"
|
|
34
22
|
|
|
35
23
|
Hawk.init do |config|
|
|
36
24
|
config.token = ENV.fetch("HAWK_TOKEN")
|
|
37
|
-
config.release = ENV["HAWK_RELEASE"]
|
|
38
25
|
end
|
|
39
26
|
|
|
27
|
+
Hawk.capture_message("Hello from Ruby") # => String capture ID when accepted
|
|
28
|
+
Hawk.flush(timeout: 5.0) # => true when pending delivery attempts finish
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run it with `bundle exec ruby report.rb`. A capture ID confirms local acceptance; it does not confirm receipt by Hawk.
|
|
32
|
+
|
|
33
|
+
## Configure and capture
|
|
34
|
+
|
|
35
|
+
After Hawk initialization, add this example to your application's `checkout.rb`:
|
|
36
|
+
|
|
37
|
+
```ruby
|
|
40
38
|
Hawk.set_context(component: "checkout")
|
|
41
39
|
Hawk.set_user(id: "customer-42")
|
|
42
40
|
Hawk.add_breadcrumb(message: "Payment started", category: "checkout")
|
|
43
|
-
|
|
44
|
-
Hawk.capture do
|
|
45
|
-
perform_checkout
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Hawk.capture_message("Checkout recovered", level: :warning)
|
|
49
|
-
Hawk.flush(timeout: 5.0)
|
|
41
|
+
Hawk.capture { raise "Checkout failed" } # raises RuntimeError after reporting
|
|
50
42
|
```
|
|
51
43
|
|
|
52
44
|
`Hawk.capture` reports an escaping exception and raises the same exception again. You can also call `Hawk.capture_exception(error)` from a rescue handler.
|
|
@@ -59,7 +51,7 @@ Use `require: "hawk/rails"` in your Gemfile for Rails. Initialize Hawk in `confi
|
|
|
59
51
|
|
|
60
52
|
Rails enables request capture, `Rails.error`, Action Cable, Active Job, and safe notification breadcrumbs. Solid Queue works through Active Job.
|
|
61
53
|
|
|
62
|
-
|
|
54
|
+
Add the relevant adapter requires to your application's startup file:
|
|
63
55
|
|
|
64
56
|
```ruby
|
|
65
57
|
require "hawk/rack"
|
|
@@ -102,3 +94,9 @@ Use `bundle exec rake check:complexity` for local complexity feedback without co
|
|
|
102
94
|
## License
|
|
103
95
|
|
|
104
96
|
MIT. See [LICENSE](LICENSE).
|
|
97
|
+
|
|
98
|
+
## Help and maintenance
|
|
99
|
+
|
|
100
|
+
Leonid Svyatov maintains Hawk Ruby. Use [GitHub issues](https://github.com/svyatov/hawk.ruby/issues) for questions and defect reports.
|
|
101
|
+
|
|
102
|
+
Read the [changelog](CHANGELOG.md) for releases and the [contributing guide](CONTRIBUTING.md) to propose a change.
|
data/docs/public-api.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Public API and compatibility
|
|
2
|
+
|
|
3
|
+
Hawk Ruby uses [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) for the interfaces described here.
|
|
4
|
+
|
|
5
|
+
## Supported interfaces
|
|
6
|
+
|
|
7
|
+
The public API includes:
|
|
8
|
+
|
|
9
|
+
- The `Hawk` methods documented in the [README](../README.md): initialization, capture, context, user, breadcrumbs, scopes, flushing, and closing.
|
|
10
|
+
- Configuration settings, hooks, diagnostics counters, and lifecycle behavior documented in [configuration](configuration.md).
|
|
11
|
+
- Independent clients created with `Hawk::Configuration.new` and `Hawk::Client.build`, using the capture, context, scope, flush, and close methods documented there.
|
|
12
|
+
- `Hawk::Scope#set_context` and `Hawk::Scope#set_user` inside a `with_scope` block.
|
|
13
|
+
- The `Hawk::ConfigurationError` exception for invalid configuration.
|
|
14
|
+
- Require paths, supported runtime and framework versions, and adapter behavior documented in [integrations](integrations.md).
|
|
15
|
+
- The documented job-context format and its producer/consumer compatibility requirements.
|
|
16
|
+
|
|
17
|
+
Other classes, helper methods, internal event construction, and the exact text of error or diagnostic messages are implementation details. Their presence in Ruby signatures does not make them supported interfaces.
|
|
18
|
+
|
|
19
|
+
## Version increments
|
|
20
|
+
|
|
21
|
+
Before version 1.0.0, incompatible public API changes increment the minor version. Compatible additions and fixes increment the patch version.
|
|
22
|
+
|
|
23
|
+
From version 1.0.0, incompatible changes increment the major version. Compatible additions and deprecations increment the minor version; compatible fixes increment the patch version.
|
|
24
|
+
|
|
25
|
+
Raising the minimum supported Ruby or framework version is an incompatible change.
|
|
26
|
+
|
|
27
|
+
## Deprecation and removal
|
|
28
|
+
|
|
29
|
+
A public interface remains usable for at least one released version after its deprecation. The notice names its replacement or migration path and earliest removal version.
|
|
30
|
+
|
|
31
|
+
Deprecations appear in the changelog and through the affected interface when a runtime notice can reach the caller without exposing private data.
|
|
32
|
+
|
|
33
|
+
Before 1.0.0, removal waits for a later minor release. From 1.0.0, deprecation ships in a minor release and removal waits for a later major release.
|
data/docs/releasing.md
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The `release.yml` workflow publishes version tags after the complete CI matrix passes. The tag must match `Hawk::VERSION` and belong to `main`.
|
|
4
4
|
|
|
5
|
-
RubyGems trusts the `svyatov/hawk.ruby` repository, the `release.yml` workflow, and the `release` environment. The environment permits `v*` tags.
|
|
5
|
+
RubyGems trusts the `svyatov/hawk.ruby` repository, the `release.yml` workflow, and the `release` environment. The environment permits `v*` tags and requires approval from the maintainer before publication.
|
|
6
6
|
|
|
7
|
-
The workflow builds the gem once,
|
|
7
|
+
The workflow builds the gem once, inventories its packaged files and external runtime requirements in `sbom.cdx.json`, and stores the artifacts for 14 days. Tag-triggered checks install frozen dependencies without a Bundler cache. After approval, publishing signs and uploads the original gem with its provenance to RubyGems. The GitHub release contains the same gem, the inventory, and `SHA256SUMS`, with attestations covering the gem and inventory.
|
|
8
8
|
|
|
9
9
|
To cut a version:
|
|
10
10
|
|
|
11
11
|
1. Update the version, changelog, and installation example. Run the checks and merge to `main`.
|
|
12
|
-
2. Create
|
|
13
|
-
3. Push the tag with `git push origin v0.1.
|
|
12
|
+
2. Create a signed version tag, for example `git tag -s v0.1.1 -m 'Release 0.1.1'`.
|
|
13
|
+
3. Push the tag with `git push origin v0.1.1` and monitor the Release workflow.
|
|
14
|
+
4. Review the successful build and approve the `release` environment deployment.
|
|
15
|
+
|
|
16
|
+
To verify downloaded release assets, run `gh attestation verify hawk-ruby-0.1.1.gem --repo svyatov/hawk.ruby --signer-workflow svyatov/hawk.ruby/.github/workflows/release.yml`, then repeat for `sbom.cdx.json`. Run `sha256sum --check SHA256SUMS` from the download directory. RubyGems serves its gem attestation at `https://rubygems.org/api/v1/attestations/hawk-ruby-0.1.1.json`.
|
|
14
17
|
|
|
15
18
|
## Recover a partial publication
|
|
16
19
|
|
data/lib/hawk/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hawk-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Leonid Svyatov
|
|
@@ -121,6 +121,7 @@ files:
|
|
|
121
121
|
- README.md
|
|
122
122
|
- docs/configuration.md
|
|
123
123
|
- docs/integrations.md
|
|
124
|
+
- docs/public-api.md
|
|
124
125
|
- docs/releasing.md
|
|
125
126
|
- docs/verification.md
|
|
126
127
|
- lib/hawk.rb
|