fix: simplify operation shape#1210
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors how HTTP route “operation” metadata is represented across the codebase, simplifying it from an object wrapper ({ type: string }) to a plain top-level string. This aligns S3 router precomputation with the rest of the system and simplifies downstream consumers (logging/metrics/DB strategy selection).
Changes:
- Flattened
config.operationacross HTTP routes from{ type: ... }to a string. - Updated request instrumentation (logging, metrics, DB connection settings) to read/write
operationas a string. - Simplified S3 router registration by removing the precompiled
{ type: ... }operation object and updating tests accordingly.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/internal/database/pg-connection.test.ts | Updates pool strategy test to use string operation. |
| src/http/routes/vector/query-vectors.ts | Flattens config.operation to string. |
| src/http/routes/vector/put-vectors.ts | Flattens config.operation to string. |
| src/http/routes/vector/list-vectors.ts | Flattens config.operation to string. |
| src/http/routes/vector/list-indexes.ts | Flattens config.operation to string. |
| src/http/routes/vector/list-buckets.ts | Flattens config.operation to string. |
| src/http/routes/vector/get-vectors.ts | Flattens config.operation to string. |
| src/http/routes/vector/get-index.ts | Flattens config.operation to string. |
| src/http/routes/vector/get-bucket.ts | Flattens config.operation to string. |
| src/http/routes/vector/delete-vectors.ts | Flattens config.operation to string. |
| src/http/routes/vector/delete-index.ts | Flattens config.operation to string. |
| src/http/routes/vector/delete-bucket.ts | Flattens config.operation to string. |
| src/http/routes/vector/create-index.ts | Flattens config.operation to string. |
| src/http/routes/vector/create-bucket.ts | Flattens config.operation to string. |
| src/http/routes/tus/index.ts | Flattens config.operation to string for TUS routes. |
| src/http/routes/s3/router.ts | Removes operationConfig and stores precompiled operation as a string. |
| src/http/routes/s3/router.test.ts | Removes the operationConfig reuse assertion; keeps operation precompute coverage. |
| src/http/routes/s3/index.ts | Assigns req.operation as a string and updates OTel attribute setting accordingly. |
| src/http/routes/render/renderSignedImage.ts | Flattens config.operation to string. |
| src/http/routes/render/renderPublicImage.ts | Flattens config.operation to string. |
| src/http/routes/render/renderAuthenticatedImage.ts | Flattens config.operation to string. |
| src/http/routes/object/uploadSignedObject.ts | Flattens config.operation to string. |
| src/http/routes/object/updateObject.ts | Flattens config.operation to string. |
| src/http/routes/object/moveObject.ts | Flattens config.operation to string. |
| src/http/routes/object/listObjectsV2.ts | Flattens config.operation to string. |
| src/http/routes/object/listObjects.ts | Flattens config.operation to string. |
| src/http/routes/object/getSignedURLs.ts | Flattens config.operation to string. |
| src/http/routes/object/getSignedURL.ts | Flattens config.operation to string. |
| src/http/routes/object/getSignedUploadURL.ts | Flattens config.operation to string. |
| src/http/routes/object/getSignedObject.ts | Flattens config.operation to string. |
| src/http/routes/object/getPublicObject.ts | Flattens config.operation to string. |
| src/http/routes/object/getObjectInfo.ts | Flattens config.operation to string across multiple handlers. |
| src/http/routes/object/getObject.ts | Flattens config.operation to string across multiple handlers. |
| src/http/routes/object/deleteObjects.ts | Flattens config.operation to string. |
| src/http/routes/object/deleteObject.ts | Flattens config.operation to string. |
| src/http/routes/object/createObject.ts | Flattens config.operation to string. |
| src/http/routes/object/copyObject.ts | Flattens config.operation to string. |
| src/http/routes/iceberg/table.ts | Flattens config.operation to string across Iceberg table routes. |
| src/http/routes/iceberg/namespace.ts | Flattens config.operation to string across Iceberg namespace routes. |
| src/http/routes/iceberg/catalog.ts | Flattens config.operation to string. |
| src/http/routes/iceberg/bucket.ts | Flattens config.operation to string across bucket routes. |
| src/http/routes/cdn/purgeCache.ts | Flattens config.operation to string across purge endpoints. |
| src/http/routes/bucket/updateBucket.ts | Flattens config.operation to string. |
| src/http/routes/bucket/getBucket.ts | Flattens config.operation to string. |
| src/http/routes/bucket/getAllBuckets.ts | Flattens config.operation to string. |
| src/http/routes/bucket/emptyBucket.ts | Flattens config.operation to string. |
| src/http/routes/bucket/deleteBucket.ts | Flattens config.operation to string. |
| src/http/routes/bucket/createBucket.ts | Flattens config.operation to string. |
| src/http/plugins/metrics.ts | Updates operation label extraction to use string operation. |
| src/http/plugins/log-request.ts | Updates Fastify typings and logging/OTel attribute to use string operation. |
| src/http/plugins/db.ts | Updates DB connection strategy settings to use string operation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 28854401610Coverage remained the same at 79.081%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
fenos
reviewed
Jul 7, 2026
23693c3 to
2602e82
Compare
fenos
approved these changes
Jul 7, 2026
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
2602e82 to
1c6adbc
Compare
fenos
approved these changes
Jul 7, 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.
What kind of change does this PR introduce?
Refactor
What is the current behavior?
Operation is wrapped inside into an object with type.
What is the new behavior?
Unnecessary, make it top level.
Additional context
Helps cleaning up compilation in S3 router.