Skip to content

Commit 6ff136d

Browse files
committed
Merge branch 'release/v5.5.0'
2 parents a8f14e0 + 8c3c27a commit 6ff136d

File tree

195 files changed

+7698
-4836
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+7698
-4836
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6262

6363
- name: Set up Ruby
64-
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
64+
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
6565
with:
6666
ruby-version: 3.3.4
6767
bundler-cache: true
@@ -109,7 +109,7 @@ jobs:
109109
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
110110

111111
- name: Set up Ruby
112-
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
112+
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
113113
with:
114114
ruby-version: ${{ matrix.ruby }}
115115
bundler-cache: true

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727

2828
- name: Set up Ruby
29-
uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
29+
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
3030
with:
3131
bundler-cache: true
3232
ruby-version: ruby
3333

3434
- name: Release Gem
35-
uses: rubygems/release-gem@9fc8c0f9a461e67716cde28f188b9a5c029333a8 # v1
35+
uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1
3636

3737
- name: Get version from gemspec
3838
id: version

.standard.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
ruby_version: 3.2
2+
3+
extend_config:
4+
- .stoplight_standard.yml

.stoplight_standard.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require:
2+
- ./rubocop/stoplight/architecture_boundaries.rb
3+
4+
Stoplight/ArchitectureBoundaries:
5+
Enabled: true
6+
Severity: error
7+
Include:
8+
- 'lib/stoplight/domain/**/*.rb'
9+
- 'lib/stoplight/infrastructure/**/*.rb'
10+
- 'lib/stoplight/wiring/**/*.rb'
11+
- 'lib/stoplight/admin/**/*.rb'
12+
- 'spec/unit/stoplight/domain/**/*_spec.rb'
13+
- 'spec/unit/stoplight/infrastructure/**/*_spec.rb'
14+
- 'spec/unit/stoplight/wiring/**/*_spec.rb'
15+
- 'spec/unit/stoplight/admin/**/*_spec.rb'

CONTRIBUTING.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Contributing to Stoplight
2+
3+
Thank you for your interest in contributing to Stoplight! This guide will help you understand our codebase architecture
4+
and how to make effective contributions. If you're lost in the code, please read [architecture.md]
5+
6+
## Development Setup
7+
8+
### Prerequisites
9+
10+
- Ruby version as defined at `stoplight.gemspec`
11+
- Bundler
12+
13+
### Getting Started
14+
15+
```bash
16+
# Clone the repository
17+
git clone https://github.com/bolshakov/stoplight.git
18+
cd stoplight
19+
20+
# Install dependencies
21+
bundle install
22+
23+
# Run tests
24+
bundle exec rspec
25+
26+
# Run cucumber features with Redis data store
27+
STOPLIGHT_DATA_STORE=Redis bundle exec cucumber
28+
29+
# Run cucumber features with Memory data store
30+
STOPLIGHT_DATA_STORE=Memory bundle exec cucumber
31+
32+
# Run linter
33+
bundle exec standardrb
34+
35+
# Auto-fix linting issues
36+
bundle exec standardrb --fix
37+
```
38+
39+
## Making Changes
40+
41+
### Before You Start
42+
43+
1. **Check existing issues** - Look for related discussions
44+
2. **Open an issue** - Discuss major changes before coding
45+
3. **Create a branch** - Use descriptive names: `feature/add-retry-strategy`, `fix/memory-leak`
46+
47+
## Testing Guidelines
48+
49+
### Test Organization
50+
51+
- **Unit tests** (`spec/unit/`) - Fast, isolated, no I/O
52+
- **Integration tests** (`spec/integration/`) - End-to-end scenarios
53+
- **Feature tests** (`features/`) - User-facing behavior
54+
55+
### Unit Test Principles
56+
57+
Use test doubles for testing with abstract dependencies:
58+
59+
```ruby
60+
RSpec.describe Stoplight::Domain::Light do
61+
let(:data_store) { instance_double(Stoplight::Domain::DataStore) }
62+
let(:notifier) { instance_double(Stoplight::Domain::StateTransitionNotifier) }
63+
64+
# Test in isolation
65+
it "transitions to red after threshold" do
66+
allow(data_store).to receive(:get_metadata).and_return(metadata)
67+
# ... test logic
68+
end
69+
end
70+
```
71+
72+
Use real dependencies when testing infrastructure
73+
74+
```ruby
75+
RSpec.describe Stoplight::Infrastructure::DataStore::Redis do
76+
let(:data_store) { described_class.new(redis) }
77+
let(:redis) { Redis.new(url: connection_string) } # connects to the real database
78+
79+
it "transitions to red" do
80+
data_store.transition_to_color(Stoplight::Domain::Color::RED)
81+
# ... test logic
82+
end
83+
end
84+
```
85+
86+
### Integration Test Principles
87+
88+
All user-facing functionality (described in the README file) should be covered with feature tests. In rare cases when
89+
it's tricky to use gherkin language for testing, you can opt out to using integration tests:
90+
91+
```ruby
92+
RSpec.describe "Concurrency testing" do
93+
# Use real implementations
94+
let(:data_store) { Stoplight::Infrastructure::DataStore::Redis.new }
95+
96+
it "persists state across instances" do
97+
# Test actual integration
98+
end
99+
end
100+
```
101+
102+
## Getting Help
103+
104+
- **Questions?** Open a discussion on GitHub
105+
- **Found a bug?** Open an issue with reproduction steps
106+
- **Need guidance?** Tag maintainers in your PR
107+
108+
---
109+
110+
Thank you for contributing to Stoplight! Your efforts help make circuit breakers more reliable for everyone.
111+
112+
[architecture.md]: https://github.com/bolshakov/stoplight/blob/develop/docs/architecture.md

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
stoplight (5.4.0)
4+
stoplight (5.5.0)
55
zeitwerk
66

77
GEM
@@ -158,7 +158,7 @@ GEM
158158
thor (~> 1.0, >= 1.2.2)
159159
zeitwerk (~> 2.6)
160160
rainbow (3.1.1)
161-
rake (13.3.0)
161+
rake (13.3.1)
162162
rantly (2.0.0)
163163
rdoc (6.14.1)
164164
erb
@@ -170,16 +170,16 @@ GEM
170170
regexp_parser (2.11.2)
171171
reline (0.6.1)
172172
io-console (~> 0.5)
173-
rspec (3.13.1)
173+
rspec (3.13.2)
174174
rspec-core (~> 3.13.0)
175175
rspec-expectations (~> 3.13.0)
176176
rspec-mocks (~> 3.13.0)
177-
rspec-core (3.13.4)
177+
rspec-core (3.13.6)
178178
rspec-support (~> 3.13.0)
179179
rspec-expectations (3.13.5)
180180
diff-lcs (>= 1.2.0, < 2.0)
181181
rspec-support (~> 3.13.0)
182-
rspec-mocks (3.13.5)
182+
rspec-mocks (3.13.6)
183183
diff-lcs (>= 1.2.0, < 2.0)
184184
rspec-support (~> 3.13.0)
185185
rspec-rails (8.0.0)
@@ -190,7 +190,7 @@ GEM
190190
rspec-expectations (~> 3.13)
191191
rspec-mocks (~> 3.13)
192192
rspec-support (~> 3.13)
193-
rspec-support (3.13.4)
193+
rspec-support (3.13.6)
194194
rubocop (1.80.2)
195195
json (~> 2.3)
196196
language_server-protocol (~> 3.17.0.2)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ Example: "Ruby 3.2 reaches end-of-life in March 2026, so Stoplight 6.0 will requ
628628

629629
After checking out the repo, run `bundle install` to install dependencies. Run tests with `bundle exec rspec` and check
630630
code style with `bundle exec standardrb`. We follow a git flow branching strategy - see our [Git Flow wiki page] for
631-
details on branch naming, releases, and contribution workflow.
631+
details on branch naming, releases, and contribution workflow. Also check our CONTRIBUTING.md guide for contributors.
632632

633633
## Credits
634634

bench/memory_bench.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require "benchmark/ips"
4-
require "stoplight"
4+
require_relative "../lib/stoplight"
55
cashed_stoplight = Stoplight("")
66

77
Benchmark.ips do |b|

bench/prof.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require "ruby-prof"
4-
require "stoplight"
4+
require_relative "../lib/stoplight"
55
require "redis"
66
require "fileutils"
77

bench/redis_bench.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require "benchmark/ips"
4-
require "stoplight"
4+
require_relative "../lib/stoplight"
55
require "redis"
66

77
redis = Redis.new

0 commit comments

Comments
 (0)