feat(slice): opt-in AST-based dependency closure for pattern slices (on @pgsql/transform) - #1471
Closed
pyramation wants to merge 2 commits into
Closed
feat(slice): opt-in AST-based dependency closure for pattern slices (on @pgsql/transform)#1471pyramation wants to merge 2 commits into
pyramation wants to merge 2 commits into
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:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
|
Folded into #1470 per discussion — slicing moved out of core into the new @pgpmjs/slice package there. |
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
Redo of the closed prototype #1469, now built on the published
@pgsql/transform@18.3.0(constructive-io/constructive-planning#1270 / #1271): cherry-picked pattern slices can pull in their TRUE transitive dependencies discovered from the SQL itself — function calls (incl. inside PL/pgSQL bodies), table/view/type references, FK targets — even when not declared in planrequiresheaders.Opt-in only; default slicing behavior is unchanged:
vs #1469:
refs.tsno longer hand-rolls AST walking —extractSqlFactsis now a thin change-level aggregation overclassifyStatementsfrom@pgsql/transform(dedupe across statements + drop self-created references).closure.tsbuilds change-level edges from the facts and feeds them into package dependency computation via a new optionalextraEdgesparam onbuildPackageDependencies.Callers must
await loadModule()(re-exported fromplpgsql-parser) before slicing with closure enabled — the parser is WASM.Tests: 33 slice tests pass (9 closure-specific). The two failing tests in
__tests__/slice/slice-deploy-integration.test.tsrequire a live PostgreSQL and fail identically without this change.Link to Devin session: https://app.devin.ai/sessions/1aa52746e60c4df38ef2678d168269b9
Requested by: @pyramation