Phase 1: deterministic pgpm/export timestamps and plan ordering#1363
Merged
Conversation
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.
968d133 to
5f5dd54
Compare
- Freeze pgpm plan timestamps to a fixed epoch (2017-08-11T08:11:51Z) with PGPM_FROZEN_TIME env override. - Sort pgpm.plan dependency brackets by plan order (parent-first), preserving external dependencies' original order. - Export omits timestamptz columns with non-deterministic defaults (now, CURRENT_TIMESTAMP, clock_timestamp, now() + interval) from generated INSERT rows. - Expose timestamp-default columns in meta-export-tables.json so the GraphQL/API path can omit them without a DB pool. - Sync meta-export-tables.json to include integration_providers_module. Snapshots updated accordingly. Ref: constructive-io/constructive-planning#1148
5f5dd54 to
99672e2
Compare
Remove metaschema_public.partition from the generated manifest now that it is excluded from the constructive-services meta export. Ref: constructive-io/constructive-planning#1148
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
Phase 1 non-determinism fixes for the code-generation pipeline.
pgpm/exportnow introspectsinformation_schema.columnsto detecttimestamptzcolumns whose default expression is non-deterministic (now(),CURRENT_TIMESTAMP,clock_timestamp(), ornow() + '...'::interval) and omits them from exported INSERT rows. The column's DDLDEFAULTsupplies the value at deploy time, so generated migrations stop containing literal ISO timestamps. The same omission is applied in both the SQL (exportMeta) and GraphQL (exportGraphQLMeta) flows.pgpm/coreplan generator and writer now use a fixed epoch timestamp (2017-08-11T08:11:51Z) and sort plan dependency brackets deterministically, eliminating run-to-run timestamp and ordering drift.pgpm/core/src/core/class/pgpm.tsnow imports the sharedgetNowfromfiles/plan/generatorinstead of redefining it.pgpm/export/src/meta-export-tables.jsonis synced withconstructive-dbto includeintegration_providers_moduleso the generated service migration set is consistent.Example
Closes / related: https://github.com/constructive-io/constructive-planning/issues/1148
Verification
pnpm --filter @pgpmjs/core build:devpassedpnpm --filter @pgpmjs/export build:devpassedpnpm --filter pgpm build:devpassedpgpm/coresnapshots updated withjest -uto reflect deterministic dependency orderingconstructive-dbpnpm run generate:constructivewas run twice with these packages;services/constructive-services/deploy/migrate/database.sql,pgpm.planfiles, andapplication/constructive/pgpm.planwere identical across runs and contained no literal ISO timestamps.Blockers
@pgpmjs/exportand@pgpmjs/corechanges must be published beforeconstructive-dbcan consume them. The deploy pipeline will handle the version bump; nopackage.jsonversion changes are included in this PR.Next steps
constructivepgpmpackages.constructive-dbto use the published versions and regenerate to confirm.Link to Devin session: https://app.devin.ai/sessions/866a2246ce1345918ec707e9a09e5b9b
Requested by: @pyramation