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

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

Build:
Build:
LAST BUILD BRANCH: refactor/drop-indifferent-and-reverse-merge-requires
DEFAULT BRANCH: master
Ran 12 May 2026 06:46AM UTC
Jobs 37
Files 159
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

12 May 2026 06:45AM UTC coverage: 97.017% (+0.001%) from 97.016%
25718249966

Pull #2706

github

ericproulx
Make ParamsScope#validates pure via ValidationsSpec

`Grape::Validations::ParamsScope#validates(attrs, validations)` used
to consume the validations hash destructively across six helpers
(`infer_coercion`, `derive_validator_options`, `validates_presence`,
`coerce_type`, `document_params`, `extract_details`). The caller's
hash was mutated in place; passing a frozen hash would crash the
pipeline.

Introduces `Grape::Validations::ValidationsSpec` — a small frozen
value object that parses the raw hash once and exposes named
accessors. `validates` becomes a thin dispatcher that hands the spec
to the helpers; the raw hash is never written to. Helpers that used
to read/delete are gone:

  * `infer_coercion` → `ValidationsSpec#parse_coerce` (private)
  * `derive_validator_options` → `ValidationsSpec#shared_opts`
  * `validates_presence` → `ParamsScope#validate_presence(spec, ...)`
  * `coerce_type` (the helper) → `ParamsScope#validate_coerce(spec, ...)`
  * `guess_coerce_type` → `ValidationsSpec#guess_coerce_type` (private)
  * `options_key?` → no longer needed; `ValidationsSpec#resolve_value`

`ParamsDocumentation#document_params` now takes the spec instead of
the raw hash and reads via `spec.raw[...]` without deletion. The
`do_not_document` short-circuit no longer mutates either; it just
returns early.

Behaviour preserved:

  * Order of validator dispatch (presence → coerce → others).
  * `:message` belonging to presence is suppressed for later
    validators (it's in `SPEC_CONSUMED_KEYS`).
  * `:allow_blank` and `:length` remain dual-purpose (shared opt + own
    validator entry; doc source + own validator entry).
  * `check_coerce_with` still raises `ArgumentError` at definition
    time when `coerce_with:` is supplied without a type.

Adds:

  * `lib/grape/validations/validations_spec.rb` — value object.
  * `spec/grape/validations/validations_spec_spec.rb` — unit tests
    including a frozen-hash test that asserts `from(frozen_hash)` does
    not raise... (continued)
Pull Request #2706: Make ParamsScope#validates pure via ValidationsSpec (closes #2517)

1077 of 1161 branches covered (92.76%)

Branch coverage included in aggregate %.

87 of 87 new or added lines in 3 files covered. (100.0%)

3476 of 3532 relevant lines covered (98.41%)

32109.24 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/dry_validation.gemfile - 25718249966.1 12 May 2026 06:49AM UTC 158
58.09
GitHub Action Run
2 run-3.3-gemfiles/rack_2_2.gemfile - 25718249966.2 12 May 2026 06:46AM UTC 158
95.66
GitHub Action Run
3 run-3.3-gemfiles/rack_3_0.gemfile - 25718249966.3 12 May 2026 06:50AM UTC 158
95.71
GitHub Action Run
4 run-3.2-Gemfile - 25718249966.4 12 May 2026 06:47AM UTC 158
95.75
GitHub Action Run
5 run-4.0-gemfiles/grape_entity.gemfile - 25718249966.5 12 May 2026 06:49AM UTC 158
50.02
GitHub Action Run
6 run-4.0-gemfiles/rack_2_2.gemfile - 25718249966.6 12 May 2026 06:47AM UTC 158
95.69
GitHub Action Run
7 run-4.0-gemfiles/rack_3_0.gemfile - 25718249966.7 12 May 2026 06:50AM UTC 158
95.73
GitHub Action Run
8 run-3.2-gemfiles/rack_3_1.gemfile - 25718249966.8 12 May 2026 06:47AM UTC 158
95.75
GitHub Action Run
9 run-3.2-gemfiles/rack_2_2.gemfile - 25718249966.9 12 May 2026 06:46AM UTC 158
95.71
GitHub Action Run
10 run-3.2-gemfiles/rails_8_1.gemfile - 25718249966.10 12 May 2026 06:48AM UTC 159
95.76
GitHub Action Run
11 run-4.0-Gemfile - 25718249966.11 12 May 2026 06:50AM UTC 158
95.73
GitHub Action Run
12 run-3.4-gemfiles/rails_7_2.gemfile - 25718249966.12 12 May 2026 06:47AM UTC 159
95.73
GitHub Action Run
13 run-4.0-gemfiles/rack_3_2.gemfile - 25718249966.13 12 May 2026 06:48AM UTC 158
95.73
GitHub Action Run
14 run-3.2-gemfiles/rails_8_0.gemfile - 25718249966.14 12 May 2026 06:47AM UTC 159
95.76
GitHub Action Run
15 run-3.2-gemfiles/rack_3_0.gemfile - 25718249966.15 12 May 2026 06:47AM UTC 158
95.75
GitHub Action Run
16 run-3.3-gemfiles/rack_3_2.gemfile - 25718249966.16 12 May 2026 06:50AM UTC 158
95.71
GitHub Action Run
17 run-3.2-gemfiles/rails_7_2.gemfile - 25718249966.17 12 May 2026 06:47AM UTC 159
95.76
GitHub Action Run
18 run-3.2-gemfiles/rack_3_2.gemfile - 25718249966.18 12 May 2026 06:47AM UTC 158
95.75
GitHub Action Run
19 run-3.3-gemfiles/rack_3_1.gemfile - 25718249966.19 12 May 2026 06:50AM UTC 158
95.71
GitHub Action Run
20 run-3.3-gemfiles/rails_8_1.gemfile - 25718249966.20 12 May 2026 06:48AM UTC 159
95.71
GitHub Action Run
21 run-4.0-gemfiles/hashie.gemfile - 25718249966.21 12 May 2026 06:49AM UTC 158
62.62
GitHub Action Run
22 run-3.4-gemfiles/rack_3_1.gemfile - 25718249966.22 12 May 2026 06:48AM UTC 158
95.73
GitHub Action Run
23 run-3.4-gemfiles/rails_8_0.gemfile - 25718249966.23 12 May 2026 06:51AM UTC 159
95.73
GitHub Action Run
24 run-4.0-gemfiles/rails_7_2.gemfile - 25718249966.24 12 May 2026 06:48AM UTC 159
95.73
GitHub Action Run
25 run-4.0-gemfiles/multi_json.gemfile - 25718249966.25 12 May 2026 06:49AM UTC 158
36.14
GitHub Action Run
26 run-3.3-gemfiles/rails_8_0.gemfile - 25718249966.26 12 May 2026 06:49AM UTC 159
95.71
GitHub Action Run
27 run-3.4-gemfiles/rack_3_0.gemfile - 25718249966.27 12 May 2026 06:48AM UTC 158
95.73
GitHub Action Run
28 run-3.4-Gemfile - 25718249966.28 12 May 2026 06:49AM UTC 158
95.73
GitHub Action Run
29 run-3.3-gemfiles/rails_7_2.gemfile - 25718249966.29 12 May 2026 06:47AM UTC 159
95.71
GitHub Action Run
30 run-4.0-gemfiles/rack_3_1.gemfile - 25718249966.30 12 May 2026 06:49AM UTC 158
95.73
GitHub Action Run
31 run-3.4-gemfiles/rails_8_1.gemfile - 25718249966.31 12 May 2026 06:47AM UTC 159
95.73
GitHub Action Run
32 run-4.0-gemfiles/rails_8_0.gemfile - 25718249966.32 12 May 2026 06:51AM UTC 159
95.73
GitHub Action Run
33 run-3.3-Gemfile - 25718249966.33 12 May 2026 06:47AM UTC 158
95.71
GitHub Action Run
34 run-3.4-gemfiles/rack_3_2.gemfile - 25718249966.34 12 May 2026 06:50AM UTC 158
95.73
GitHub Action Run
35 run-4.0-gemfiles/rails_8_1.gemfile - 25718249966.35 12 May 2026 06:50AM UTC 159
95.73
GitHub Action Run
36 run-4.0-gemfiles/multi_xml.gemfile - 25718249966.36 12 May 2026 06:48AM UTC 158
36.14
GitHub Action Run
37 run-3.4-gemfiles/rack_2_2.gemfile - 25718249966.37 12 May 2026 06:47AM UTC 158
95.69
GitHub Action Run
Source Files on build 25718249966
  • Tree
  • List 159
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25718249966
  • Pull Request #2706
  • PR Base - master (#25643371840)
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