fix: install dependencies added on the other lane during lane merge - #10579
fix: install dependencies added on the other lane during lane merge#10579davidfirst wants to merge 2 commits into
Conversation
PR Summary by QodoFix lane-merge installs for dependencies added on the other lane
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Unverified test precondition
|
| // create a lockfile that does not include is-positive | ||
| helper.command.install(); | ||
| const laneWs = helper.scopeHelper.cloneWorkspace(); | ||
| helper.command.switchLocalLane('main', '-x'); |
There was a problem hiding this comment.
1. Unverified test precondition 🐞 Bug ☼ Reliability
The new e2e test claims the lane lockfile “does not include is-positive” but never asserts that is-positive is absent before the merge, so the test can pass without actually exercising the regression it’s meant to catch.
Agent Prompt
### Issue description
The new e2e scenario documents that the lane workspace’s lockfile/node_modules should not contain `is-positive` before merging `main`, but it does not verify that assumption. If `is-positive` becomes present (e.g., fixture changes, transitive deps, or state leakage), the test may pass even if the merge/install behavior regresses.
### Issue Context
The setup runs `helper.command.install()` and immediately snapshots the workspace, but there is no assertion that `node_modules/is-positive` (and/or the lockfile) is actually absent at that moment.
### Fix Focus Areas
- e2e/harmony/lanes/merge-lanes-main.e2e.ts[337-347]
### Suggested fix
Add a precondition assertion right after the initial `helper.command.install()` (and before cloning/switching lanes), e.g.:
- Assert `node_modules/is-positive` does **not** exist.
- Optionally assert the lockfile does **not** mention `is-positive` (depending on the package-manager configured for these e2e runs).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 6568919 |
Problem
When you merge a lane, and the incoming side added a new package dependency, the install step does not install the new package. The package manager shows "Lockfile is up to date, resolution step is skipped". The auto-snap that follows fails with a "missing packages" error.
Cause
The merge flow loads the components before it writes the merged files and the merged config. The install step that runs after the merge uses this stale cache. As a result, the install manifest does not contain the new dependency, and the package manager skips the resolution step.
The config-merger records the new dependency correctly in the unmerged-components store. Only the stale cache prevents the install from using it.
Fix
Clear the workspace cache before the install step of the merge. The install then loads the components with the merged state, and the new dependency enters the install manifest.
Added an e2e test that reproduces the failure and verifies the fix.