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

ruby-grape / grape / 30216088388 / 32
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 26 Jul 2026 07:05PM UTC
Files 168
Run time 5s
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

26 Jul 2026 07:04PM UTC coverage: 95.528% (+0.03%) from 95.501%
30216088388.32

push

github

web-flow
Remove request-time mutable state from Array and custom-type coercers (#2817)

* Remove request-time mutable state from Array/custom coercers

Two coercers created or mutated state at request time on instances that
are shared across requests (and cached in Types::CoercerCache):

- ArrayCoercer memoized @elem_coercer with ||= inside #call, so the
  first request to hit a shared instance wrote a new ivar (and could
  seed the unsynchronized DryTypes cache). Build it eagerly in
  initialize instead; rename the now-unused @subtype accordingly.
  SetCoercer inherits the eager build via super.

- CustomTypeCoercer#collection_symbolizer called map! on whatever the
  user's coerce_with method returned. A frozen return raised FrozenError,
  which CoerceValidator swallowed as a spurious "is invalid" 400; the
  input could also be the user's own object. dup before map! avoids the
  mutation and, unlike map, keeps a Set a Set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* 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 up... (continued)

1142 of 1258 branches covered (90.78%)

Branch coverage included in aggregate %.

3750 of 3863 relevant lines covered (97.07%)

1043.22 hits per line

Source Files on job run-3.3-gemfiles/rails_8_1.gemfile - 30216088388.32
  • Tree
  • List 168
  • Changed 11
  • Source Changed 11
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30216088388
  • e209dbe7 on github
  • Prev Job for on master (#30215793031.3)
  • Next Job for on master (#30226794786.17)
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