feat(pgpm-bundle): bundle envelope — versioned, content-addressed container for schema + data + fixtures#1435
Merged
Merged
Conversation
…pping schema + data + fixtures
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 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
The bundle envelope — fn #3
exportMigrationBundle's artifact (constructive-planning#1225): one versioned, shippable container wrapping a schemaMigrationBundle+ data-dump SQL + fixtures, with a manifest, Merkle content digest, and provenance. Newpgpm/bundle/src/envelope.ts, purely additive.Design decisions:
@pgpmjs/bundle, not a new package — same artifact layer, reuseshashString/verifyBundle/writeBundleFile. It cannot depend on@pgpmjs/export(export → core → bundle), so data/fixtures parts are caller-produced SQL (e.g.buildDataDeploy/Revert/VerifyScriptfrom@pgpmjs/export): the envelope never generates SQL, just digests and ships it.manifest.digest= sha256(name, version, ordered part digests); the schema part digest is the bundle's own digest, so integrity extends down through every change/script.createdWith/provenanceexcluded from the digest (same rule as the bundle layer).snapshotDatabase= createEnvelope over slice/export outputs;applyMigrationBundle= existingapplyBundleforschemathen replaydata/fixturesin order; ID-remap operates on part SQL pre-apply.Also updates the
pgpm-migration-bundleskill with the envelope surface.Validated: bundle 33/33 (6 new envelope tests: determinism, tamper detection at part/inventory/schema levels, JSON + directory round-trips), core 356/356, builds green.
Link to Devin session: https://app.devin.ai/sessions/ad40d16f38a349b48eb7ce9375e27e6e
Requested by: @pyramation