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

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

Build:
Build:
LAST BUILD BRANCH: perf/error-response-copies
DEFAULT BRANCH: master
Ran 09 Sep 2026 07:13AM UTC
Jobs 32
Files 170
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

09 Sep 2026 07:12AM UTC coverage: 99.155% (-0.03%) from 99.184%
34322765255

Pull #2919

github

ericproulx
Resolve a '%'-free path against a union without the encodings

Every route pattern is compiled with Mustermann's `uri_decode: true`, which
expands each literal character of a path into an alternation with its
percent-encodings -- `/resource7` becomes
`\/(?:r|%72)(?:e|%65)(?:s|%73)(?:o|%6F|%6f)...` -- so that `/a%2Eb` still
reaches a route declared as `/a.b`. The router's per-method union is the
disjunction of those patterns, so every request pays for the expansion: it
roughly doubles the compiled source, and it hides the literal prefix each
branch starts with, which is what would otherwise let Onigmo reject a
non-matching path without walking the alternatives. On a 500-route API,
failing to match cost 180us.

An input holding no '%' cannot take any of those alternatives, so for it the
union without them accepts exactly the same strings, by the same path through
the regexp, capturing the same substrings. `compile!` now derives that
stand-in per union and `transaction`, `#match?` and `#greedy_match?` read it
whenever the path has no '%'.

The stand-in is cut out of the union's source rather than recompiled from each
pattern with `uri_decode: false`. That is 20x cheaper -- one gsub and one
`Regexp.new` for the whole union against a fresh Mustermann parse per route --
and it is the more faithful transformation: `uri_decode: false` also drops the
`\+` branch that lets a plus match a literal space, which would make
`/with+space` (no '%' anywhere, so resolved here) miss a route the decode-aware
union matches.

Only alternations are rewritten, and only their `%XX` alternatives are dropped,
so a `requirements` Regexp inserted into the pattern verbatim survives whatever
it holds. Two shapes are stepped over rather than rewritten: a character class,
where `(?:` and `|` are literal characters and dropping them would shrink the
set a route matches, and an escape, so an escaped bracket cannot open a class.
The group itself is only unwrapped around a lone character ... (continued)
Pull Request #2919: Resolve a '%'-free path against a union without the encodings

1318 of 1364 branches covered (96.63%)

Branch coverage included in aggregate %.

42 of 42 new or added lines in 2 files covered. (100.0%)

4077 of 4077 relevant lines covered (100.0%)

27853.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rack_3_1.gemfile - 34322765255.1 09 Sep 2026 07:13AM UTC 169
97.88
GitHub Action Run
2 run-4.0-gemfiles/rails_8_1.gemfile - 34322765255.2 09 Sep 2026 07:14AM UTC 170
97.85
GitHub Action Run
3 run-3.3-gemfiles/rack_3_2.gemfile - 34322765255.3 09 Sep 2026 07:13AM UTC 169
97.88
GitHub Action Run
4 run-3.3-gemfiles/rails_8_0.gemfile - 34322765255.4 09 Sep 2026 07:14AM UTC 170
97.87
GitHub Action Run
5 run-4.0-gemfiles/hashie.gemfile - 34322765255.5 09 Sep 2026 07:14AM UTC 168
61.9
GitHub Action Run
6 run-4.0-gemfiles/grape_entity.gemfile - 34322765255.6 09 Sep 2026 07:14AM UTC 168
50.55
GitHub Action Run
7 run-4.0-gemfiles/rack_2_2.gemfile - 34322765255.7 09 Sep 2026 07:13AM UTC 169
97.83
GitHub Action Run
8 run-3.4-gemfiles/rack_3_0.gemfile - 34322765255.8 09 Sep 2026 07:13AM UTC 169
97.85
GitHub Action Run
9 run-3.4-gemfiles/rails_8_0.gemfile - 34322765255.9 09 Sep 2026 07:14AM UTC 170
97.87
GitHub Action Run
10 run-4.0-gemfiles/rails_8_0.gemfile - 34322765255.10 09 Sep 2026 07:13AM UTC 170
97.85
GitHub Action Run
11 run-4.0-gemfiles/multi_json.gemfile - 34322765255.11 09 Sep 2026 07:13AM UTC 168
47.66
GitHub Action Run
12 run-4.0-gemfiles/dry_validation.gemfile - 34322765255.12 09 Sep 2026 07:13AM UTC 168
57.96
GitHub Action Run
13 run-3.3-Gemfile - 34322765255.13 09 Sep 2026 07:14AM UTC 169
97.87
GitHub Action Run
14 run-3.3-gemfiles/rails_8_1.gemfile - 34322765255.14 09 Sep 2026 07:14AM UTC 170
97.89
GitHub Action Run
15 run-4.0-gemfiles/multi_xml.gemfile - 34322765255.15 09 Sep 2026 07:14AM UTC 168
47.27
GitHub Action Run
16 run-4.0-gemfiles/multi_json_1_20.gemfile - 34322765255.16 09 Sep 2026 07:14AM UTC 168
47.7
GitHub Action Run
17 run-4.0-gemfiles/rack_3_1.gemfile - 34322765255.17 09 Sep 2026 07:14AM UTC 169
97.87
GitHub Action Run
18 run-3.4-gemfiles/rack_3_2.gemfile - 34322765255.18 09 Sep 2026 07:14AM UTC 169
97.87
GitHub Action Run
19 run-3.4-Gemfile - 34322765255.19 09 Sep 2026 07:14AM UTC 169
97.87
GitHub Action Run
20 run-3.3-gemfiles/rack_3_0.gemfile - 34322765255.20 09 Sep 2026 07:13AM UTC 169
97.87
GitHub Action Run
21 run-3.4-gemfiles/rack_3_1.gemfile - 34322765255.21 09 Sep 2026 07:14AM UTC 169
97.87
GitHub Action Run
22 run-4.0-gemfiles/rack_3_2.gemfile - 34322765255.22 09 Sep 2026 07:13AM UTC 169
97.85
GitHub Action Run
23 run-4.0-gemfiles/rails_7_2.gemfile - 34322765255.23 09 Sep 2026 07:13AM UTC 170
97.87
GitHub Action Run
24 run-3.4-gemfiles/rack_2_2.gemfile - 34322765255.24 09 Sep 2026 07:13AM UTC 169
97.81
GitHub Action Run
25 run-3.4-gemfiles/rails_8_1.gemfile - 34322765255.25 09 Sep 2026 07:14AM UTC 170
97.85
GitHub Action Run
26 run-4.0-gemfiles/multi_xml_0_8.gemfile - 34322765255.26 09 Sep 2026 07:13AM UTC 168
47.31
GitHub Action Run
27 run-4.0-gemfiles/rack_3_0.gemfile - 34322765255.27 09 Sep 2026 07:14AM UTC 169
97.87
GitHub Action Run
28 run-4.0-gemfiles/grape_swagger.gemfile - 34322765255.28 09 Sep 2026 07:14AM UTC 168
55.22
GitHub Action Run
29 run-3.3-gemfiles/rails_7_2.gemfile - 34322765255.29 09 Sep 2026 07:13AM UTC 170
97.89
GitHub Action Run
30 run-4.0-Gemfile - 34322765255.30 09 Sep 2026 07:13AM UTC 169
97.87
GitHub Action Run
31 run-3.3-gemfiles/rack_2_2.gemfile - 34322765255.31 09 Sep 2026 07:14AM UTC 169
97.83
GitHub Action Run
32 run-3.4-gemfiles/rails_7_2.gemfile - 34322765255.32 09 Sep 2026 07:13AM UTC 170
97.87
GitHub Action Run
Source Files on build 34322765255
  • Tree
  • List 170
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #34322765255
  • Pull Request #2919
  • PR Base - master (#34297850893)
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