Repository navigation
fix: stop calling four API routes that do not exist (#125) - #126
Merged
Merged
Conversation
drilling.trends(), drilling.basin(), futures.spreads(c1, c2) and
futures.continuous() called routes the API never served; every call
returned 404. They now reject with ENDPOINT_NOT_AVAILABLE and name the
supported alternative without making a request. Adds
futures.continuousFrontMonth() for /v1/futures/continuous/{brent|wti}.
Adds an API path contract test against a snapshot of `rails routes`
(scripts/refresh-api-paths.mjs), so a path with no route fails CI.
Lockfile: fast-uri 3.1.8, markdown-it 14.3.2 (dev-only advisories).
Version 2.1.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #125.
Problem
Four methods called routes the API has never served. Every call returned 404, while the mocked tests stayed green. #125 listed three; the new contract test found a fourth (
futures.continuous).Decisions
Checked against
rails routesandswagger.jsonfrom oilpriceapi-apib64093719. All live calls were made with the test key on 2026-10-03.drilling.trends()/v1/drilling-intelligence/trendssummary()200;completions()200;ducWells()200drilling.basin(name)/v1/drilling-intelligence/basin/{name}by_basinmaps oncompletions(),wellsDrilled(),ducWells(),fracSpreads()futures.spreads(c1, c2)/v1/futures/spreadsfutures.family(slug).spreads():/v1/futures/brent/spreads200,/v1/futures/wti/spreads200futures.continuous(c, m)/v1/futures/{c}/continuous/v1/futures/continuous/{brent|wti}(different shape)futures.continuousFrontMonth("brent"|"wti"):/v1/futures/continuous/brent200,/v1/futures/continuous/wti200Deprecated methods reject with
OilPriceAPIError, codeENDPOINT_NOT_AVAILABLE, and the message names the alternative. They will be removed in the next major. Signatures are unchanged, so existing code still compiles.Contract test
tests/api-path-contract.test.tsextracts every/v1/...literal fromsrc/(comments stripped). It fails when a path matches no customer-facing route intests/fixtures/api-paths.json.rails routes, each tagged with its swagger oropenapi_route_policy.ymlaudience. Dashboard, website, internal and operations routes do not count./v1/data-sourcesis allowlisted with a reason: policy classes it as dashboard, but it answers an API key with 403ORG_REQUIRED, not 401.scripts/refresh-api-paths.mjsregenerates the fixture.continuousFrontMonthto an unrouted path failed the test (/v1/futures/spreads/{param}), and restoring it went green.Hygiene from the issue
@types/nodeand@types/wsstay independencies. The published declarations reference them:dist/index.d.ts:71(Buffer),dist/resources/streaming.d.ts:32-33(node:events,ws). Consumers type-checking withoutskipLibCheckneed them, so moving them would break consumer type resolution.npm audit fixchanged the lockfile only (fast-uri 3.1.7 → 3.1.8, markdown-it → 14.3.2).npm audit --audit-level=lownow reports 0 vulnerabilities. This covers Dependabot chore(deps-dev): bump markdown-it from 14.3.0 to 14.3.2 #124.Version
2.1.0, a minor bump because
continuousFrontMonthis a new public method.package.json,src/version.ts, the lockfile, CHANGELOG andrelease-readiness.test.tsare aligned.Verification (local)
npm test: 57 files, 917 passed, 1 skipped, 0 type errors.npx tsc --noEmit,npm run lint,snippets:check,storefront:check,check:secrets,npm run build.npm audit --audit-level=low: 0 vulnerabilities.smoke:packagewas not verified locally. The live demo endpoint returned 429 to this machine after repeated runs; it is an environmental rate limit, not a code failure.Not published. Release after merge as usual.
🤖 Generated with Claude Code