• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 35499232060
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: registry-frozen-copy-on-write
DEFAULT BRANCH: master
Ran 20 Sep 2026 08:19AM UTC
Jobs 32
Files 168
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Sep 2026 08:19AM UTC coverage: 99.025% (-0.01%) from 99.035%
35499232060

Pull #2972

github

ericproulx
Stop the request path resolving params it was not asked for

Three places where a request resolved params nobody had asked for, or
resolved the same ones again.

**A nested params scope is resolved from the scope above it.**
`ParamsScope#params` walks back to the root on every call, and
`#should_validate?` asked every scope on the chain for its params in turn
-- so a scope nested four deep resolved ten scopes to answer one question,
and did it again for each of its validators. The cost grows with the square
of the nesting depth. A scope that declares no dependency and has none
above it can only be asked whether its own params were given: `given` is
the one thing that makes a scope's answer depend on anything else, through
the qualifying params it stores per request, and such a chain stores none.
So the chain is resolved once from the root down, each scope from the one
above it, and checked from there -- every check is pure, so the order it
runs in does not change the answer. `#params` skips the qualifying-params
lookup and the `presence` test that follows it on the same grounds.
`#all_element_blank?` is only ever asked about params that are not blank,
and a Hash that is not blank is never all blank: what `all?` yields for it
is a [key, value] pair, an Array of two, which `blank?` is false for.

**The query string is parsed for a `format` param only when it could name
one.** `?format=json` overrides the format an API pins, so the formatter
read it out of the query params -- parsing the whole string on every
request that had one, before the endpoint had a say. Parsing is the most
expensive thing such a request does, about 1.2 µs per pair, and an endpoint
that never reads its params paid all of it for one lookup that could not
have hit. Rack splits the query string on `&` and `=` and then unescapes
each key, and unescaping only ever rewrites `%XX` (or a `+`, which becomes
a space), so a string that spells neither `format` nor a percent-escape
cannot hold... (continued)
Pull Request #2972: Stop the request path resolving params it was not asked for

1464 of 1521 branches covered (96.25%)

Branch coverage included in aggregate %.

26 of 26 new or added lines in 4 files covered. (100.0%)

4325 of 4325 relevant lines covered (100.0%)

28771.75 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rails_7_2.gemfile - 35499232060.1 20 Sep 2026 08:20AM UTC 168
97.86
GitHub Action Run
2 run-4.0-gemfiles/rack_3_1.gemfile - 35499232060.2 20 Sep 2026 08:20AM UTC 167
97.84
GitHub Action Run
3 run-3.3-Gemfile - 35499232060.3 20 Sep 2026 08:20AM UTC 167
97.88
GitHub Action Run
4 run-3.3-gemfiles/rack_3_1.gemfile - 35499232060.4 20 Sep 2026 08:20AM UTC 167
97.86
GitHub Action Run
5 run-3.3-gemfiles/rails_8_1.gemfile - 35499232060.5 20 Sep 2026 08:19AM UTC 168
97.88
GitHub Action Run
6 run-4.0-gemfiles/dry_validation.gemfile - 35499232060.6 20 Sep 2026 08:20AM UTC 166
55.73
GitHub Action Run
7 run-4.0-gemfiles/grape_entity.gemfile - 35499232060.7 20 Sep 2026 08:20AM UTC 166
48.62
GitHub Action Run
8 run-4.0-gemfiles/rack_3_0.gemfile - 35499232060.8 20 Sep 2026 08:20AM UTC 167
97.86
GitHub Action Run
9 run-4.0-gemfiles/rails_7_2.gemfile - 35499232060.9 20 Sep 2026 08:20AM UTC 168
97.84
GitHub Action Run
10 run-4.0-gemfiles/rack_3_2.gemfile - 35499232060.10 20 Sep 2026 08:20AM UTC 167
97.84
GitHub Action Run
11 run-4.0-Gemfile - 35499232060.11 20 Sep 2026 08:20AM UTC 167
97.86
GitHub Action Run
12 run-3.4-gemfiles/rack_3_2.gemfile - 35499232060.12 20 Sep 2026 08:20AM UTC 167
97.86
GitHub Action Run
13 run-3.4-gemfiles/rack_3_0.gemfile - 35499232060.13 20 Sep 2026 08:20AM UTC 167
97.84
GitHub Action Run
14 run-3.4-gemfiles/rails_8_0.gemfile - 35499232060.14 20 Sep 2026 08:20AM UTC 168
97.84
GitHub Action Run
15 run-4.0-gemfiles/hashie.gemfile - 35499232060.15 20 Sep 2026 08:20AM UTC 166
59.75
GitHub Action Run
16 run-4.0-gemfiles/grape_swagger.gemfile - 35499232060.16 20 Sep 2026 08:20AM UTC 166
53.08
GitHub Action Run
17 run-4.0-gemfiles/rails_8_0.gemfile - 35499232060.17 20 Sep 2026 08:20AM UTC 168
97.86
GitHub Action Run
18 run-3.3-gemfiles/rack_2_2.gemfile - 35499232060.18 20 Sep 2026 08:20AM UTC 167
97.82
GitHub Action Run
19 run-3.4-gemfiles/rack_2_2.gemfile - 35499232060.19 20 Sep 2026 08:20AM UTC 167
97.81
GitHub Action Run
20 run-4.0-gemfiles/multi_json_1_20.gemfile - 35499232060.20 20 Sep 2026 08:20AM UTC 166
45.84
GitHub Action Run
21 run-3.4-gemfiles/rack_3_1.gemfile - 35499232060.21 20 Sep 2026 08:21AM UTC 167
97.84
GitHub Action Run
22 run-3.3-gemfiles/rails_8_0.gemfile - 35499232060.22 20 Sep 2026 08:20AM UTC 168
97.88
GitHub Action Run
23 run-3.4-Gemfile - 35499232060.23 20 Sep 2026 08:20AM UTC 167
97.86
GitHub Action Run
24 run-4.0-gemfiles/multi_xml_0_8.gemfile - 35499232060.24 20 Sep 2026 08:20AM UTC 166
45.56
GitHub Action Run
25 run-4.0-gemfiles/rack_2_2.gemfile - 35499232060.25 20 Sep 2026 08:20AM UTC 167
97.81
GitHub Action Run
26 run-3.4-gemfiles/rails_8_1.gemfile - 35499232060.26 20 Sep 2026 08:21AM UTC 168
97.86
GitHub Action Run
27 run-3.3-gemfiles/rack_3_0.gemfile - 35499232060.27 20 Sep 2026 08:19AM UTC 167
97.86
GitHub Action Run
28 run-4.0-gemfiles/rails_8_1.gemfile - 35499232060.28 20 Sep 2026 08:21AM UTC 168
97.86
GitHub Action Run
29 run-4.0-gemfiles/multi_json.gemfile - 35499232060.29 20 Sep 2026 08:20AM UTC 166
45.8
GitHub Action Run
30 run-3.3-gemfiles/rack_3_2.gemfile - 35499232060.30 20 Sep 2026 08:19AM UTC 167
97.86
GitHub Action Run
31 run-3.4-gemfiles/rails_7_2.gemfile - 35499232060.31 20 Sep 2026 08:19AM UTC 168
97.84
GitHub Action Run
32 run-4.0-gemfiles/multi_xml.gemfile - 35499232060.32 20 Sep 2026 08:20AM UTC 166
45.53
GitHub Action Run
Source Files on build 35499232060
  • Tree
  • List 168
  • Changed 6
  • Source Changed 4
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35499232060
  • Pull Request #2972
  • PR Base - master (#35496025528)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc