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

ruby-grape / grape / 30216088388
97%

Build:
DEFAULT BRANCH: master
Ran 26 Jul 2026 07:04PM UTC
Jobs 32
Files 168
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

26 Jul 2026 07:04PM UTC coverage: 96.916% (+0.005%) from 96.911%
30216088388

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)

1167 of 1258 branches covered (92.77%)

Branch coverage included in aggregate %.

3799 of 3866 relevant lines covered (98.27%)

25083.71 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
93.94
0.19% lib/grape/validations/types/dry_type_coercer.rb
1
90.0
0.34% 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-4.0-gemfiles/multi_json_1_20.gemfile - 30216088388.1 26 Jul 2026 07:04PM UTC 167
48.3
GitHub Action Run
2 run-4.0-gemfiles/hashie.gemfile - 30216088388.2 26 Jul 2026 07:04PM UTC 167
62.58
GitHub Action Run
3 run-4.0-gemfiles/dry_validation.gemfile - 30216088388.3 26 Jul 2026 07:05PM UTC 167
58.62
GitHub Action Run
4 run-4.0-gemfiles/rack_3_1.gemfile - 30216088388.4 26 Jul 2026 07:04PM UTC 167
95.53
GitHub Action Run
5 run-3.3-Gemfile - 30216088388.5 26 Jul 2026 07:04PM UTC 167
95.52
GitHub Action Run
6 run-4.0-gemfiles/rails_8_0.gemfile - 30216088388.6 26 Jul 2026 07:05PM UTC 168
95.53
GitHub Action Run
7 run-3.4-gemfiles/rails_7_2.gemfile - 30216088388.7 26 Jul 2026 07:05PM UTC 168
95.53
GitHub Action Run
8 run-3.3-gemfiles/rack_2_2.gemfile - 30216088388.8 26 Jul 2026 07:04PM UTC 167
95.49
GitHub Action Run
9 run-3.4-gemfiles/rack_3_2.gemfile - 30216088388.9 26 Jul 2026 07:05PM UTC 167
95.53
GitHub Action Run
10 run-3.4-gemfiles/rails_8_0.gemfile - 30216088388.10 26 Jul 2026 07:05PM UTC 168
95.53
GitHub Action Run
11 run-4.0-gemfiles/rails_7_2.gemfile - 30216088388.11 26 Jul 2026 07:05PM UTC 168
95.53
GitHub Action Run
12 run-4.0-gemfiles/multi_xml.gemfile - 30216088388.12 26 Jul 2026 07:05PM UTC 167
47.66
GitHub Action Run
13 run-4.0-gemfiles/multi_json.gemfile - 30216088388.13 26 Jul 2026 07:05PM UTC 167
48.26
GitHub Action Run
14 run-3.4-gemfiles/rack_3_1.gemfile - 30216088388.14 26 Jul 2026 07:05PM UTC 167
95.53
GitHub Action Run
15 run-4.0-gemfiles/rack_2_2.gemfile - 30216088388.15 26 Jul 2026 07:04PM UTC 167
95.49
GitHub Action Run
16 run-3.3-gemfiles/rack_3_1.gemfile - 30216088388.16 26 Jul 2026 07:04PM UTC 167
95.52
GitHub Action Run
17 run-3.4-gemfiles/rails_8_1.gemfile - 30216088388.17 26 Jul 2026 07:05PM UTC 168
95.53
GitHub Action Run
18 run-3.4-Gemfile - 30216088388.18 26 Jul 2026 07:05PM UTC 167
95.53
GitHub Action Run
19 run-4.0-gemfiles/grape_swagger.gemfile - 30216088388.19 26 Jul 2026 07:05PM UTC 167
55.92
GitHub Action Run
20 run-4.0-gemfiles/rack_3_2.gemfile - 30216088388.20 26 Jul 2026 07:04PM UTC 167
95.53
GitHub Action Run
21 run-3.3-gemfiles/rack_3_0.gemfile - 30216088388.21 26 Jul 2026 07:04PM UTC 167
95.52
GitHub Action Run
22 run-3.4-gemfiles/rack_3_0.gemfile - 30216088388.22 26 Jul 2026 07:05PM UTC 167
95.53
GitHub Action Run
23 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30216088388.23 26 Jul 2026 07:05PM UTC 167
47.69
GitHub Action Run
24 run-3.3-gemfiles/rails_7_2.gemfile - 30216088388.24 26 Jul 2026 07:05PM UTC 168
95.53
GitHub Action Run
25 run-4.0-gemfiles/grape_entity.gemfile - 30216088388.25 26 Jul 2026 07:04PM UTC 167
50.98
GitHub Action Run
26 run-4.0-Gemfile - 30216088388.26 26 Jul 2026 07:04PM UTC 167
95.53
GitHub Action Run
27 run-4.0-gemfiles/rails_8_1.gemfile - 30216088388.27 26 Jul 2026 07:04PM UTC 168
95.53
GitHub Action Run
28 run-4.0-gemfiles/rack_3_0.gemfile - 30216088388.28 26 Jul 2026 07:05PM UTC 167
95.53
GitHub Action Run
29 run-3.3-gemfiles/rails_8_0.gemfile - 30216088388.29 26 Jul 2026 07:04PM UTC 168
95.53
GitHub Action Run
30 run-3.4-gemfiles/rack_2_2.gemfile - 30216088388.30 26 Jul 2026 07:04PM UTC 167
95.49
GitHub Action Run
31 run-3.3-gemfiles/rack_3_2.gemfile - 30216088388.31 26 Jul 2026 07:04PM UTC 167
95.52
GitHub Action Run
32 run-3.3-gemfiles/rails_8_1.gemfile - 30216088388.32 26 Jul 2026 07:04PM UTC 168
95.53
GitHub Action Run
Source Files on build 30216088388
  • 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 Repo
  • Github Actions Build #30216088388
  • e209dbe7 on github
  • Prev Build on master (#30215793031)
  • Next Build on master (#30226794786)
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