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

ruby-grape / grape / 23097820301 / 34
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: revisit_validators
DEFAULT BRANCH: master
Ran 14 Mar 2026 10:36PM UTC
Files 155
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

14 Mar 2026 10:34PM UTC coverage: 95.576% (-0.1%) from 95.697%
23097820301.34

Pull #2657

github

ericproulx
Instantiate validators at definition time

Validators are now instantiated once at route definition time rather
than per-request, eliminating repeated allocation overhead. Instances
are frozen to make them safe for sharing across requests.

Freezing strategy: inputs (attrs, options, opts) are frozen at the DSL
boundary before entering the validator, so subclass ivars derived from
them are frozen by construction. Base.new reduces to super.freeze.
Remove freeze_state! and ValidatorFactory.

ParamsScope: precompute full_path via build_full_path before
instance_eval so child scopes can read the parent path immediately.
Simplify meets_hash_dependency? with all? and dependency.first.

Validators::Base: add validation_error! helper to replace repeated
Grape::Exceptions::Validation.new calls across single-attr validators.

Fix DefaultValidator to always dup duplicable default values regardless
of frozen state, preserving per-request isolation.

Add DeepFreeze utility (freezes Hash/Array/String recursively, skips
Procs, coercers, and classes). Add specs for DeepFreeze,
SameAsValidator, and ExceptValuesValidator.
Pull Request #2657: Instantiate validators at definition time

1052 of 1166 branches covered (90.22%)

Branch coverage included in aggregate %.

3334 of 3423 relevant lines covered (97.4%)

1021.83 hits per line

Source Files on job run-3.3-gemfiles/rails_8_1.gemfile - 23097820301.34
  • Tree
  • List 155
  • Changed 18
  • Source Changed 18
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 23097820301
  • 2d51b322 on github
  • Prev Job for on revisit_validators (#22995857569.36)
  • Next Job for on revisit_validators (#23119888558.3)
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