build(deps): upgrade got to 15 (with type migration)#1134
Merged
Conversation
got 15 removed the `CancelableRequest` type export (use `RequestPromise`) and tightened `searchParams` to reject `null`, and it now auto-decompresses responses while stripping the `content-encoding` header. Migrate the test helper types and call sites accordingly: - tests/helpers/api.ts: CancelableRequest -> RequestPromise - *_filter: null -> '' in searchParams (identical wire output: `_filter=`); the POST `json` body keeps `null` (valid JSON, unchanged behavior) - compression test: request with explicit Accept-Encoding + decompress:false so the server's content-encoding is observable under got 15 got is a production dependency (ingest remote-record fetch). Verified: typecheck (both configs), lint, unit (69), system (174), build. Replaces #1125. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the got HTTP client from v13 to v15 and migrates affected TypeScript/test call sites to match the new types and request option constraints, while keeping stac-server’s outward API behavior unchanged.
Changes:
- Bump
gotdependency to^15.0.5(and update lockfile). - Update typed test API client types to use
RequestPromise(replacing removedCancelableRequest). - Adjust system tests for
searchParamsnullability and compression observation (disable auto-decompression for the compression assertion).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/system/test-api-search-get.ts | Replace _filter: null with empty string to satisfy got v15 searchParams typing. |
| tests/system/test-api-item-get.ts | Same searchParams nullability adjustment for _filter. |
| tests/system/test-api-get-root.ts | Update compression test to disable decompression and set Accept-Encoding explicitly so content-encoding remains observable. |
| tests/system/test-api-collection-items-get.ts | Same searchParams nullability adjustment for _filter. |
| tests/helpers/api.ts | Migrate typed client overload return types from CancelableRequest to RequestPromise. |
| package.json | Bump got dependency to ^15.0.5. |
| package-lock.json | Lockfile updates reflecting got v15 and transitive dependency changes. |
| CHANGELOG.md | Document the dependency upgrade and its intent (no stac-server API/behavior change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
66
to
68
| "express": "^4.21.2", | ||
| "got": "^13.0", | ||
| "got": "^15.0.5", | ||
| "http-errors": "^2.0.1", |
Comment on lines
66
to
68
| "express": "^4.21.2", | ||
| "got": "^13.0", | ||
| "got": "^15.0.5", | ||
| "http-errors": "^2.0.1", |
Address review feedback on the got 15 upgrade: - Add `engines.node: ">=22"` (got 15 requires Node 22; previously only implied via .nvmrc). - Point the docs workflow at .nvmrc instead of the hardcoded Node 20, so all CI runs on Node 22 and `npm ci` doesn't EBADENGINE on got 15. - Set `strictContentLength: false` on the ingest remote-record fetch, so a misconfigured upstream Content-Length can't newly fail ingest under got 15's stricter defaults. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Addressed Copilot's review (123b6a2):
|
jkeifer
approved these changes
Jun 30, 2026
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.
Summary
Replaces dependabot #1125 (got 13→15), which failed typecheck — got 15 has breaking type/runtime changes that needed code migration.
got 15 changes handled
CancelableRequestexport → useRequestPromise(intests/helpers/api.ts).searchParamsno longer acceptsnull→ changed{ _filter: null }to{ _filter: '' }at the 4 searchParams call sites. Verified these serialize identically (_filter=) in got 15, so wire behavior is unchanged. The POST-body case (json: { _filter: null }) keepsnull— valid JSON, intended.content-encoding→ the compression test requests with an explicitAccept-Encoding: branddecompress: falseso the server's compression is observable.gotis a production dependency (the ingest lambda uses it to fetch remote STAC records by href), so this is a real prod major bump — no API/behavior change to stac-server itself.Verification
typecheck (both tsconfigs) ✓, lint ✓, unit (69) ✓, system (174) ✓, build ✓.
Closes #1125
🤖 Generated with Claude Code