fix(core): prevent tag leakage by trusting resolved empty deps in LaunchQLMigrate.deploy #218
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.
fix(core): prevent tag leakage by trusting resolved empty deps in LaunchQLMigrate.deploy
Summary
Fixes a critical bug where tag references leak into database deployment procedures when resolved dependencies are empty arrays. The issue occurred in
LaunchQLMigrate.deploywhere the fallback logic would incorrectly use raw plan dependencies (which may contain unresolved tags likepackage:@tag) instead of trusting the empty array returned by the dependency resolver.Key Change: Modified the fallback condition from
(resolvedFromDeps && resolvedFromDeps.length > 0)to(resolvedFromDeps !== undefined)to trust empty dependency arrays from the resolver.Review & Testing Checklist for Human
lql deploy --recursive --database ${testDb.name} --yes --no-usePlan --package unique-names) to verify it now passespackages/core/src/migrate/client.ts:178- confirm that trusting empty arrays over plan dependencies is the correct behaviorNotes
packages/core/__tests__/migrate/tag-fallback.test.tsdemonstrates the bug and verifies the fixLink to Devin run: https://app.devin.ai/sessions/1f918a5be7bd48fbb9f3967912399928
Requested by: Dan Lynch (@pyramation)