refactor(storage): one add_job builder for every enqueue shape; drop duplicated S3 resolvers - #1785
Merged
Merged
Conversation
…p duplicated S3 config resolvers
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This comment has been minimized.
This comment has been minimized.
The pgpm-boilerplates template repo gained safegres.config.js and safegres-perf-baseline.json per scaffolded module (constructive-io/pgpm-boilerplates#42, merged after main's last CI run), so every init snapshot in this repo now sees two extra files.
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
Storage bucket-creation residue from #1901: three code paths that each did the same thing their own way, collapsed to one. No behavior change intended — the one-door invariant (plugins enqueue or lazily request provisioning; only the reconciler/policy mints and records a physical name) is unchanged, this just stops it being re-implemented per scope.
graphile-bucket-provisioner-pluginhad three inlineapp_jobs.add_jobSQL strings — global, database, owner scope — that drifted in whitespace, argument order andmax_attempts. They now share one builder, so a scope branch supplies only its payload and identity arguments:graphile-presigned-url-plugin/src/download-url-field.tscarried its own copies ofresolveS3andresolveS3ForDatabase— including a second one whose parameters were in the opposite order — and now imports the canonical pair from./physical-bucket. Record-once bookkeeping (UPDATE ... SET physical_name = $1 WHERE id = $2 AND physical_name IS NULL) exists once, asrecordPhysicalNameingraphile-storage-registry, and remains the only writer of that column.Verification (MinIO,
minio/minio:edge-cicd— the CI image)All three storage doors exercised against a live MinIO:
uploadsintegration, 2 suites / 51 testsprovisionBucketmutation + eager insert-trigger provisioning —graphile-bucket-provisioner-plugin, 8 suites / 123 testsgraphile-presigned-url-plugin, 7 suites / 86 testsPlus
pnpm build:devacross the workspace andeslintclean on both touched packages.Paired with constructive-io/constructive-db#3561, which fixes the migration-time partition race the enqueue path lands on (#1918).
Link to Devin session: https://app.devin.ai/sessions/b1df45674ae742bca5cc743c7d41adc2
Open in Devin Desktop: https://app.devin.ai/desktop/session/b1df45674ae742bca5cc743c7d41adc2?variant=devin
Requested by: @pyramation