Skip to content

feat: add on-demand signature generation#1108

Open
ferhatelmas wants to merge 1 commit into
masterfrom
ferhat/signatures
Open

feat: add on-demand signature generation#1108
ferhatelmas wants to merge 1 commit into
masterfrom
ferhat/signatures

Conversation

@ferhatelmas
Copy link
Copy Markdown
Member

@ferhatelmas ferhatelmas commented May 15, 2026

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).

Copilot AI review requested due to automatic review settings May 15, 2026 22:08
@ferhatelmas ferhatelmas requested a review from a team as a code owner May 15, 2026 22:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread migrations/tenant/0061-add-objects-signature.sql
Comment thread src/storage/database/knex.ts
Comment thread src/storage/events/objects/generate-object-signature.ts
Comment thread src/storage/events/objects/generate-object-signature.ts Outdated
Comment thread src/storage/events/objects/generate-object-signature.ts Outdated
Comment thread src/storage/events/objects/generate-object-signature.ts Outdated
Comment thread src/http/routes/admin/signature-generation.ts
@coveralls
Copy link
Copy Markdown

coveralls commented May 15, 2026

Coverage Report for CI Build 25944908841

Coverage increased (+0.2%) to 75.231%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 13 uncovered changes across 2 files (109 of 122 lines covered, 89.34%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/storage/events/objects/generate-object-signature.ts 84 73 86.9%
src/storage/events/workers.ts 2 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 10430
Covered Lines: 8274
Line Coverage: 79.33%
Relevant Branches: 6022
Covered Branches: 4103
Branch Coverage: 68.13%
Branches in Coverage %: Yes
Coverage Strength: 409.19 hits per line

💛 - Coveralls

@ferhatelmas ferhatelmas force-pushed the ferhat/signatures branch 4 times, most recently from 54bbfa9 to 4673f36 Compare May 15, 2026 22:30
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
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.

3 participants