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

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

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 27 Jul 2026 09:58PM UTC
Jobs 32
Files 167
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

27 Jul 2026 09:57PM UTC coverage: 96.972% (+0.006%) from 96.966%
30308956435

Pull #2836

github

ericproulx
Define #hash alongside the eql?/== pairs that lacked one

Five classes alias eql? to == without defining hash: Grape::Endpoint,
Grape::Util::InheritableSetting, Grape::Middleware::Stack::Middleware,
Grape::ServeStream::StreamResponse and Grape::ServeStream::FileBody.
Ruby requires equal objects to hash alike, so each of them silently
misbehaves in a Hash, a Set or under uniq -- equal objects land in
different buckets and never dedup. Grape::Namespace and
Grape::Util::MediaType already pair the two; this brings the rest in line.

Each hash mirrors exactly what its == compares, and nothing more:

- StreamResponse / FileBody key on stream / path alone. Their == does not
  check the class, so the class stays out of the hash.
- Middleware keys on the wrapped class, which also makes it agree with the
  class itself -- something its == accepts. The superclass fallback cannot
  be honoured (a class and its superclass hash differently); it only ever
  serves #index / #include?, which compare with == rather than by hash.
- Endpoint keys on config and inheritable_setting, omitting the class,
  since its == admits a subclass through is_a? and such a pair must agree.
- InheritableSetting keys on the resolved state (#to_hash). Its == accepts
  two instances whose own stores differ as long as their chains resolve
  alike, so hashing own state would tell those apart. The same-parent fast
  path implies equal resolved state, so it agrees too. This is the cold
  path -- nothing in Grape uses a setting as a Hash key, and == keeps
  avoiding to_hash wherever it can.

No caller in Grape relies on hash lookups for these, so this closes a
latent hole rather than fixing an observed failure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2836: Define #hash alongside the eql?/== pairs that lacked one

1195 of 1284 branches covered (93.07%)

Branch coverage included in aggregate %.

3801 of 3868 relevant lines covered (98.27%)

26776.6 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
98.04
0.02% lib/grape/endpoint.rb
1
94.12
0.18% lib/grape/middleware/stack.rb
Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30308956435.1 27 Jul 2026 09:58PM UTC 166
47.3
GitHub Action Run
2 run-4.0-gemfiles/hashie.gemfile - 30308956435.2 27 Jul 2026 09:58PM UTC 166
62.13
GitHub Action Run
3 run-3.4-gemfiles/rack_3_2.gemfile - 30308956435.3 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
4 run-4.0-gemfiles/grape_swagger.gemfile - 30308956435.4 27 Jul 2026 09:58PM UTC 166
55.48
GitHub Action Run
5 run-3.4-Gemfile - 30308956435.5 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
6 run-3.4-gemfiles/rack_2_2.gemfile - 30308956435.6 27 Jul 2026 09:58PM UTC 166
95.55
GitHub Action Run
7 run-4.0-gemfiles/rack_3_0.gemfile - 30308956435.7 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
8 run-4.0-gemfiles/multi_json_1_20.gemfile - 30308956435.8 27 Jul 2026 09:58PM UTC 166
47.9
GitHub Action Run
9 run-4.0-Gemfile - 30308956435.9 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
10 run-4.0-gemfiles/rails_8_1.gemfile - 30308956435.10 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
11 run-4.0-gemfiles/dry_validation.gemfile - 30308956435.11 27 Jul 2026 09:58PM UTC 166
58.18
GitHub Action Run
12 run-4.0-gemfiles/rails_8_0.gemfile - 30308956435.12 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
13 run-3.3-gemfiles/rack_3_2.gemfile - 30308956435.13 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
14 run-3.4-gemfiles/rails_8_1.gemfile - 30308956435.14 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
15 run-3.3-gemfiles/rack_3_0.gemfile - 30308956435.15 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
16 run-3.4-gemfiles/rails_7_2.gemfile - 30308956435.16 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
17 run-4.0-gemfiles/rails_7_2.gemfile - 30308956435.17 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
18 run-4.0-gemfiles/multi_json.gemfile - 30308956435.18 27 Jul 2026 09:58PM UTC 166
47.86
GitHub Action Run
19 run-3.3-gemfiles/rack_3_1.gemfile - 30308956435.19 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
20 run-3.4-gemfiles/rack_3_0.gemfile - 30308956435.20 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
21 run-3.3-Gemfile - 30308956435.21 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
22 run-3.3-gemfiles/rails_8_1.gemfile - 30308956435.22 27 Jul 2026 09:59PM UTC 167
95.59
GitHub Action Run
23 run-3.4-gemfiles/rails_8_0.gemfile - 30308956435.23 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
24 run-4.0-gemfiles/rack_3_1.gemfile - 30308956435.24 27 Jul 2026 09:59PM UTC 166
95.59
GitHub Action Run
25 run-3.3-gemfiles/rack_2_2.gemfile - 30308956435.25 27 Jul 2026 09:58PM UTC 166
95.55
GitHub Action Run
26 run-4.0-gemfiles/multi_xml.gemfile - 30308956435.26 27 Jul 2026 09:58PM UTC 166
47.26
GitHub Action Run
27 run-4.0-gemfiles/grape_entity.gemfile - 30308956435.27 27 Jul 2026 09:58PM UTC 166
50.58
GitHub Action Run
28 run-3.3-gemfiles/rails_8_0.gemfile - 30308956435.28 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
29 run-4.0-gemfiles/rack_3_2.gemfile - 30308956435.29 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
30 run-3.3-gemfiles/rails_7_2.gemfile - 30308956435.30 27 Jul 2026 09:58PM UTC 167
95.59
GitHub Action Run
31 run-4.0-gemfiles/rack_2_2.gemfile - 30308956435.31 27 Jul 2026 09:58PM UTC 166
95.55
GitHub Action Run
32 run-3.4-gemfiles/rack_3_1.gemfile - 30308956435.32 27 Jul 2026 09:58PM UTC 166
95.59
GitHub Action Run
Source Files on build 30308956435
  • Tree
  • List 167
  • Changed 6
  • Source Changed 5
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30308956435
  • Pull Request #2836
  • PR Base - master (#30306029090)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc