Skip to content

fix: simplify operation shape#1210

Merged
ferhatelmas merged 2 commits into
masterfrom
ferhat/simplify-operation-shape
Jul 7, 2026
Merged

fix: simplify operation shape#1210
ferhatelmas merged 2 commits into
masterfrom
ferhat/simplify-operation-shape

Conversation

@ferhatelmas

Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings July 6, 2026 20:13
@ferhatelmas ferhatelmas requested a review from a team as a code owner July 6, 2026 20:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.operation across HTTP routes from { type: ... } to a string.
  • Updated request instrumentation (logging, metrics, DB connection settings) to read/write operation as 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.

@coveralls

coveralls commented Jul 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28854401610

Coverage remained the same at 79.081%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 1 uncovered change across 1 file (6 of 7 lines covered, 85.71%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/http/plugins/log-request.ts 1 0 0.0%
Total (4 files) 7 6 85.71%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12364
Covered Lines: 10218
Line Coverage: 82.64%
Relevant Branches: 7149
Covered Branches: 5213
Branch Coverage: 72.92%
Branches in Coverage %: Yes
Coverage Strength: 418.11 hits per line

💛 - Coveralls

Comment thread src/http/routes/s3/router.test.ts
@ferhatelmas ferhatelmas force-pushed the ferhat/simplify-operation-shape branch from 23693c3 to 2602e82 Compare July 7, 2026 08:32
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
@ferhatelmas ferhatelmas force-pushed the ferhat/simplify-operation-shape branch from 2602e82 to 1c6adbc Compare July 7, 2026 09:01
@ferhatelmas ferhatelmas merged commit 9cf361f into master Jul 7, 2026
38 of 39 checks passed
@ferhatelmas ferhatelmas deleted the ferhat/simplify-operation-shape branch July 7, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants