txray 0.2.0 → 0.2.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 +7 -0
- data/CONTRIBUTING.md +43 -0
- data/README.md +2 -0
- data/lib/txray/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '04384fde1e534819ca3055d82a586c3da880b2ea97aa49d8fbe2c3eaa0182beb'
|
|
4
|
+
data.tar.gz: d8b1dd217628ad5a12780cd295d27bdb7c934b10907443d6afe95726925c62f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4f2ed21c432a811623ddfae148e50cbdd54283b71fc663f5ca67750fdbe5710c5810ec6ee2c64bc9ce134de420b0195f7f30e8ab0c5c1c54cdcfc2522567791f
|
|
7
|
+
data.tar.gz: 4eab65e95a199496556e0569667b09e414205e0bd8f21fd25af58636ff21a3107ca33b413789a00a8f55d6e4470181b03811e711a02bb007a65d561dfa05b6cc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
Nothing in the analyzer, the runtime guard or the reporters changed. This release exists to exercise the publishing pipeline on something low stakes before a release that matters.
|
|
6
|
+
|
|
7
|
+
- Releases are now published by GitHub Actions through RubyGems trusted publishing, so no API key is created, pasted or stored. Merging a version bump tags the commit, runs the suite, publishes the gem and creates the GitHub release with the notes taken from this file.
|
|
8
|
+
- Corrected the release steps in `CONTRIBUTING.md`, which told contributors to push a version bump straight to a protected `main`.
|
|
9
|
+
|
|
3
10
|
## 0.2.0
|
|
4
11
|
|
|
5
12
|
- Track clients held in local variables, instance variables, constants, memoized readers and `delegate` targets, so the request is reported rather than the harmless construction.
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
```sh
|
|
4
|
+
bin/setup
|
|
5
|
+
bundle exec rake # specs and rubocop
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Adding a rule
|
|
9
|
+
|
|
10
|
+
A rule is three things and a test.
|
|
11
|
+
|
|
12
|
+
1. `Rules.register` in `lib/txray/rule.rb`, with the severity, what the reader sees, and the fix.
|
|
13
|
+
2. A branch in `lib/txray/classifier.rb`, or a namespace in `lib/txray/catalog.rb` if the call is recognised by its receiver.
|
|
14
|
+
3. A scenario in `spec/txray/scenarios_spec.rb` that proves it fires, and one that proves it stays quiet on the shape it should ignore.
|
|
15
|
+
|
|
16
|
+
The second test matters more than the first. A rule that fires on correct code costs more than a rule that misses.
|
|
17
|
+
|
|
18
|
+
## Adding a transactional scope
|
|
19
|
+
|
|
20
|
+
`lib/txray/transaction_scope.rb` decides what counts as being inside a transaction. Anything added there needs a case showing that the corresponding commit-time callback is still left alone.
|
|
21
|
+
|
|
22
|
+
## Testing against other Rails versions
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
RAILS_VERSION=7.1 bundle install && RAILS_VERSION=7.1 bundle exec rspec
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
CI runs 7.1, 7.2 and 8.0 alongside Ruby 3.2, 3.3 and 3.4.
|
|
29
|
+
|
|
30
|
+
## Before opening a pull request
|
|
31
|
+
|
|
32
|
+
Run the scanner against a real application, not only the suite. False positives are the failure mode that matters, and they show up in real code long before they show up in fixtures.
|
|
33
|
+
|
|
34
|
+
## Releasing
|
|
35
|
+
|
|
36
|
+
Merging a version bump releases the gem. There is nothing to run by hand.
|
|
37
|
+
|
|
38
|
+
1. On a branch, bump `Txray::VERSION` in `lib/txray/version.rb` and add a `## x.y.z` section to `CHANGELOG.md`.
|
|
39
|
+
2. Open the pull request and merge it once CI is green.
|
|
40
|
+
|
|
41
|
+
On every push to `main` the release workflow reads `Txray::VERSION` and stops immediately if that version is already tagged, so ordinary merges do nothing. When the version is new it takes the release notes from the matching changelog section, runs the suite, tags the commit, publishes the gem to RubyGems through trusted publishing, and creates the GitHub release with the notes and the built gem attached.
|
|
42
|
+
|
|
43
|
+
The tag is created locally and only pushed once the gem is published, so a failure leaves nothing behind: fix it and merge again. A missing changelog section fails before the suite even runs. No API key is involved anywhere.
|
data/README.md
CHANGED
data/lib/txray/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: txray
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Theo Wecker
|
|
@@ -37,6 +37,7 @@ extensions: []
|
|
|
37
37
|
extra_rdoc_files: []
|
|
38
38
|
files:
|
|
39
39
|
- CHANGELOG.md
|
|
40
|
+
- CONTRIBUTING.md
|
|
40
41
|
- LICENSE.txt
|
|
41
42
|
- README.md
|
|
42
43
|
- Rakefile
|
|
@@ -98,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
98
99
|
- !ruby/object:Gem::Version
|
|
99
100
|
version: '0'
|
|
100
101
|
requirements: []
|
|
101
|
-
rubygems_version:
|
|
102
|
+
rubygems_version: 3.6.9
|
|
102
103
|
specification_version: 4
|
|
103
104
|
summary: Static analysis that finds slow work hidden inside database transactions.
|
|
104
105
|
test_files: []
|