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

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

Build:
Build:
LAST BUILD BRANCH: revisit_validators
DEFAULT BRANCH: master
Ran 14 Mar 2026 09:54PM 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

14 Mar 2026 09:53PM UTC coverage: 96.715% (-0.1%) from 96.843%
23097149382

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

1073 of 1166 branches covered (92.02%)

Branch coverage included in aggregate %.

165 of 168 new or added lines in 19 files covered. (98.21%)

3372 of 3430 relevant lines covered (98.31%)

32668.49 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
92.31
-7.69% lib/grape/validations/validators/default_validator.rb
2
91.55
-4.45% lib/grape/validations/validators/base.rb
Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rack_2_2.gemfile - 23097149382.1 14 Mar 2026 09:54PM UTC 154
95.55
GitHub Action Run
2 run-4.0-gemfiles/multi_xml.gemfile - 23097149382.2 14 Mar 2026 09:55PM UTC 154
35.38
GitHub Action Run
3 run-4.0-gemfiles/hashie.gemfile - 23097149382.3 14 Mar 2026 09:54PM UTC 154
61.59
GitHub Action Run
4 run-4.0-gemfiles/multi_json.gemfile - 23097149382.4 14 Mar 2026 09:54PM UTC 154
35.38
GitHub Action Run
5 run-4.0-gemfiles/dry_validation.gemfile - 23097149382.5 14 Mar 2026 09:54PM UTC 154
57.1
GitHub Action Run
6 run-4.0-gemfiles/rails_8_1.gemfile - 23097149382.6 14 Mar 2026 09:54PM UTC 155
95.6
GitHub Action Run
7 run-3.3-gemfiles/rails_8_1.gemfile - 23097149382.7 14 Mar 2026 09:54PM UTC 155
95.58
GitHub Action Run
8 run-4.0-gemfiles/grape_entity.gemfile - 23097149382.8 14 Mar 2026 09:55PM UTC 154
48.88
GitHub Action Run
9 run-3.3-Gemfile - 23097149382.9 14 Mar 2026 09:54PM UTC 154
95.57
GitHub Action Run
10 run-4.0-gemfiles/rack_3_1.gemfile - 23097149382.10 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
11 run-3.3-gemfiles/rack_3_1.gemfile - 23097149382.11 14 Mar 2026 09:54PM UTC 154
95.57
GitHub Action Run
12 run-3.4-gemfiles/rails_7_2.gemfile - 23097149382.12 14 Mar 2026 09:55PM UTC 155
95.6
GitHub Action Run
13 run-3.2-gemfiles/rails_7_2.gemfile - 23097149382.13 14 Mar 2026 09:54PM UTC 155
95.62
GitHub Action Run
14 run-3.4-Gemfile - 23097149382.14 14 Mar 2026 09:55PM UTC 154
95.59
GitHub Action Run
15 run-3.3-gemfiles/rack_2_2.gemfile - 23097149382.15 14 Mar 2026 09:54PM UTC 154
95.53
GitHub Action Run
16 run-3.2-gemfiles/rack_3_1.gemfile - 23097149382.16 14 Mar 2026 09:54PM UTC 154
95.62
GitHub Action Run
17 run-3.3-gemfiles/rack_3_2.gemfile - 23097149382.17 14 Mar 2026 09:55PM UTC 154
95.57
GitHub Action Run
18 run-3.4-gemfiles/rails_8_0.gemfile - 23097149382.18 14 Mar 2026 09:55PM UTC 155
95.6
GitHub Action Run
19 run-4.0-gemfiles/rails_8_0.gemfile - 23097149382.19 14 Mar 2026 09:55PM UTC 155
95.6
GitHub Action Run
20 run-3.2-gemfiles/rails_8_1.gemfile - 23097149382.20 14 Mar 2026 09:55PM UTC 155
95.62
GitHub Action Run
21 run-3.4-gemfiles/rack_3_2.gemfile - 23097149382.21 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
22 run-4.0-gemfiles/rack_3_0.gemfile - 23097149382.22 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
23 run-3.2-gemfiles/rack_3_2.gemfile - 23097149382.23 14 Mar 2026 09:54PM UTC 154
95.62
GitHub Action Run
24 run-3.4-gemfiles/rack_3_0.gemfile - 23097149382.24 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
25 run-4.0-gemfiles/rack_3_2.gemfile - 23097149382.25 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
26 run-3.3-gemfiles/rack_3_0.gemfile - 23097149382.26 14 Mar 2026 09:54PM UTC 154
95.57
GitHub Action Run
27 run-4.0-Gemfile - 23097149382.27 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
28 run-3.2-Gemfile - 23097149382.28 14 Mar 2026 09:54PM UTC 154
95.62
GitHub Action Run
29 run-3.3-gemfiles/rails_8_0.gemfile - 23097149382.29 14 Mar 2026 09:54PM UTC 155
95.58
GitHub Action Run
30 run-3.4-gemfiles/rails_8_1.gemfile - 23097149382.30 14 Mar 2026 09:55PM UTC 155
95.6
GitHub Action Run
31 run-3.2-gemfiles/rack_3_0.gemfile - 23097149382.31 14 Mar 2026 09:54PM UTC 154
95.62
GitHub Action Run
32 run-3.4-gemfiles/rack_2_2.gemfile - 23097149382.32 14 Mar 2026 09:54PM UTC 154
95.55
GitHub Action Run
33 run-3.2-gemfiles/rails_8_0.gemfile - 23097149382.33 14 Mar 2026 09:54PM UTC 155
95.62
GitHub Action Run
34 run-4.0-gemfiles/rails_7_2.gemfile - 23097149382.34 14 Mar 2026 09:54PM UTC 155
95.6
GitHub Action Run
35 run-3.2-gemfiles/rack_2_2.gemfile - 23097149382.35 14 Mar 2026 09:54PM UTC 154
95.57
GitHub Action Run
36 run-3.3-gemfiles/rails_7_2.gemfile - 23097149382.36 14 Mar 2026 09:55PM UTC 155
95.58
GitHub Action Run
37 run-3.4-gemfiles/rack_3_1.gemfile - 23097149382.37 14 Mar 2026 09:54PM UTC 154
95.59
GitHub Action Run
Source Files on build 23097149382
  • Tree
  • List 155
  • Changed 20
  • Source Changed 18
  • Coverage Changed 20
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #23097149382
  • 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