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

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

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

21 Mar 2026 10:40PM UTC coverage: 96.773% (-0.07%) from 96.843%
23390393427

Pull #2657

github

ericproulx
Instantiate validators at definition time

Validators are now instantiated once at route definition time and frozen,
rather than per-request via ValidatorFactory. This removes repeated object
allocation from the hot path and moves option parsing, converter building,
and message formatting into initialize.

- Remove ValidatorFactory; ParamsScope#validate instantiates validators directly
- Freeze validator instances via Base.new override (super.freeze)
- Add Grape::Util::DeepFreeze to recursively freeze Hash/Array/String options
- Freeze ParamsScope at end of initialize; cache full_path as @full_path
- Promote validate_param! to protected with NotImplementedError default
- Extract validation_error!, hash_like?, option_value, scrub helpers in Base
- Add default_message_key class macro for pre-computing exception messages
- Eager-initialize all built-in validators (coerce, default, values, regexp, etc.)
- ContractScopeValidator no longer inherits Base (standalone with freeze)
- coerce_type receives only extracted coerce keys; callers skip manual deletes
- Add DeepFreeze spec; add SameAsValidator and ExceptValuesValidator specs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request #2657: Instantiate validators at definition time

1071 of 1162 branches covered (92.17%)

Branch coverage included in aggregate %.

190 of 192 new or added lines in 20 files covered. (98.96%)

3368 of 3425 relevant lines covered (98.34%)

33012.4 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
96.55
0.55% lib/grape/validations/validators/base.rb
1
92.31
-7.69% lib/grape/validations/validators/default_validator.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.2-gemfiles/rack_3_2.gemfile - 23390393427.1 21 Mar 2026 10:41PM UTC 154
95.67
GitHub Action Run
2 run-4.0-gemfiles/hashie.gemfile - 23390393427.2 21 Mar 2026 10:42PM UTC 154
61.95
GitHub Action Run
3 run-3.4-Gemfile - 23390393427.3 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
4 run-3.2-gemfiles/rails_7_2.gemfile - 23390393427.4 21 Mar 2026 10:41PM UTC 155
95.68
GitHub Action Run
5 run-4.0-gemfiles/rails_8_1.gemfile - 23390393427.5 21 Mar 2026 10:42PM UTC 155
95.66
GitHub Action Run
6 run-4.0-gemfiles/rails_7_2.gemfile - 23390393427.6 21 Mar 2026 10:42PM UTC 155
95.66
GitHub Action Run
7 run-4.0-gemfiles/multi_json.gemfile - 23390393427.7 21 Mar 2026 10:41PM UTC 154
35.62
GitHub Action Run
8 run-4.0-gemfiles/rack_3_0.gemfile - 23390393427.8 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
9 run-3.4-gemfiles/rack_3_2.gemfile - 23390393427.9 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
10 run-4.0-gemfiles/rack_3_1.gemfile - 23390393427.10 21 Mar 2026 10:42PM UTC 154
95.65
GitHub Action Run
11 run-3.4-gemfiles/rails_8_1.gemfile - 23390393427.11 21 Mar 2026 10:41PM UTC 155
95.66
GitHub Action Run
12 run-3.3-gemfiles/rails_7_2.gemfile - 23390393427.12 21 Mar 2026 10:41PM UTC 155
95.63
GitHub Action Run
13 run-3.2-gemfiles/rails_8_1.gemfile - 23390393427.13 21 Mar 2026 10:41PM UTC 155
95.68
GitHub Action Run
14 run-3.4-gemfiles/rack_2_2.gemfile - 23390393427.14 21 Mar 2026 10:42PM UTC 154
95.61
GitHub Action Run
15 run-4.0-gemfiles/rack_2_2.gemfile - 23390393427.15 21 Mar 2026 10:41PM UTC 154
95.61
GitHub Action Run
16 run-3.2-gemfiles/rack_3_1.gemfile - 23390393427.16 21 Mar 2026 10:41PM UTC 154
95.67
GitHub Action Run
17 run-3.3-gemfiles/rack_3_1.gemfile - 23390393427.17 21 Mar 2026 10:41PM UTC 154
95.63
GitHub Action Run
18 run-3.3-gemfiles/rails_8_1.gemfile - 23390393427.18 21 Mar 2026 10:41PM UTC 155
95.63
GitHub Action Run
19 run-3.2-gemfiles/rails_8_0.gemfile - 23390393427.19 21 Mar 2026 10:41PM UTC 155
95.68
GitHub Action Run
20 run-3.2-Gemfile - 23390393427.20 21 Mar 2026 10:41PM UTC 154
95.67
GitHub Action Run
21 run-3.4-gemfiles/rails_7_2.gemfile - 23390393427.21 21 Mar 2026 10:41PM UTC 155
95.66
GitHub Action Run
22 run-3.4-gemfiles/rails_8_0.gemfile - 23390393427.22 21 Mar 2026 10:41PM UTC 155
95.66
GitHub Action Run
23 run-4.0-gemfiles/dry_validation.gemfile - 23390393427.23 21 Mar 2026 10:41PM UTC 154
57.32
GitHub Action Run
24 run-4.0-gemfiles/rack_3_2.gemfile - 23390393427.24 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
25 run-4.0-gemfiles/grape_entity.gemfile - 23390393427.25 21 Mar 2026 10:42PM UTC 154
49.37
GitHub Action Run
26 run-3.4-gemfiles/rack_3_0.gemfile - 23390393427.26 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
27 run-3.3-gemfiles/rails_8_0.gemfile - 23390393427.27 21 Mar 2026 10:41PM UTC 155
95.63
GitHub Action Run
28 run-4.0-gemfiles/rails_8_0.gemfile - 23390393427.28 21 Mar 2026 10:42PM UTC 155
95.66
GitHub Action Run
29 run-3.2-gemfiles/rack_3_0.gemfile - 23390393427.29 21 Mar 2026 10:41PM UTC 154
95.67
GitHub Action Run
30 run-3.4-gemfiles/rack_3_1.gemfile - 23390393427.30 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
31 run-3.3-Gemfile - 23390393427.31 21 Mar 2026 10:41PM UTC 154
95.63
GitHub Action Run
32 run-4.0-gemfiles/multi_xml.gemfile - 23390393427.32 21 Mar 2026 10:42PM UTC 154
35.62
GitHub Action Run
33 run-3.3-gemfiles/rack_3_0.gemfile - 23390393427.33 21 Mar 2026 10:41PM UTC 154
95.63
GitHub Action Run
34 run-3.2-gemfiles/rack_2_2.gemfile - 23390393427.34 21 Mar 2026 10:41PM UTC 154
95.63
GitHub Action Run
35 run-4.0-Gemfile - 23390393427.35 21 Mar 2026 10:41PM UTC 154
95.65
GitHub Action Run
36 run-3.3-gemfiles/rack_2_2.gemfile - 23390393427.36 21 Mar 2026 10:41PM UTC 154
95.59
GitHub Action Run
37 run-3.3-gemfiles/rack_3_2.gemfile - 23390393427.37 21 Mar 2026 10:41PM UTC 154
95.63
GitHub Action Run
Source Files on build 23390393427
  • Tree
  • List 155
  • Changed 20
  • Source Changed 19
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #23390393427
  • Pull Request #2657
  • PR Base - master (#22995857569)
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