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

ruby-grape / grape / 26785176904
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: perf/lazy-response-cookies
DEFAULT BRANCH: master
Ran 01 Jun 2026 10:11PM UTC
Jobs 30
Files 166
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

01 Jun 2026 10:11PM UTC coverage: 96.839% (+0.04%) from 96.797%
26785176904

Pull #2757

github

ericproulx
Build the cookie jar only on use and drop its deferral Proc

Two related steps that make the response-cookie path lazy at the request
boundary:

- `build_response_cookies` runs on every request and went through
  `cookies` -> `request.cookies`, materializing the `Grape::Cookies` jar
  even when the handler never touched a cookie. Gate it on a new
  `Grape::Request#cookies?` predicate (true only once the jar exists),
  so a cookie-free request allocates no jar at all.

- With the jar now built only when a cookie is actually read or written,
  its `-> { rack_cookies }` deferral Proc no longer earns its keep: any
  access immediately forces the parse, and a write (`[]=`) always did.
  Parse `rack_cookies` eagerly in the constructor and replace the
  `is_a?(Proc)` lazy reader with a plain `attr_reader`, dropping the
  closure allocation and the per-access branch.

The `ActiveSupport::HashWithIndifferentAccess` wrapping is unchanged --
it backs Grape's string/symbol-indifferent cookie access.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pull Request #2757: Build the cookie jar only on use and drop its deferral Proc

1114 of 1205 branches covered (92.45%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 3 files covered. (100.0%)

3543 of 3604 relevant lines covered (98.31%)

23211.73 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/dry_validation.gemfile - 26785176904.1 01 Jun 2026 10:12PM UTC 165
58.38
GitHub Action Run
2 run-4.0-gemfiles/multi_xml.gemfile - 26785176904.2 01 Jun 2026 10:11PM UTC 165
37.14
GitHub Action Run
3 run-3.4-gemfiles/rack_2_2.gemfile - 26785176904.3 01 Jun 2026 10:11PM UTC 165
95.61
GitHub Action Run
4 run-4.0-gemfiles/rack_3_1.gemfile - 26785176904.4 01 Jun 2026 10:11PM UTC 165
95.65
GitHub Action Run
5 run-4.0-gemfiles/multi_json.gemfile - 26785176904.5 01 Jun 2026 10:12PM UTC 165
37.14
GitHub Action Run
6 run-3.4-gemfiles/rails_8_0.gemfile - 26785176904.6 01 Jun 2026 10:11PM UTC 166
95.65
GitHub Action Run
7 run-3.4-gemfiles/rails_7_2.gemfile - 26785176904.7 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
8 run-3.4-gemfiles/rack_3_0.gemfile - 26785176904.8 01 Jun 2026 10:12PM UTC 165
95.65
GitHub Action Run
9 run-3.3-gemfiles/rails_8_1.gemfile - 26785176904.9 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
10 run-4.0-gemfiles/rack_3_0.gemfile - 26785176904.10 01 Jun 2026 10:12PM UTC 165
95.65
GitHub Action Run
11 run-4.0-gemfiles/grape_swagger.gemfile - 26785176904.11 01 Jun 2026 10:11PM UTC 165
55.32
GitHub Action Run
12 run-3.3-gemfiles/rack_3_2.gemfile - 26785176904.12 01 Jun 2026 10:12PM UTC 165
95.65
GitHub Action Run
13 run-4.0-gemfiles/rails_8_0.gemfile - 26785176904.13 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
14 run-4.0-gemfiles/rails_7_2.gemfile - 26785176904.14 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
15 run-3.4-gemfiles/rails_8_1.gemfile - 26785176904.15 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
16 run-3.3-gemfiles/rails_7_2.gemfile - 26785176904.16 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
17 run-4.0-gemfiles/rack_3_2.gemfile - 26785176904.17 01 Jun 2026 10:11PM UTC 165
95.65
GitHub Action Run
18 run-3.4-gemfiles/rack_3_2.gemfile - 26785176904.18 01 Jun 2026 10:12PM UTC 165
95.65
GitHub Action Run
19 run-3.3-gemfiles/rack_3_0.gemfile - 26785176904.19 01 Jun 2026 10:12PM UTC 165
95.65
GitHub Action Run
20 run-3.3-gemfiles/rack_2_2.gemfile - 26785176904.20 01 Jun 2026 10:12PM UTC 165
95.61
GitHub Action Run
21 run-3.3-gemfiles/rack_3_1.gemfile - 26785176904.21 01 Jun 2026 10:11PM UTC 165
95.65
GitHub Action Run
22 run-4.0-gemfiles/grape_entity.gemfile - 26785176904.22 01 Jun 2026 10:12PM UTC 165
50.32
GitHub Action Run
23 run-4.0-gemfiles/rails_8_1.gemfile - 26785176904.23 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
24 run-3.3-gemfiles/rails_8_0.gemfile - 26785176904.24 01 Jun 2026 10:12PM UTC 166
95.65
GitHub Action Run
25 run-3.4-Gemfile - 26785176904.25 01 Jun 2026 10:11PM UTC 165
95.65
GitHub Action Run
26 run-3.3-Gemfile - 26785176904.26 01 Jun 2026 10:11PM UTC 165
95.65
GitHub Action Run
27 run-3.4-gemfiles/rack_3_1.gemfile - 26785176904.27 01 Jun 2026 10:11PM UTC 165
95.65
GitHub Action Run
28 run-4.0-gemfiles/hashie.gemfile - 26785176904.28 01 Jun 2026 10:11PM UTC 165
62.52
GitHub Action Run
29 run-4.0-gemfiles/rack_2_2.gemfile - 26785176904.29 01 Jun 2026 10:11PM UTC 165
95.61
GitHub Action Run
30 run-4.0-Gemfile - 26785176904.30 01 Jun 2026 10:12PM UTC 165
95.65
GitHub Action Run
Source Files on build 26785176904
  • Tree
  • List 166
  • Changed 148
  • Source Changed 3
  • Coverage Changed 148
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26785176904
  • Pull Request #2757
  • PR Base - master (#26755015790)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc