core(migrate): ATTEMPT2 — single-source dep resolution; trust empty arrays; qualify+dedupe; fix tag-based test expectation #219
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.
core(migrate): ATTEMPT2 — single-source dep resolution; trust empty arrays; qualify+dedupe; fix tag-based test expectation
Summary
Fixes a critical bug where tags were leaking into
launchql_migrate.deploy()database procedure, causing "Missing required changes" errors. The core issue was that when dependency resolution returned empty arrays, the code incorrectly fell back to raw plan dependencies (which could contain unresolved tags likepackage:@tag) instead of trusting the resolver's output.Key Changes:
resolvedFromDeps !== undefinedinstead of checking length)options.usePlan === false ? 'sql' : 'plan')dep.includes(':') ? dep : ${package}:${dep})Array.from(new Set(...))to avoid DB constraint violationscreate_tablenotcreate_another_table)listModuleslogic intoLaunchQLPackageclass with collision handlingReview & Testing Checklist for Human
usePlanto ensure they still work correctlyqualifiedDepscould have edge cases. Test scenarios with mixed internal/external deps, duplicate deps, and various package naming patternscreate_another_tabletocreate_table. Manually verify this matches the actual fixture dependencies in/home/ubuntu/repos/launchql/__fixtures__/sqitch/simple-w-tags/Recommended End-to-End Test Plan:
cli-deploy-stage-unique-names.test.ts) to confirm fixNotes
ATTEMPT2.mdandISSUE.mdfor detailed problem analysis and approachtag-based-migration,cross-project-dependencies,tag-fallback) and CLI test (cli-deploy-stage-unique-names) pass locally