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

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

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 25 Jul 2026 07:50PM 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

25 Jul 2026 07:50PM UTC coverage: 96.835% (+0.007%) from 96.828%
30172405085

Pull #2819

github

ericproulx
Freeze coercers at construction and synchronize Grape::Util::Cache

Extends the validator freeze contract to the whole coercion layer,
naming the mechanism as Grape::Util::FreezeOnNew — extend into a class
whose instances are shared across requests and new returns a frozen
instance. A future request-time lazy ivar write raises FrozenError in
the first spec run instead of being a latent race. The module wraps new,
never initialize, so the freeze lands after the entire initialize chain
(SetCoercer assigns ivars after super); extending a hierarchy base
covers its subclasses via singleton-class inheritance.

- Extended into DryTypeCoercer (covers Primitive/Array/Set),
  CustomTypeCoercer (+ collection subclass), MultipleTypeCoercer
  (internal @type_coercers also frozen) and VariantCollectionCoercer.
  Validators::Base's hand-written new/super.freeze and
  ContractScopeValidator's end-of-initialize freeze now use the same
  module. DeepFreeze's obsolete "coercers memoize lazily" note updated.

- Grape::Util::Cache lookups are Monitor-synchronized. The caches are
  written at API *definition* time (params blocks run at class-body
  evaluation), which the compile-time Instance::LOCK does not cover and
  which can be concurrent (parallel eager loading, concurrent autoload
  of different API files). Monitor rather than Mutex because CoercerCache
  re-enters itself when a multiple-type coercer builds member coercers.

- Route#regexp_capture_index is assigned eagerly in #to_regexp instead
  of memoized on first read: the reader runs during request-time route
  matching on shared instances. Previously safe only because to_regexp
  happened to warm it during compilation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pull Request #2819: Freeze coercers at construction and synchronize Grape::Util::Cache

1137 of 1230 branches covered (92.44%)

Branch coverage included in aggregate %.

3758 of 3825 relevant lines covered (98.25%)

22893.09 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
93.94
0.19% lib/grape/validations/types/dry_type_coercer.rb
1
89.66
0.37% lib/grape/validations/types/variant_collection_coercer.rb
1
96.74
-0.04% lib/grape/validations/validators/base.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rack_3_0.gemfile - 30172405085.1 25 Jul 2026 07:50PM UTC 168
95.42
GitHub Action Run
2 run-4.0-Gemfile - 30172405085.2 25 Jul 2026 07:50PM UTC 168
95.42
GitHub Action Run
3 run-3.4-gemfiles/rails_8_0.gemfile - 30172405085.3 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
4 run-3.3-gemfiles/rails_7_2.gemfile - 30172405085.4 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
5 run-4.0-gemfiles/hashie.gemfile - 30172405085.5 25 Jul 2026 07:50PM UTC 168
62.86
GitHub Action Run
6 run-3.3-Gemfile - 30172405085.6 25 Jul 2026 07:50PM UTC 168
95.42
GitHub Action Run
7 run-3.3-gemfiles/rack_3_1.gemfile - 30172405085.7 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
8 run-3.4-Gemfile - 30172405085.8 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
9 run-4.0-gemfiles/rack_3_1.gemfile - 30172405085.9 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
10 run-4.0-gemfiles/multi_json.gemfile - 30172405085.10 25 Jul 2026 07:50PM UTC 168
48.45
GitHub Action Run
11 run-3.3-gemfiles/rack_2_2.gemfile - 30172405085.11 25 Jul 2026 07:51PM UTC 168
95.38
GitHub Action Run
12 run-3.4-gemfiles/rails_8_1.gemfile - 30172405085.12 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
13 run-3.4-gemfiles/rack_2_2.gemfile - 30172405085.13 25 Jul 2026 07:51PM UTC 168
95.39
GitHub Action Run
14 run-4.0-gemfiles/multi_xml.gemfile - 30172405085.14 25 Jul 2026 07:50PM UTC 168
47.87
GitHub Action Run
15 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30172405085.15 25 Jul 2026 07:51PM UTC 168
47.91
GitHub Action Run
16 run-3.4-gemfiles/rails_7_2.gemfile - 30172405085.16 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
17 run-4.0-gemfiles/rack_2_2.gemfile - 30172405085.17 25 Jul 2026 07:51PM UTC 168
95.39
GitHub Action Run
18 run-4.0-gemfiles/rails_7_2.gemfile - 30172405085.18 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
19 run-3.3-gemfiles/rails_8_0.gemfile - 30172405085.19 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
20 run-4.0-gemfiles/grape_swagger.gemfile - 30172405085.20 25 Jul 2026 07:51PM UTC 168
55.87
GitHub Action Run
21 run-4.0-gemfiles/rails_8_0.gemfile - 30172405085.21 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
22 run-3.3-gemfiles/rails_8_1.gemfile - 30172405085.22 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
23 run-3.4-gemfiles/rack_3_0.gemfile - 30172405085.23 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
24 run-4.0-gemfiles/dry_validation.gemfile - 30172405085.24 25 Jul 2026 07:51PM UTC 168
58.88
GitHub Action Run
25 run-3.4-gemfiles/rack_3_1.gemfile - 30172405085.25 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
26 run-4.0-gemfiles/rack_3_2.gemfile - 30172405085.26 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
27 run-4.0-gemfiles/grape_entity.gemfile - 30172405085.27 25 Jul 2026 07:51PM UTC 168
51.18
GitHub Action Run
28 run-4.0-gemfiles/rails_8_1.gemfile - 30172405085.28 25 Jul 2026 07:51PM UTC 169
95.43
GitHub Action Run
29 run-4.0-gemfiles/multi_json_1_20.gemfile - 30172405085.29 25 Jul 2026 07:51PM UTC 168
48.48
GitHub Action Run
30 run-4.0-gemfiles/rack_3_0.gemfile - 30172405085.30 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
31 run-3.3-gemfiles/rack_3_2.gemfile - 30172405085.31 25 Jul 2026 07:50PM UTC 168
95.42
GitHub Action Run
32 run-3.4-gemfiles/rack_3_2.gemfile - 30172405085.32 25 Jul 2026 07:51PM UTC 168
95.42
GitHub Action Run
Source Files on build 30172405085
  • Tree
  • List 169
  • Changed 10
  • Source Changed 10
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30172405085
  • Pull Request #2819
  • PR Base - fix-coercer-request-time-state (#30170426685)
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