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

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

Build:
Build:
LAST BUILD BRANCH: robust_mounted_app_comparison
DEFAULT BRANCH: master
Ran 24 May 2026 07:18PM UTC
Jobs 38
Files 164
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

24 May 2026 07:18PM UTC coverage: 96.729% (-0.2%) from 96.977%
26370397176

Pull #2718

github

ericproulx
Generalize middleware options to per-class Data value objects

Following the per-feature `VersionOptions` / `RescueOptions` work in #2712
and #2716, middlewares that want typed option accessors now declare a
per-class `Options = Data.define(...)`.

`Middleware::Base#initialize`, when the subclass declares an `Options`
constant (ancestor search included), routes the kwargs through
`Options.new(**options)`:

- `@config` exposes the typed Data instance (named accessors).
- `@options` keeps returning a frozen `Hash` representation
  (`config.to_h.freeze`) for back-compat with subclasses that read
  `options[:key]`.

Subclasses without an `Options` constant still flow through the
`DEFAULT_OPTIONS` Hash + `deep_merge` path (`Filter`, `Auth::*`) unchanged.

- `Middleware::Formatter` (5 fields).
- `Middleware::Error` (14 fields). `rescue_options:` defaults to
  `Grape::DSL::RescueOptions.new`; an explicit nil (passed by
  `Endpoint#error_middleware_options` when no `rescue_from` was called)
  is coerced to the default in the initializer.
- `Middleware::Versioner::Base` (7 fields). Adds `content_types:` /
  `format:` so the `PrecomputedContentTypes` mixin's accessor reads land
  cleanly. `version_options:` defaults to `Grape::DSL::VersionOptions.new`.

Each `Options` field list is alphabetic.

- `attr_reader :options` still returns a frozen `Hash` for converted
  middlewares (now derived from `config.to_h`). Subclasses that read
  `options[:key]` keep working.
- `DEFAULT_OPTIONS` is restored as `Options.new.to_h.freeze` on each
  converted middleware so existing references continue to resolve.
  Marked `@deprecated` in the YARD comment; will be removed in a future
  release.
- `Options#[]` is defined on each Data class as a Hash-style shim that
  emits a deprecation warning via `Grape.deprecator` and forwards to
  the named accessor — gives any code that discovers the Data and
  reaches in with `[:key]` a migration nudge.

Passing an unknown kwarg to a convert... (continued)
Pull Request #2718: [DRAFT] Generalize middleware options to per-class Data value objects

1090 of 1181 branches covered (92.29%)

Branch coverage included in aggregate %.

31 of 37 new or added lines in 5 files covered. (83.78%)

10 existing lines in 3 files now uncovered.

3523 of 3588 relevant lines covered (98.19%)

31353.1 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
91.04
-3.28% lib/grape/middleware/error.rb
2
94.4
-3.14% lib/grape/middleware/formatter.rb
2
91.84
-8.16% lib/grape/middleware/versioner/base.rb

Coverage Regressions

Lines Coverage ∆ File
6
91.04
-3.28% lib/grape/middleware/error.rb
3
94.4
-3.14% lib/grape/middleware/formatter.rb
1
91.84
-8.16% lib/grape/middleware/versioner/base.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rails_8_0.gemfile - 26370397176.1 24 May 2026 07:19PM UTC 164
95.45
GitHub Action Run
2 run-3.3-gemfiles/rack_2_2.gemfile - 26370397176.2 24 May 2026 07:18PM UTC 163
95.4
GitHub Action Run
3 run-3.2-Gemfile - 26370397176.3 24 May 2026 07:18PM UTC 163
95.49
GitHub Action Run
4 run-3.2-gemfiles/rack_3_0.gemfile - 26370397176.4 24 May 2026 07:18PM UTC 163
95.49
GitHub Action Run
5 run-3.2-gemfiles/rack_3_1.gemfile - 26370397176.5 24 May 2026 07:18PM UTC 163
95.49
GitHub Action Run
6 run-4.0-gemfiles/rack_3_2.gemfile - 26370397176.6 24 May 2026 07:19PM UTC 163
95.44
GitHub Action Run
7 run-3.2-gemfiles/rails_7_2.gemfile - 26370397176.7 24 May 2026 07:18PM UTC 164
95.49
GitHub Action Run
8 run-3.3-gemfiles/rack_3_1.gemfile - 26370397176.8 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
9 run-4.0-gemfiles/multi_xml.gemfile - 26370397176.9 24 May 2026 07:19PM UTC 163
36.86
GitHub Action Run
10 run-3.2-gemfiles/rails_8_0.gemfile - 26370397176.10 24 May 2026 07:18PM UTC 164
95.49
GitHub Action Run
11 run-4.0-gemfiles/rails_8_0.gemfile - 26370397176.11 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
12 run-4.0-Gemfile - 26370397176.12 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
13 run-3.2-gemfiles/rack_3_2.gemfile - 26370397176.13 24 May 2026 07:18PM UTC 163
95.49
GitHub Action Run
14 run-4.0-gemfiles/rails_7_2.gemfile - 26370397176.14 24 May 2026 07:19PM UTC 164
95.45
GitHub Action Run
15 run-3.3-gemfiles/rails_7_2.gemfile - 26370397176.15 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
16 run-4.0-gemfiles/grape_entity.gemfile - 26370397176.16 24 May 2026 07:18PM UTC 163
49.97
GitHub Action Run
17 run-4.0-gemfiles/rack_3_0.gemfile - 26370397176.17 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
18 run-4.0-gemfiles/rack_3_1.gemfile - 26370397176.18 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
19 run-3.3-gemfiles/rack_3_0.gemfile - 26370397176.19 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
20 run-3.4-gemfiles/rails_8_0.gemfile - 26370397176.20 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
21 run-3.4-gemfiles/rack_2_2.gemfile - 26370397176.21 24 May 2026 07:18PM UTC 163
95.4
GitHub Action Run
22 run-4.0-gemfiles/hashie.gemfile - 26370397176.22 24 May 2026 07:18PM UTC 163
62.17
GitHub Action Run
23 run-3.4-gemfiles/rack_3_0.gemfile - 26370397176.23 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
24 run-3.4-gemfiles/rails_7_2.gemfile - 26370397176.24 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
25 run-3.2-gemfiles/rack_2_2.gemfile - 26370397176.25 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
26 run-3.4-Gemfile - 26370397176.26 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
27 run-4.0-gemfiles/grape_swagger.gemfile - 26370397176.27 24 May 2026 07:19PM UTC 163
54.93
GitHub Action Run
28 run-4.0-gemfiles/dry_validation.gemfile - 26370397176.28 24 May 2026 07:18PM UTC 163
57.97
GitHub Action Run
29 run-4.0-gemfiles/rails_8_1.gemfile - 26370397176.29 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
30 run-3.4-gemfiles/rack_3_2.gemfile - 26370397176.30 24 May 2026 07:19PM UTC 163
95.44
GitHub Action Run
31 run-4.0-gemfiles/multi_json.gemfile - 26370397176.31 24 May 2026 07:19PM UTC 163
36.86
GitHub Action Run
32 run-3.3-gemfiles/rack_3_2.gemfile - 26370397176.32 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
33 run-3.3-Gemfile - 26370397176.33 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
34 run-3.2-gemfiles/rails_8_1.gemfile - 26370397176.34 24 May 2026 07:19PM UTC 164
95.49
GitHub Action Run
35 run-4.0-gemfiles/rack_2_2.gemfile - 26370397176.35 24 May 2026 07:19PM UTC 163
95.4
GitHub Action Run
36 run-3.4-gemfiles/rails_8_1.gemfile - 26370397176.36 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
37 run-3.4-gemfiles/rack_3_1.gemfile - 26370397176.37 24 May 2026 07:18PM UTC 163
95.44
GitHub Action Run
38 run-3.3-gemfiles/rails_8_1.gemfile - 26370397176.38 24 May 2026 07:18PM UTC 164
95.45
GitHub Action Run
Source Files on build 26370397176
  • Tree
  • List 164
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26370397176
  • Pull Request #2718
  • PR Base - master (#26292056269)
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