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

ruby-grape / grape / 30306850824 / 19
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 27 Jul 2026 09:27PM UTC
Files 166
Run time 4s
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

27 Jul 2026 09:26PM UTC coverage: 95.576% (-0.004%) from 95.58%
30306850824.19

Pull #2835

github

ericproulx
Return the compiled instance from Grape::API::Instance.compile!

.call and .recognize_path compiled the API and then read @instance again
to serve the request:

    def call(env)
      compile!
      @instance.call(env)
    end

change! (which `helpers` and `mount` invoke on a live API) sets @instance
to nil, so a change! landing between the two reads leaves both methods
calling nil -- NoMethodError: undefined method 'call' for nil.

Have compile! hand back the instance it compiled and let both callers use
that value, so the read is atomic. compile! previously returned nil when
the API was already compiled, so always returning the instance is a
strict superset of its old contract.

The window is small in practice -- a request thread spends nearly all of
its time inside `new` when recompiling -- so this is a latent race rather
than one reproduced under natural contention; the specs drive change!
into the window deterministically.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2835: Return the compiled instance from Grape::API::Instance.compile!

1167 of 1280 branches covered (91.17%)

Branch coverage included in aggregate %.

3737 of 3851 relevant lines covered (97.04%)

1117.07 hits per line

Source Files on job run-3.4-Gemfile - 30306850824.19
  • Tree
  • List 166
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30306850824
  • 6c2080a5 on github
  • Prev Job for on fix-compile-instance-race (#30306029090.28)
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