ci: restore --keep-lane in bit_pr - #10586
Conversation
The GVS PR dropped --keep-lane to dodge the lane-reuse artifact mixing tracked in teambit#10583. Restore lane reuse so a PR keeps one lane on Bit Cloud and each push re-snaps only what changed; the comment now records the hazard and how to recognize it instead of the workaround. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR Summary by QodoCI: restore --keep-lane for bit_pr job
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Stale artifacts via keep-lane
|
| # branch (fresh lane) or drop --keep-lane on that PR. | ||
| command: 'cd bit && bit ci pr --build --keep-lane --skip-cleanup' |
There was a problem hiding this comment.
1. Stale artifacts via keep-lane 🐞 Bug ☼ Reliability
The bit_pr CircleCI job now forces bit ci pr into --keep-lane mode, reusing the same remote lane across subsequent pushes instead of the temp-lane flow. Because reuse mode can install/use previously-exported artifacts for unmodified components, PR checks can become non-reproducible across pushes and fail due to mixed dependency generations.
Agent Prompt
### Issue description
The `bit_pr` CI job now always runs `bit ci pr` with `--keep-lane`, which switches into the remote-lane reuse flow. This can produce non-reproducible CI outcomes across pushes (stale/mixed artifacts), blocking PRs that hit the known hazard.
### Issue Context
`--keep-lane` is implemented as an opt-in behavior switch in `bit ci pr`. The repository already has logic and commentary indicating that reuse across runs can rely on earlier build/publish state for unmodified dependencies, and that mixed package sources can break `instanceof` checks.
### Fix Focus Areas
- .circleci/config.yml[859-866]
### Suggested change
Adjust the CircleCI command so `--keep-lane` is **opt-in** (e.g., controlled by an env var or pipeline parameter), while keeping the default path on the safer temp-lane flow.
Example approach (one option):
- Use a small shell conditional:
- If `$BIT_CI_PR_KEEP_LANE == "1"`, add `--keep-lane`
- Otherwise omit it
- Keep `--skip-cleanup` unchanged.
This preserves the speed benefit when explicitly enabled while preventing default PR validation from depending on persisted remote-lane state.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Restores
--keep-lanein thebit_prCircleCI job, reverting the workaround introduced with the global-virtual-store PR (#10582).What changes
With
--keep-lane, a PR keeps a single lane on Bit Cloud named after the branch, and each push re-snaps only the components that actually changed instead of rebuilding everything from a throwaway lane.Why it was dropped, and what that means now
The reusing flow (
snapAndExportReusingLane) serves components unchanged since an earlier export from the lane, with artifacts built from older commits of the branch. Capsules can then mix generations of@teambitpackages, and cross-copyinstanceofchecks break in capsule spec runs — on a PR that snaps core components,bit_prfails deterministically from the second push onward.That underlying bug is still open (#10583); this PR restores the flag rather than fixing it. The inline comment now documents the hazard and the escape hatches (rename the branch for a fresh lane, or drop the flag on the affected PR) instead of documenting the workaround.
🤖 Generated with Claude Code