Skip to content

Commit 172122a

Browse files
committed
Merge branch 'release/v5.1.0'
2 parents 2ecd4ca + 00ad0b2 commit 172122a

36 files changed

+652
-196
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
env:
5252
STOPLIGHT_REDIS_URL: "redis://127.0.0.1:6379/0"
5353
STOPLIGHT_DATA_STORE: ${{ matrix.data_store }}
54-
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
54+
CUCUMBER_PUBLISH_ENABLED: true
5555

5656
spec:
5757
name: Specs on Ruby ${{ matrix.ruby }} with Redis ${{ matrix.redis }} 💚

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@
44
/doc/
55
/pkg/
66
/tmp/
7+
tmp/
78
/vendor/
89
/.idea
910
profile_results
1011
/docker/Gemfile.lock
12+
*.log
13+
14+
# OS or Editor folders
15+
.DS_Store
16+
.cache
17+
.project
18+
.settings
19+
.tmproj
20+
.idea
21+
Thumbs.db

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ group :admin do
1313
end
1414

1515
group :development do
16+
gem "ammeter"
1617
gem "benchmark-ips", "~> 2.14"
1718
gem "concurrent-ruby-ext"
1819
gem "connection_pool"

Gemfile.lock

Lines changed: 101 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,97 @@
11
PATH
22
remote: .
33
specs:
4-
stoplight (5.0.2)
4+
stoplight (5.1.0)
55
zeitwerk
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10+
actionpack (8.0.2)
11+
actionview (= 8.0.2)
12+
activesupport (= 8.0.2)
13+
nokogiri (>= 1.8.5)
14+
rack (>= 2.2.4)
15+
rack-session (>= 1.0.1)
16+
rack-test (>= 0.6.3)
17+
rails-dom-testing (~> 2.2)
18+
rails-html-sanitizer (~> 1.6)
19+
useragent (~> 0.16)
20+
actionview (8.0.2)
21+
activesupport (= 8.0.2)
22+
builder (~> 3.1)
23+
erubi (~> 1.11)
24+
rails-dom-testing (~> 2.2)
25+
rails-html-sanitizer (~> 1.6)
26+
activesupport (8.0.2)
27+
base64
28+
benchmark (>= 0.3)
29+
bigdecimal
30+
concurrent-ruby (~> 1.0, >= 1.3.1)
31+
connection_pool (>= 2.2.5)
32+
drb
33+
i18n (>= 1.6, < 2)
34+
logger (>= 1.4.2)
35+
minitest (>= 5.1)
36+
securerandom (>= 0.3)
37+
tzinfo (~> 2.0, >= 2.0.5)
38+
uri (>= 0.13.1)
39+
ammeter (1.1.7)
40+
activesupport (>= 3.0)
41+
railties (>= 3.0)
42+
rspec-rails (>= 2.2)
1043
ast (2.4.3)
1144
base64 (0.2.0)
45+
benchmark (0.4.1)
1246
benchmark-ips (2.14.0)
13-
bigdecimal (3.1.9)
47+
bigdecimal (3.2.2)
1448
builder (3.3.0)
1549
concurrent-ruby (1.3.5)
1650
concurrent-ruby-ext (1.3.5)
1751
concurrent-ruby (= 1.3.5)
1852
connection_pool (2.5.3)
19-
cucumber (9.2.1)
53+
crass (1.0.6)
54+
cucumber (10.0.0)
55+
base64 (~> 0.2)
2056
builder (~> 3.2)
2157
cucumber-ci-environment (> 9, < 11)
22-
cucumber-core (> 13, < 14)
23-
cucumber-cucumber-expressions (~> 17.0)
24-
cucumber-gherkin (> 24, < 28)
58+
cucumber-core (> 15, < 17)
59+
cucumber-cucumber-expressions (> 17, < 19)
2560
cucumber-html-formatter (> 20.3, < 22)
26-
cucumber-messages (> 19, < 25)
2761
diff-lcs (~> 1.5)
62+
logger (~> 1.6)
2863
mini_mime (~> 1.1)
2964
multi_test (~> 1.1)
30-
sys-uname (~> 1.2)
65+
sys-uname (~> 1.3)
3166
cucumber-ci-environment (10.0.1)
32-
cucumber-core (13.0.3)
33-
cucumber-gherkin (>= 27, < 28)
34-
cucumber-messages (>= 20, < 23)
67+
cucumber-core (15.1.0)
68+
cucumber-gherkin (> 27, < 31)
69+
cucumber-messages (> 26, < 29)
3570
cucumber-tag-expressions (> 5, < 7)
36-
cucumber-cucumber-expressions (17.1.0)
71+
cucumber-cucumber-expressions (18.0.1)
3772
bigdecimal
38-
cucumber-gherkin (27.0.0)
39-
cucumber-messages (>= 19.1.4, < 23)
40-
cucumber-html-formatter (21.9.0)
73+
cucumber-gherkin (30.0.4)
74+
cucumber-messages (> 25, < 28)
75+
cucumber-html-formatter (21.10.1)
4176
cucumber-messages (> 19, < 28)
42-
cucumber-messages (22.0.0)
77+
cucumber-messages (27.2.0)
4378
cucumber-tag-expressions (6.1.2)
4479
database_cleaner-core (2.0.1)
4580
database_cleaner-redis (2.0.0)
4681
database_cleaner-core (~> 2.0.0)
4782
redis
4883
date (3.4.1)
49-
debug (1.10.0)
84+
debug (1.11.0)
5085
irb (~> 1.10)
5186
reline (>= 0.3.8)
5287
diff-lcs (1.6.2)
5388
docile (1.4.0)
89+
drb (2.2.3)
90+
erb (5.0.1)
91+
erubi (1.13.1)
5492
ffi (1.17.2)
93+
i18n (1.14.7)
94+
concurrent-ruby (~> 1.0)
5595
io-console (0.8.0)
5696
irb (1.15.2)
5797
pp (>= 0.6.0)
@@ -61,12 +101,20 @@ GEM
61101
language_server-protocol (3.17.0.5)
62102
lint_roller (1.1.0)
63103
logger (1.7.0)
104+
loofah (2.24.1)
105+
crass (~> 1.0.2)
106+
nokogiri (>= 1.12.0)
64107
mini_mime (1.1.5)
108+
mini_portile2 (2.8.9)
109+
minitest (5.25.5)
65110
multi_json (1.15.0)
66111
multi_test (1.1.0)
67112
mustermann (3.0.3)
68113
ruby2_keywords (~> 0.0.1)
69114
nio4r (2.7.4)
115+
nokogiri (1.18.8)
116+
mini_portile2 (~> 2.8.2)
117+
racc (~> 1.4)
70118
parallel (1.27.0)
71119
parser (3.3.8.0)
72120
ast (~> 2.4.1)
@@ -75,7 +123,7 @@ GEM
75123
prettyprint
76124
prettyprint (0.2.0)
77125
prism (1.4.0)
78-
psych (5.2.3)
126+
psych (5.2.6)
79127
date
80128
stringio
81129
puma (6.6.0)
@@ -91,10 +139,28 @@ GEM
91139
rack (>= 3.0.0)
92140
rack-test (2.2.0)
93141
rack (>= 1.3)
142+
rackup (2.2.1)
143+
rack (>= 3)
144+
rails-dom-testing (2.3.0)
145+
activesupport (>= 5.0.0)
146+
minitest
147+
nokogiri (>= 1.6)
148+
rails-html-sanitizer (1.6.2)
149+
loofah (~> 2.21)
150+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
151+
railties (8.0.2)
152+
actionpack (= 8.0.2)
153+
activesupport (= 8.0.2)
154+
irb (~> 1.13)
155+
rackup (>= 1.0.0)
156+
rake (>= 12.2)
157+
thor (~> 1.0, >= 1.2.2)
158+
zeitwerk (~> 2.6)
94159
rainbow (3.1.1)
95160
rake (13.3.0)
96161
rantly (2.0.0)
97-
rdoc (6.13.1)
162+
rdoc (6.14.1)
163+
erb
98164
psych (>= 4.0.0)
99165
redis (5.4.0)
100166
redis-client (>= 0.22.0)
@@ -115,6 +181,14 @@ GEM
115181
rspec-mocks (3.13.5)
116182
diff-lcs (>= 1.2.0, < 2.0)
117183
rspec-support (~> 3.13.0)
184+
rspec-rails (8.0.0)
185+
actionpack (>= 7.2)
186+
activesupport (>= 7.2)
187+
railties (>= 7.2)
188+
rspec-core (~> 3.13)
189+
rspec-expectations (~> 3.13)
190+
rspec-mocks (~> 3.13)
191+
rspec-support (~> 3.13)
118192
rspec-support (3.13.4)
119193
rubocop (1.75.6)
120194
json (~> 2.3)
@@ -138,6 +212,7 @@ GEM
138212
base64
139213
ruby-progressbar (1.13.0)
140214
ruby2_keywords (0.0.5)
215+
securerandom (0.4.1)
141216
simplecov (0.22.0)
142217
docile (~> 1.1)
143218
simplecov-html (~> 0.11)
@@ -170,20 +245,26 @@ GEM
170245
standard-performance (1.8.0)
171246
lint_roller (~> 1.1)
172247
rubocop-performance (~> 1.25.0)
173-
stringio (3.1.6)
248+
stringio (3.1.7)
174249
sys-uname (1.3.1)
175250
ffi (~> 1.1)
251+
thor (1.3.2)
176252
tilt (2.6.0)
177253
timecop (0.9.10)
254+
tzinfo (2.0.6)
255+
concurrent-ruby (~> 1.0)
178256
unicode-display_width (3.1.4)
179257
unicode-emoji (~> 4.0, >= 4.0.4)
180258
unicode-emoji (4.0.4)
259+
uri (1.0.3)
260+
useragent (0.16.11)
181261
zeitwerk (2.7.3)
182262

183263
PLATFORMS
184264
ruby
185265

186266
DEPENDENCIES
267+
ammeter
187268
benchmark-ips (~> 2.14)
188269
concurrent-ruby-ext
189270
connection_pool

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,23 @@ receives `nil`. In both cases, the return value of the fallback becomes the retu
128128

129129
Stoplight goes with a built-in Admin Panel that can track all active Lights and manually lock them in the desired state (`Green` or `Red`). Locking lights in certain states might be helpful in scenarios like E2E testing.
130130

131-
To add Admin Panel to your Rails project, add this configuration to your `config/routes.rb` file.
131+
To add Admin Panel protected by basic authentication to your Rails project, add this configuration to your `config/routes.rb` file.
132132

133133
```ruby
134134
Rails.application.routes.draw do
135135
# ...
136136

137+
Stoplight::Admin.use(Rack::Auth::Basic) do |username, password|
138+
username == ENV["STOPLIGHT_ADMIN_USERNAME"] && password == ENV["STOPLIGHT_ADMIN_PASSWORD"]
139+
end
137140
mount Stoplight::Admin => '/stoplights'
138141

139142
# ...
140143
end
141144
```
142145

146+
Then set up `STOPLIGHT_ADMIN_USERNAME` and `STOPLIGHT_ADMIN_PASSWORD` env variables to access your Admin panel.
147+
143148
**IMPORTANT:** Stoplight Admin Panel requires you to have `sinatra` and `sinatra-contrib` gems installed. You can either add them to your Gemfile:
144149

145150
```ruby
@@ -158,13 +163,13 @@ gem install sinatra-contrib
158163
It is possible to run the Admin Panel separately from your application using the `stoplight-admin:<release-version>` docker image.
159164

160165
```shell
161-
docker run --net=host stoplight-admin:v5
166+
docker run --net=host bolshakov/stoplight-admin
162167
```
163168

164169
**IMPORTANT:** Standalone Admin Panel should use the same Redis your application uses. To achieve this, set the `REDIS_URL` ENV variable via `-e REDIS_URL=<url-to-your-redis-servier>.` E.g.:
165170

166171
```shell
167-
docker run -e REDIS_URL=redis://localhost:6378 --net=host stoplight-admin:v5
172+
docker run -e REDIS_URL=redis://localhost:6378 --net=host bolshakov/stoplight-admin
168173
```
169174

170175

@@ -384,6 +389,12 @@ Stoplight.configure do |config|
384389
end
385390
```
386391

392+
You can generate initializer with Redis, Admin Panel route and add needed gems to your Gemfile:
393+
394+
```sh
395+
rails generate stoplight:install --with-admin-panel
396+
```
397+
387398
## Testing
388399

389400
Tips for working with Stoplight in test environments:
@@ -416,6 +427,12 @@ Stoplight supports the latest three minor versions of Ruby, which currently are:
416427
the minimum supported Ruby version is not considered a breaking change. We support the current stable Redis
417428
version (`7.4.x`) and the latest release of the previous major version (`6.2.x`)
418429

430+
## Development
431+
432+
After checking out the repo, run `bundle install` to install dependencies. Run tests with `bundle exec rspec` and check
433+
code style with `bundle exec standardrb`. We follow a git flow branching strategy - see our [Git Flow wiki page] for
434+
details on branch naming, releases, and contribution workflow.
435+
419436
## Credits
420437

421438
Stoplight was originally created by [camdez][] and [tfausak][]. It is currently maintained by [bolshakov][] and
@@ -444,3 +461,4 @@ Fowler’s [CircuitBreaker][] article.
444461
[complete list of contributors]: https://github.com/bolshakov/stoplight/graphs/contributors
445462
[CircuitBreaker]: http://martinfowler.com/bliki/CircuitBreaker.html
446463
[Redis]: https://redis.io/
464+
[Git Flow wiki page]: https://github.com/bolshakov/stoplight/wiki/Git-Flow

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ You can expect to receive security fixes for the latest minor version only.
66

77
| Version | Supported |
88
|---------| ------------------ |
9-
| 4.1.x | :white_check_mark: |
10-
| < 4.1 | :x: |
9+
| 5.1.x | :white_check_mark: |
10+
| < 5.1 | :x: |
1111

1212
## Reporting a Vulnerability
1313

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Description:
2+
Generates stoplight initializer to setup Stoplight Redis configuration
3+
and optionally sets up Admin panel
4+
5+
Examples:
6+
rails generate stoplight:install
7+
8+
This will generate "config/initializers/stoplight.rb" initializer with basic config
9+
Then you should adjust Redis config there.
10+
11+
rails generate stoplight:install --with-admin-panel
12+
13+
This generated all needed requirements to set up Stoplight Admin Panel:
14+
* It generates initializer "config/initializers/stoplight.rb" with Redis configuration
15+
* It injects your "config/routes.rb" with route with basic authentication to Stoplight Admin panel
16+
* It injects your Gemfile with needed dependencies ('redis', 'sinatra' and 'sinatra-contrib')

0 commit comments

Comments
 (0)