Skip to content

fix(ci): restore lane config changes during ci merge to main#10219

Open
davidfirst wants to merge 5 commits intomasterfrom
fix/restore-lane-config-on-ci-merge
Open

fix(ci): restore lane config changes during ci merge to main#10219
davidfirst wants to merge 5 commits intomasterfrom
fix/restore-lane-config-on-ci-merge

Conversation

@davidfirst
Copy link
Member

When bit ci merge runs on a workspace checked out to a lane, config changes (from bit env set, bit deps set, etc.) were lost during the switch to main.

The fix compares each lane component's Version extensions with its main Version extensions. Any differences are saved to .bitmap before tagging, so config changes survive the lane-to-main transition.

Test plan

  • Added e2e test: bit ci merge when lane has config changes (env-set)
  • Verifies env config set on lane is preserved after merge
  • Verifies component is tagged and exported successfully
  • Verifies status is clean after merge

When `bit ci merge` switches from a lane to main, config changes made via
`bit env set` or `bit deps set` were lost. Now compares lane Version
extensions with main Version extensions and saves differences to .bitmap
before tagging.
Copilot AI review requested due to automatic review settings March 6, 2026 17:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes bit ci merge behavior when the workspace is checked out to a lane so that lane-only component config changes (e.g. from bit env set, bit deps set) are not lost during the switch back to main before tagging.

Changes:

  • Capture lane components before switching to main, then restore lane-vs-main extension config differences into .bitmap after checkout head.
  • Add an e2e test covering bit ci merge preserving an env-set config change made on a lane.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scopes/git/ci/ci.main.runtime.ts Restores lane config changes into .bitmap during CI merge by diffing lane vs main Version extension configs.
e2e/harmony/ci-commands.e2e.ts Adds an e2e scenario asserting env config is preserved after bit ci merge.

You can also share your feedback on Copilot code review. Take the survey.

- Collapse redundant configDiff intermediate object into single-pass loop
- Flatten deep nesting for mainConfig loading with optional chaining
- Parallelize component processing with Promise.all
- Add missing test assertions for remote export and lane cleanup
Copilot AI review requested due to automatic review settings March 6, 2026 21:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 10, 2026 14:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +750 to +751
this.workspace.bitMap.addComponentConfig(laneComp.id, aspectId, config as Record<string, any>);
hasChanges = true;
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasChanges is set to true whenever a lane aspect differs from main, even if bitMap.addComponentConfig() ends up making no change (it returns false when the current bitmap config already matches). This can cause an unnecessary .bitmap write + workspace.clearCache() and a misleading "Restored config changes" log. Consider using the boolean return value from addComponentConfig() to update hasChanges only when a mutation actually occurred.

Suggested change
this.workspace.bitMap.addComponentConfig(laneComp.id, aspectId, config as Record<string, any>);
hasChanges = true;
const updated = this.workspace.bitMap.addComponentConfig(
laneComp.id,
aspectId,
config as Record<string, any>
);
if (updated) hasChanges = true;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants