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

ruby-grape / grape / 33413427296
97%

Build:
DEFAULT BRANCH: master
Ran 31 Aug 2026 04:19PM UTC
Jobs 32
Files 169
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

31 Aug 2026 04:19PM UTC coverage: 96.985%. Remained the same
33413427296

push

github

web-flow
Return a Rack tuple from the formatter instead of a Rack::Response (#2876)

`Formatter#build_formatted_response` wrapped the formatted body in a
`Rack::Response`, which `Middleware::Base#call` unwrapped again with `to_a` on
the way out of the same middleware. Nothing in between needs the object.

The wrapper is not free. Its constructor builds a second `Rack::Headers` and
copies every header into it key by key — and the headers it is handed are
already a `Grape::Util::Header`, which *is* `Rack::Headers` on Rack 3, so the
normalization has nothing to do. It also allocates a `Method` object for
`@writer`. Measured in one process, on a response with one header:

    Rack::Response.new(body, status, headers).to_a   770 ns   4 objects
    [status, headers, bodymap]                       135 ns   1 object    5.7x

Three fewer objects per request end to end on a JSON GET (46.1 -> 43.1),
counted deterministically.

What the wrapper did that mattered is either already done or not reachable:

* Header normalization — the headers are a `Rack::Headers` already.
* `status.to_i` — `DSL::InsideRoute#status` only ever answers an Integer.
* Content-length — `finish` sets it from `@length`, which stays nil for an Array
  body, so none was set before either.
* Blanking a 204/304 body — `Formatter#after` returns those before reaching
  this branch.

`merge_headers` already handled both shapes (`when Rack::Response` /
`when Array`), and the streaming branch still returns its
`ServeStream::SendfileResponse`. Middleware above the formatter saw an Array
before this change too, since `Middleware::Base#call` had already called `to_a`.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

1238 of 1330 branches covered (93.08%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

3908 of 3976 relevant lines covered (98.29%)

27281.23 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/grape_entity.gemfile - 33413427296.1 31 Aug 2026 04:19PM UTC 168
50.25
GitHub Action Run
2 run-3.3-gemfiles/rack_3_1.gemfile - 33413427296.2 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
3 run-3.3-gemfiles/rack_3_2.gemfile - 33413427296.3 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
4 run-4.0-gemfiles/grape_swagger.gemfile - 33413427296.4 31 Aug 2026 04:19PM UTC 168
55.23
GitHub Action Run
5 run-3.3-Gemfile - 33413427296.5 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
6 run-4.0-gemfiles/rails_8_0.gemfile - 33413427296.6 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
7 run-3.3-gemfiles/rack_2_2.gemfile - 33413427296.7 31 Aug 2026 04:19PM UTC 168
95.7
GitHub Action Run
8 run-4.0-gemfiles/multi_json.gemfile - 33413427296.8 31 Aug 2026 04:19PM UTC 168
47.49
GitHub Action Run
9 run-4.0-gemfiles/rails_8_1.gemfile - 33413427296.9 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
10 run-4.0-gemfiles/rack_3_0.gemfile - 33413427296.10 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
11 run-4.0-gemfiles/rails_7_2.gemfile - 33413427296.11 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
12 run-3.3-gemfiles/rack_3_0.gemfile - 33413427296.12 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
13 run-4.0-gemfiles/rack_3_1.gemfile - 33413427296.13 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
14 run-4.0-gemfiles/dry_validation.gemfile - 33413427296.14 31 Aug 2026 04:19PM UTC 168
57.87
GitHub Action Run
15 run-3.4-gemfiles/rails_8_1.gemfile - 33413427296.15 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
16 run-4.0-gemfiles/rack_3_2.gemfile - 33413427296.16 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
17 run-4.0-gemfiles/multi_xml_0_8.gemfile - 33413427296.17 31 Aug 2026 04:19PM UTC 168
46.92
GitHub Action Run
18 run-4.0-gemfiles/rack_2_2.gemfile - 33413427296.18 31 Aug 2026 04:19PM UTC 168
95.7
GitHub Action Run
19 run-3.4-gemfiles/rack_3_0.gemfile - 33413427296.19 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
20 run-4.0-gemfiles/multi_json_1_20.gemfile - 33413427296.20 31 Aug 2026 04:19PM UTC 168
47.53
GitHub Action Run
21 run-3.4-Gemfile - 33413427296.21 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
22 run-4.0-gemfiles/hashie.gemfile - 33413427296.22 31 Aug 2026 04:19PM UTC 168
61.75
GitHub Action Run
23 run-3.3-gemfiles/rails_8_0.gemfile - 33413427296.23 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
24 run-4.0-gemfiles/multi_xml.gemfile - 33413427296.24 31 Aug 2026 04:19PM UTC 168
46.89
GitHub Action Run
25 run-3.4-gemfiles/rails_7_2.gemfile - 33413427296.25 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
26 run-3.4-gemfiles/rails_8_0.gemfile - 33413427296.26 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
27 run-4.0-Gemfile - 33413427296.27 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
28 run-3.3-gemfiles/rails_8_1.gemfile - 33413427296.28 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
29 run-3.4-gemfiles/rack_3_2.gemfile - 33413427296.29 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
30 run-3.3-gemfiles/rails_7_2.gemfile - 33413427296.30 31 Aug 2026 04:19PM UTC 169
95.74
GitHub Action Run
31 run-3.4-gemfiles/rack_3_1.gemfile - 33413427296.31 31 Aug 2026 04:19PM UTC 168
95.74
GitHub Action Run
32 run-3.4-gemfiles/rack_2_2.gemfile - 33413427296.32 31 Aug 2026 04:19PM UTC 168
95.7
GitHub Action Run
Source Files on build 33413427296
  • Tree
  • List 169
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33413427296
  • 7b8e90b3 on github
  • Prev Build on master (#33412721482)
  • Next Build on master (#33413663831)
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