feat: add on-demand signature generation#1108
Open
ferhatelmas wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds on-demand object SHA-256 signature generation for storage objects through new queue events, database accessors, a tenant migration, and an admin scheduling endpoint.
Changes:
- Adds coordinator and per-object queue events for object signature generation.
- Adds DB methods and migration support for
storage.objects.signature. - Adds an admin API route to schedule signature generation jobs.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/storage/events/workers.ts |
Registers the new signature generation workers. |
src/storage/events/objects/generate-object-signature.ts |
Implements coordinator and per-object signature generation jobs. |
src/storage/events/objects/generate-object-signature.test.ts |
Adds unit coverage for signature generation events. |
src/storage/events/index.ts |
Exports the new events. |
src/storage/database/knex.ts |
Adds object listing and signature update DB methods. |
src/storage/database/knex.test.ts |
Tests the new DB query builders. |
src/storage/database/adapter.ts |
Extends the database interface for signature operations. |
src/internal/monitoring/logger.ts |
Allows event metadata and error event fields. |
src/internal/database/migrations/types.ts |
Registers migration 61. |
src/http/routes/admin/signature-generation.ts |
Adds admin endpoint to enqueue signature generation. |
src/http/routes/admin/signature-generation.test.ts |
Tests admin endpoint auth, validation, and enqueueing. |
src/http/routes/admin/index.ts |
Exports the new admin route. |
src/admin-app.ts |
Registers the new admin route. |
migrations/tenant/0061-add-objects-signature.sql |
Adds the signature column and length constraint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 25944908841Coverage increased (+0.2%) to 75.231%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
54bbfa9 to
4673f36
Compare
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
4673f36 to
5773876
Compare
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?
feat
What is the current behavior?
We don't have signatures of the objects.
Generating signatures in the hot path is too costly, and hash and multipart support makes it infeasible on upload in every case.
What is the new behavior?
Register two events, multi signatures (tenant, bucket, batch objects) and single signature (specific version of an object).
Add an admin on-demand handler to schedule coordinator job (multi) which reschedules itself as needed and schedules single object jobs.
Additional context
Single object can be triggered upon successful upload as a follow up. Not connected it yet to see the real performance. It should also include clearing signature on version changes (added partial index will create a small overhead).