@teambit/ci 1.0.384 → 1.0.386
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -112,6 +112,12 @@ export declare class CiMain {
|
|
|
112
112
|
private parseVersionBumpFromCommit;
|
|
113
113
|
private getCustomCommitMessage;
|
|
114
114
|
private verifyWorkspaceStatusInternal;
|
|
115
|
+
/**
|
|
116
|
+
* Returns the caught Error on failure, or undefined on success (including the "already checked
|
|
117
|
+
* out" no-op case). Callers that need to react to a specific failure mode (e.g. stale lane) can
|
|
118
|
+
* inspect the returned error; existing callers ignore it and rely on a follow-up
|
|
119
|
+
* `getCurrentLane()` check.
|
|
120
|
+
*/
|
|
115
121
|
private switchToLane;
|
|
116
122
|
/**
|
|
117
123
|
* Sync *config-only* changes from main onto the lane — without a full `bit lane merge`.
|
package/dist/ci.main.runtime.js
CHANGED
|
@@ -378,6 +378,13 @@ class CiMain {
|
|
|
378
378
|
status
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Returns the caught Error on failure, or undefined on success (including the "already checked
|
|
384
|
+
* out" no-op case). Callers that need to react to a specific failure mode (e.g. stale lane) can
|
|
385
|
+
* inspect the returned error; existing callers ignore it and rely on a follow-up
|
|
386
|
+
* `getCurrentLane()` check.
|
|
387
|
+
*/
|
|
381
388
|
async switchToLane(laneName, options = {}) {
|
|
382
389
|
this.logger.console(_chalk().default.blue(`Switching to ${laneName}`));
|
|
383
390
|
try {
|
|
@@ -387,12 +394,14 @@ class CiMain {
|
|
|
387
394
|
skipDependencyInstallation: true
|
|
388
395
|
}, options));
|
|
389
396
|
} catch (e) {
|
|
390
|
-
if (e
|
|
397
|
+
if (e?.toString().includes('already checked out')) {
|
|
391
398
|
this.logger.console(_chalk().default.yellow(`Lane ${laneName} already checked out, skipping checkout`));
|
|
392
|
-
return
|
|
399
|
+
return undefined;
|
|
393
400
|
}
|
|
394
|
-
this.logger.console(_chalk().default.red(`Failed switching to ${laneName}: ${e
|
|
401
|
+
this.logger.console(_chalk().default.red(`Failed switching to ${laneName}: ${e?.toString() ?? e}`));
|
|
402
|
+
return e;
|
|
395
403
|
}
|
|
404
|
+
return undefined;
|
|
396
405
|
}
|
|
397
406
|
|
|
398
407
|
/**
|
|
@@ -624,28 +633,100 @@ class CiMain {
|
|
|
624
633
|
// lane-history feature on Bit Cloud all survive across subsequent commits to the same PR.
|
|
625
634
|
// switchToLane fetches the latest lane head from remote.
|
|
626
635
|
this.logger.console(_chalk().default.blue(`Lane ${laneId.toString()} exists on remote, reusing it`));
|
|
627
|
-
await this.switchToLane(laneId.toString());
|
|
628
|
-
//
|
|
629
|
-
//
|
|
630
|
-
//
|
|
636
|
+
const switchErr = await this.switchToLane(laneId.toString());
|
|
637
|
+
// switchToLane returns the caught error (undefined on success). Combine with a
|
|
638
|
+
// current-lane-state probe — comparing BOTH name AND scope, so a same-named lane in a
|
|
639
|
+
// different scope can't masquerade as a successful switch.
|
|
631
640
|
const switchedLane = await this.lanes.getCurrentLane();
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
641
|
+
const landedOnLane = switchedLane?.name === laneId.name && switchedLane?.scope === laneId.scope;
|
|
642
|
+
if (landedOnLane) {
|
|
643
|
+
// Sync config-only changes from main onto the lane, so config that was tagged into
|
|
644
|
+
// objects on main since the lane forked (e.g. `bit deps set` / `bit env set` from
|
|
645
|
+
// another PR, not visible via the workspace's git checkout) is reflected on the lane.
|
|
646
|
+
// Source files are git's job — see syncConfigFromMain.
|
|
647
|
+
//
|
|
648
|
+
// BUT only when the PR branch is actually up to date with the default branch. If the PR
|
|
649
|
+
// is behind (hasn't pulled main's latest), its git checkout still reflects the older
|
|
650
|
+
// fork point, so pulling main's newer config onto the lane would desync the lane from
|
|
651
|
+
// the source. The author merges the default branch into their PR in git; the next
|
|
652
|
+
// `bit ci pr` then propagates it here.
|
|
653
|
+
if (await this.isBranchBehindDefaultBranch()) {
|
|
654
|
+
this.logger.console(_chalk().default.yellow(`PR branch is behind the default branch — skipping config sync from main. ` + `Merge or rebase the default branch into your PR to pick up main's latest config.`));
|
|
655
|
+
} else {
|
|
656
|
+
await this.syncConfigFromMain(laneId);
|
|
657
|
+
}
|
|
647
658
|
} else {
|
|
648
|
-
|
|
659
|
+
// Switch failed even though the remote lane exists. The destructive recovery below
|
|
660
|
+
// (delete the remote lane + recreate fresh) is safe only when the failure is the
|
|
661
|
+
// specific "stale lane" pattern — the lane references a ModelComponent the PR has
|
|
662
|
+
// since removed/renamed (`unable to merge lane …, the component … was not found`).
|
|
663
|
+
// For any other failure (transient network blip during fetch, auth error, lane locked
|
|
664
|
+
// by Cloud UI, etc.) destroying lane history would be the wrong response, so we
|
|
665
|
+
// rethrow and let the caller report the real cause.
|
|
666
|
+
const errMsg = switchErr?.toString() ?? '';
|
|
667
|
+
const isStaleLane = errMsg.includes('unable to merge lane');
|
|
668
|
+
if (!isStaleLane) {
|
|
669
|
+
throw new Error(`Failed to switch to remote lane ${laneId.toString()}: ${errMsg || '(no error captured)'}. ` + `Refusing destructive recovery for this failure class — the error doesn't match the ` + `stale-lane marker, so deleting the lane could destroy real history. Investigate or retry.`);
|
|
670
|
+
}
|
|
671
|
+
this.logger.console(_chalk().default.yellow(`Stale remote lane ${laneId.toString()} — switching failed. ` + `Deleting it and creating a fresh lane to recover.`));
|
|
672
|
+
// Re-check the remote lane's hash immediately before deleting. The central-hub delete
|
|
673
|
+
// API is name-based — there's no compare-and-swap — so two CI jobs racing the same
|
|
674
|
+
// recovery could otherwise have job B delete job A's freshly-recreated lane. By
|
|
675
|
+
// re-fetching here we shrink the TOCTOU window to milliseconds: if A's recreate landed
|
|
676
|
+
// before our re-fetch, the hash changed and we skip the delete entirely. The downstream
|
|
677
|
+
// export then hits the lane-hash mismatch and lands in `exportWithAdoptOnConflict`,
|
|
678
|
+
// which rebases our snaps onto the winner's lane — no destroyed history.
|
|
679
|
+
const staleHash = existingLanes[0]?.hash;
|
|
680
|
+
const recheck = await this.lanes.getLanes({
|
|
681
|
+
remote: laneId.scope,
|
|
682
|
+
name: laneId.name
|
|
683
|
+
}).catch(() => []);
|
|
684
|
+
const currentRemoteHash = recheck[0]?.hash;
|
|
685
|
+
const remoteChanged = staleHash && currentRemoteHash && currentRemoteHash !== staleHash;
|
|
686
|
+
if (remoteChanged) {
|
|
687
|
+
this.logger.console(_chalk().default.blue(`Remote lane ${laneId.toString()} changed since we first checked (hash ` + `${staleHash.slice(0, 9)} → ${currentRemoteHash.slice(0, 9)}) — another concurrent ` + `recovery already recreated it. Skipping the delete; export will adopt-on-conflict.`));
|
|
688
|
+
} else {
|
|
689
|
+
await this.lanes.removeLanes([laneId.toString()], {
|
|
690
|
+
remote: true,
|
|
691
|
+
force: true
|
|
692
|
+
}).catch(e => {
|
|
693
|
+
const msg = e?.toString() ?? '';
|
|
694
|
+
// Tolerate the race where another concurrent recovery deleted the lane first — the
|
|
695
|
+
// desired post-condition (lane gone from remote) is already met.
|
|
696
|
+
if (msg.includes('was not found') || msg.includes('not found')) {
|
|
697
|
+
this.logger.console(_chalk().default.blue(`Remote lane ${laneId.toString()} was already gone — proceeding`));
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
throw new Error(`Failed to delete stale remote lane ${laneId.toString()}: ${msg || e}`);
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
// switchToLane fetched the remote lane and persisted it into the local scope's lane
|
|
704
|
+
// index (via `importLaneObject` → `legacyScope.lanes.saveLane`) BEFORE the underlying
|
|
705
|
+
// merge failed. Without dropping that local copy here, the upcoming `createLane` would
|
|
706
|
+
// hit the "lane … already exists" guard in create-lane.ts. Same trash-the-local-object
|
|
707
|
+
// pattern as `rebaseOntoRemoteLane`.
|
|
708
|
+
const legacyScope = this.workspace.scope.legacyScope;
|
|
709
|
+
const localLane = await legacyScope.loadLane(laneId);
|
|
710
|
+
if (localLane) {
|
|
711
|
+
await legacyScope.objects.moveObjectsToTrash([localLane.hash()]);
|
|
712
|
+
}
|
|
713
|
+
// Reset the workspace's current-lane pointer to main before createLane, so the new lane
|
|
714
|
+
// is forked from main with an empty component list. `createLane` populates new lanes
|
|
715
|
+
// from `consumer.getCurrentLaneObject()` regardless of `forkLaneNewScope` (which only
|
|
716
|
+
// suppresses the cross-scope guard) — if `originalLane` is non-default (a developer
|
|
717
|
+
// running `bit ci pr` from a lane), without this reset the "fresh" lane would silently
|
|
718
|
+
// inherit `originalLane`'s components. Check the return value: a silent failure here
|
|
719
|
+
// would defeat the whole point of the reset.
|
|
720
|
+
const resetErr = await this.switchToLane('main');
|
|
721
|
+
const afterReset = await this.lanes.getCurrentLane();
|
|
722
|
+
if (resetErr || afterReset) {
|
|
723
|
+
throw new Error(`Failed to reset to main before recreating ${laneId.toString()}: ` + `${resetErr?.toString() ?? `(still on lane "${afterReset?.name}")`}. ` + `Aborting to avoid silently forking the recreated lane from the wrong source.`);
|
|
724
|
+
}
|
|
725
|
+
const createLaneResult = await this.lanes.createLane(laneId.name, {
|
|
726
|
+
scope: laneId.scope,
|
|
727
|
+
forkLaneNewScope: true
|
|
728
|
+
});
|
|
729
|
+
this.logger.console(_chalk().default.blue(`Recreated lane ${laneId.toString()} (hash: ${createLaneResult.hash})`));
|
|
649
730
|
}
|
|
650
731
|
} else {
|
|
651
732
|
this.logger.console(_chalk().default.blue(`Creating lane ${laneId.toString()}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","_builder","_status","_lanes","_snapping","_export","_importer","_checkout","_component","_configMerger","_dependencyResolver","_execa","_interopRequireDefault","_chalk","_ci","_ci2","_verify","_pr","_merge","_git","_componentId","_lodash","_objects","_sourceBranchDetector","_toolboxString","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LANE_HASH_MISMATCH_MARKER","COMPONENT_DIVERGENCE_MARKER","CiMain","constructor","workspace","builder","status","lanes","snapping","exporter","importer","checkout","logger","config","provider","cli","loggerAspect","createLogger","CiAspect","id","ci","ciCmd","CiCmd","commands","CiVerifyCmd","CiPrCmd","CiMergeCmd","register","getBranchName","process","env","GITHUB_HEAD_REF","branch","git","current","Error","toString","convertBranchToLaneId","branchName","sanitizedBranch","replace","toLowerCase","defaultScope","getDefaultBranchName","result","raw","defaultBranch","trim","split","pop","branches","all","includes","console","chalk","yellow","getGitCommitMessage","commit","log","maxCount","latest","message","body","parseVersionBumpFromCommit","commitMessage","useExplicitBumpKeywords","blue","useConventionalCommitsForVersionBump","test","getCustomCommitMessage","commitMessageScript","parts","command","args","slice","execa","cwd","path","encoding","customMessage","stdout","green","verifyWorkspaceStatusInternal","strict","statusOutput","code","formatStatusOutput","warnings","failOnError","consoleSuccess","switchToLane","laneName","options","switchLanes","forceOurs","workspaceOnly","skipDependencyInstallation","red","syncConfigFromMain","laneId","legacyScope","scope","repo","objects","mainLaneId","getDefaultLaneId","currentLane","getCurrentLane","workspaceIds","listIds","syncedIds","laneComp","components","modelComponent","getModelComponent","mainHead","head","laneHead","isEqual","divergeData","getDivergeData","sourceHead","targetHead","throws","isTargetAhead","isDiverged","currentVersion","loadVersion","otherVersion","baseSnap","commonSnapBeforeDiverge","baseVersion","configMerger","ComponentConfigMerger","toStringWithoutVersion","undefined","extensions","mergedConfig","merge","getSuccessfullyMergedConfig","filterDeletedDependenciesFromConfig","unmergedComponents","removeComponent","addEntry","name","fullName","join","write","clearAllComponentsCache","mergeConfig","policy","DependencyResolverAspect","depType","filtered","dep","version","isBranchBehindDefaultBranch","defaultRefSha","revparse","headSha","mergeBase","err","verifyWorkspaceStatus","list","build","throwErrorsIfExist","snapPrCommit","laneIdStr","dryRun","keepLane","originalLane","parseLaneId","import","ids","installNpmPackages","writeConfigFiles","catch","snapAndExportReusingLane","snapAndExportWithTempLane","existingLanes","getLanes","remote","laneExists","foundErr","switchedLane","createLaneResult","createLane","forkLaneNewScope","hash","results","snap","exitOnFirstFailedTask","snappedComponents","snapOutput","snapResultOutput","exportWithAdoptOnConflict","targetLane","skipNpmInstall","cleanupErr","consoleWarning","tempLaneName","generateRandomStr","renamedToFinalName","removeLanes","force","archiveResult","archiveLane","stillExists","verifyErr","rename","exportResults","exportWithRetryOnLaneHashMismatch","componentsIds","tempLaneFullName","export","msg","isLaneHashMismatch","isComponentDivergence","cause","snappedHeads","map","c","Ref","from","rebaseOntoRemoteLane","exportWithBusyRetry","maxAttempts","isBusyErr","lastErr","attempt","Promise","resolve","setTimeout","localLane","loadLane","moveObjectsToTrash","remoteLane","fetchLaneWithItsComponents","remoteComp","find","isEqualWithoutVersion","remoteHead","load","parents","some","p","beforeParents","afterParents","add","versionHistory","updateRebasedVersionHistory","updatedComponents","s","setLaneComponents","hasChanged","saveLane","saveLaneHistory","persist","consumer","setCurrentLane","bitMap","mergePr","argMessage","releaseType","preReleaseId","incrementBy","explicitVersionBump","verbose","versionsFile","autoMergeResolve","forceTheirs","skipPush","noBitmapCommit","initialCommitSha","laneComponents","changedIds","resetLaneComponentsToNew","changedIdsList","ComponentIdList","fromArray","removeMany","clearCache","gitStatus","hasChanges","files","stash","pull","importCurrentObjects","checkoutProps","mergeStrategy","checkoutResults","reportToString","checkoutOutput","restoreLaneConfigChanges","workspaceConfigUpdateResult","workspaceDepsConflicts","workspaceConfigConflictWriteError","bold","gray","leftUnresolvedConflicts","componentsWithConflicts","filesStatus","values","conflictedComponentIds","hasSoftTaggedComponents","softTaggedComponents","finalReleaseType","determineReleaseType","tagResults","tag","failFast","tagOutput","tagResultOutput","hasTaggedComponents","taggedComponents","exportResult","commitAndPushBitmapChanges","performLaneCleanup","addConfig","statusBeforeCommit","file","working_dir","index","diff","error","statusAfterCommit","activeComponents","isDeleted","laneVersion","laneConfig","toConfigObject","mainConfig","modelComp","getModelComponentIfExist","changeVersion","getHead","mainVersion","aspectId","entries","updated","addComponentConfig","explicitLaneName","sourceBranchDetector","SourceBranchDetector","sourceBranchName","getSourceBranchName","isHashMismatchErr","archiveErr","throwOnError","lastCommit","detectedReleaseType","exports","MainRuntime","CLIAspect","WorkspaceAspect","LoggerAspect","BuilderAspect","StatusAspect","LanesAspect","SnappingAspect","ExportAspect","ImporterAspect","CheckoutAspect","addRuntime"],"sources":["ci.main.runtime.ts"],"sourcesContent":["import type { RuntimeDefinition } from '@teambit/harmony';\nimport { CLIAspect, type CLIMain, MainRuntime } from '@teambit/cli';\nimport { LoggerAspect, type LoggerMain, type Logger } from '@teambit/logger';\nimport { WorkspaceAspect, type Workspace } from '@teambit/workspace';\nimport { BuilderAspect, type BuilderMain } from '@teambit/builder';\nimport { StatusAspect, type StatusMain } from '@teambit/status';\nimport { LanesAspect } from '@teambit/lanes';\nimport type { SwitchLaneOptions, LanesMain } from '@teambit/lanes';\nimport { SnappingAspect, tagResultOutput, snapResultOutput } from '@teambit/snapping';\nimport type { SnapResults, SnappingMain } from '@teambit/snapping';\nimport { ExportAspect, type ExportMain } from '@teambit/export';\nimport { ImporterAspect, type ImporterMain } from '@teambit/importer';\nimport { CheckoutAspect, checkoutOutput, type CheckoutMain } from '@teambit/checkout';\nimport type { MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { getDivergeData } from '@teambit/component.snap-distance';\nimport { ComponentConfigMerger } from '@teambit/config-merger';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport execa from 'execa';\nimport chalk from 'chalk';\nimport type { ReleaseType } from 'semver';\nimport { CiAspect } from './ci.aspect';\nimport { CiCmd } from './ci.cmd';\nimport { CiVerifyCmd } from './commands/verify.cmd';\nimport { CiPrCmd } from './commands/pr.cmd';\nimport { CiMergeCmd } from './commands/merge.cmd';\nimport { git } from './git';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { ComponentID } from '@teambit/component-id';\nimport { isEqual } from 'lodash';\nimport type { Version, LaneComponent, Lane } from '@teambit/objects';\nimport { Ref } from '@teambit/objects';\nimport type { LaneId } from '@teambit/lane-id';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { SourceBranchDetector } from './source-branch-detector';\nimport { generateRandomStr } from '@teambit/toolbox.string.random';\n\n// Two distinct conflicts can surface from the remote on a concurrent `bit ci pr` race.\n// LANE_HASH_MISMATCH fires when both runners called `Lane.create` (the lane didn't exist on\n// the remote yet), so they each minted a random `sha1(v4())` hash — `sources.mergeLane` then\n// rejects the second push's lane object on hash mismatch.\n// COMPONENT_DIVERGENCE fires when the lane already exists (both runners `switchToLane`'d\n// and got the same lane hash) but they both snapped the SAME component with DIFFERENT\n// content — `mergeLane`'s per-component diverge check collects a `ComponentNeedsUpdate`\n// and throws `MergeConflictOnRemote(\"merge error occurred when exporting the component(s)…\")`.\n// Both recover through the same adopt-and-rebase path in `rebaseOntoRemoteLane`.\nconst LANE_HASH_MISMATCH_MARKER = 'a lane with the same id already exists with a different hash';\nconst COMPONENT_DIVERGENCE_MARKER = 'merge error occurred when exporting';\nexport interface CiWorkspaceConfig {\n /**\n * Path to a custom script that generates commit messages for `bit ci merge` operations.\n * The script will be executed when components are tagged and committed to the repository.\n * If not specified, falls back to the default commit message:\n * \"chore: update .bitmap and lockfiles as needed [skip ci]\"\n *\n * @example\n * ```json\n * {\n * \"teambit.git/ci\": {\n * \"commitMessageScript\": \"node scripts/generate-commit-message.js\"\n * }\n * }\n * ```\n */\n commitMessageScript?: string;\n\n /**\n * Enables automatic version bump detection from conventional commit messages.\n * When enabled, the system analyzes commit messages to determine the appropriate version bump:\n * - `feat!:` or `BREAKING CHANGE` → major version bump\n * - `feat:` → minor version bump\n * - `fix:` → patch version bump\n *\n * Only applies when no explicit version flags (--patch, --minor, --major) are provided.\n *\n * @default false\n * @example\n * ```json\n * {\n * \"teambit.git/ci\": {\n * \"useConventionalCommitsForVersionBump\": true\n * }\n * }\n * ```\n */\n useConventionalCommitsForVersionBump?: boolean;\n\n /**\n * Enables detection of explicit version bump keywords in commit messages.\n * When enabled, the system looks for these keywords in commit messages:\n * - `BIT-BUMP-MAJOR` → major version bump\n * - `BIT-BUMP-MINOR` → minor version bump\n *\n * These keywords have higher priority than conventional commits parsing.\n * Only applies when no explicit version flags are provided.\n *\n * @default true\n * @example\n * ```json\n * {\n * \"teambit.git/ci\": {\n * \"useExplicitBumpKeywords\": true\n * }\n * }\n * ```\n */\n useExplicitBumpKeywords?: boolean;\n}\n\nexport class CiMain {\n static runtime = MainRuntime as RuntimeDefinition;\n\n static dependencies: any = [\n CLIAspect,\n WorkspaceAspect,\n LoggerAspect,\n BuilderAspect,\n StatusAspect,\n LanesAspect,\n SnappingAspect,\n ExportAspect,\n ImporterAspect,\n CheckoutAspect,\n ];\n\n static slots: any = [];\n\n constructor(\n private workspace: Workspace,\n\n private builder: BuilderMain,\n\n private status: StatusMain,\n\n private lanes: LanesMain,\n\n private snapping: SnappingMain,\n\n private exporter: ExportMain,\n\n private importer: ImporterMain,\n\n private checkout: CheckoutMain,\n\n private logger: Logger,\n\n private config: CiWorkspaceConfig\n ) {}\n\n static async provider(\n [cli, workspace, loggerAspect, builder, status, lanes, snapping, exporter, importer, checkout]: [\n CLIMain,\n Workspace,\n LoggerMain,\n BuilderMain,\n StatusMain,\n LanesMain,\n SnappingMain,\n ExportMain,\n ImporterMain,\n CheckoutMain,\n ],\n config: CiWorkspaceConfig\n ) {\n const logger = loggerAspect.createLogger(CiAspect.id);\n const ci = new CiMain(workspace, builder, status, lanes, snapping, exporter, importer, checkout, logger, config);\n const ciCmd = new CiCmd(workspace, logger);\n ciCmd.commands = [\n new CiVerifyCmd(workspace, logger, ci),\n new CiPrCmd(workspace, logger, ci),\n new CiMergeCmd(workspace, logger, ci),\n ];\n cli.register(ciCmd);\n\n return ci;\n }\n\n async getBranchName() {\n try {\n // if we are running on github, use the GITHUB_HEAD_REF env var\n if (process.env.GITHUB_HEAD_REF) return process.env.GITHUB_HEAD_REF;\n\n const branch = await git.branch();\n return branch.current;\n } catch (e: any) {\n throw new Error(`Unable to read branch: ${e.toString()}`);\n }\n }\n\n /**\n * Converts a branch name to a lane ID string using Bit's naming conventions.\n * Sanitizes branch name by replacing slashes and dots with dashes, converting to lowercase, then\n * prefixes with the workspace's default scope.\n *\n * @param branchName - The git branch name to convert\n * @returns Lane ID in format: {defaultScope}/{sanitizedBranch}\n * @example convertBranchToLaneId(\"feature/New-Component\") => \"my-scope/feature-new-component\"\n */\n convertBranchToLaneId(branchName: string): string {\n // Sanitize branch name to make it valid for Bit lane IDs by replacing slashes and dots with dashes\n // and converting to lowercase\n const sanitizedBranch = branchName.replace(/[/.]/g, '-').toLowerCase();\n return `${this.workspace.defaultScope}/${sanitizedBranch}`;\n }\n\n async getDefaultBranchName() {\n try {\n // Try to get the default branch from git symbolic-ref\n const result = await git.raw(['symbolic-ref', 'refs/remotes/origin/HEAD']);\n const defaultBranch = result.trim().split('/').pop();\n return defaultBranch || 'master';\n } catch (e: any) {\n // Fallback to common default branch names\n try {\n const branches = await git.branch(['-r']);\n if (branches.all.includes('origin/main')) return 'main';\n if (branches.all.includes('origin/master')) return 'master';\n return 'master'; // Final fallback\n } catch {\n this.logger.console(chalk.yellow(`Unable to detect default branch, using 'master': ${e.toString()}`));\n return 'master';\n }\n }\n }\n\n async getGitCommitMessage() {\n try {\n const commit = await git.log({\n maxCount: 1,\n });\n if (!commit.latest) {\n return null;\n }\n const { message, body } = commit.latest;\n return body ? `${message}\\n\\n${body}` : message;\n } catch (e: any) {\n throw new Error(`Unable to read commit message: ${e.toString()}`);\n }\n }\n\n private parseVersionBumpFromCommit(commitMessage: string): ReleaseType | null {\n // Check explicit bump keywords (highest priority after env vars)\n if (this.config.useExplicitBumpKeywords !== false) {\n // default to true\n if (commitMessage.includes('BIT-BUMP-MAJOR')) {\n this.logger.console(chalk.blue('Found BIT-BUMP-MAJOR keyword in commit message'));\n return 'major';\n }\n if (commitMessage.includes('BIT-BUMP-MINOR')) {\n this.logger.console(chalk.blue('Found BIT-BUMP-MINOR keyword in commit message'));\n return 'minor';\n }\n }\n\n // Check conventional commits if enabled\n if (this.config.useConventionalCommitsForVersionBump) {\n // Check for breaking changes (major version bump)\n if (/^feat!(\\(.+\\))?:|^fix!(\\(.+\\))?:|BREAKING CHANGE/m.test(commitMessage)) {\n this.logger.console(chalk.blue('Found breaking changes in commit message (conventional commits)'));\n return 'major';\n }\n\n // Check for features (minor version bump)\n if (/^feat(\\(.+\\))?:/m.test(commitMessage)) {\n this.logger.console(chalk.blue('Found feature commits (conventional commits)'));\n return 'minor';\n }\n\n // Check for fixes (patch version bump) - explicit patch not needed as it's default\n if (/^fix(\\(.+\\))?:/m.test(commitMessage)) {\n this.logger.console(chalk.blue('Found fix commits (conventional commits) - using default patch'));\n return 'patch';\n }\n }\n\n return null; // No specific version bump detected\n }\n\n private async getCustomCommitMessage() {\n try {\n const commitMessageScript = this.config.commitMessageScript;\n\n if (commitMessageScript) {\n this.logger.console(chalk.blue(`Running custom commit message script: ${commitMessageScript}`));\n\n // Parse the command to avoid shell injection\n const parts = commitMessageScript.split(' ');\n const command = parts[0];\n const args = parts.slice(1);\n\n const result = await execa(command, args, {\n cwd: this.workspace.path,\n encoding: 'utf8',\n });\n const customMessage = result.stdout.trim();\n\n if (customMessage) {\n this.logger.console(chalk.green(`Using custom commit message: ${customMessage}`));\n return customMessage;\n }\n }\n } catch (e: any) {\n this.logger.console(chalk.yellow(`Failed to run custom commit message script: ${e.toString()}`));\n }\n\n // Fallback to default message\n return 'chore: update .bitmap and lockfiles as needed [skip ci]';\n }\n\n private async verifyWorkspaceStatusInternal(strict: boolean = false) {\n this.logger.console('📊 Workspace Status');\n this.logger.console(chalk.blue('Verifying status of workspace'));\n\n const status = await this.status.status({ lanes: true });\n const { data: statusOutput, code } = await this.status.formatStatusOutput(\n status,\n strict\n ? { strict: true, warnings: true } // When strict=true, fail on both errors and warnings\n : { failOnError: true, warnings: false } // By default, fail only on errors (tag blockers)\n );\n\n // Log the formatted status output\n this.logger.console(statusOutput);\n\n if (code !== 0) {\n throw new Error('Workspace status verification failed');\n }\n\n this.logger.consoleSuccess(chalk.green('Workspace status is correct'));\n return { status };\n }\n\n private async switchToLane(laneName: string, options: SwitchLaneOptions = {}) {\n this.logger.console(chalk.blue(`Switching to ${laneName}`));\n try {\n await this.lanes.switchLanes(laneName, {\n forceOurs: true,\n workspaceOnly: true,\n skipDependencyInstallation: true,\n ...options,\n });\n } catch (e: any) {\n if (e.toString().includes('already checked out')) {\n this.logger.console(chalk.yellow(`Lane ${laneName} already checked out, skipping checkout`));\n return true;\n }\n this.logger.console(chalk.red(`Failed switching to ${laneName}: ${e.toString()}`));\n }\n }\n\n /**\n * Sync *config-only* changes from main onto the lane — without a full `bit lane merge`.\n *\n * In this workflow git is the source of truth for files: the PR author merges the default branch\n * into their PR branch, so source changes arrive via git. The one thing git can't carry is\n * config that's already been *tagged into objects* on main — e.g. another PR ran `bit env set` /\n * `bit deps set`; those records lived in `.bitmap`, rode git into main, and `bit ci merge` baked\n * them into the component's Version (clearing them from `.bitmap`). A long-running PR's lane\n * would otherwise miss them.\n *\n * A full lane merge is the wrong tool here: it does a 3-way *file* merge and refuses to run while\n * the workspace has modified components — but in `bit ci pr` the workspace is always dirty (the\n * PR's changes, not yet snapped). So instead we do a per-component 3-way merge of the aspect\n * *config only* (base = common ancestor, ours = lane, theirs = main), keeping the PR's config on\n * conflict, and stash the result on an `unmergedComponents` entry's `mergedConfig`. The\n * subsequent `snap` reads it (via the aspects-merger on component load) and bakes main's config\n * into the new snap, while the snap's files still come from the workspace (git). No file\n * checkout, so no clean-workspace requirement.\n */\n private async syncConfigFromMain(laneId: LaneId) {\n const legacyScope = this.workspace.scope.legacyScope;\n const repo = legacyScope.objects;\n const mainLaneId = this.lanes.getDefaultLaneId();\n const currentLane = await this.lanes.getCurrentLane();\n if (!currentLane) return;\n const workspaceIds = this.workspace.listIds();\n\n this.logger.console(chalk.blue(`Syncing config changes from ${mainLaneId.toString()} into ${laneId.toString()}`));\n\n const syncedIds: ComponentID[] = [];\n for (const laneComp of currentLane.components) {\n try {\n const modelComponent = await legacyScope.getModelComponent(laneComp.id);\n const mainHead = modelComponent.head; // the component's head on main\n if (!mainHead) continue; // component isn't on main — nothing to sync from there\n const laneHead = laneComp.head;\n if (mainHead.isEqual(laneHead)) continue; // lane already points at main's head\n\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: laneHead,\n targetHead: mainHead,\n throws: false,\n });\n // Only sync when main has snaps the lane doesn't (target ahead, or diverged). If the lane\n // is ahead-only / equal there's nothing on main to bring in.\n if (!divergeData.isTargetAhead() && !divergeData.isDiverged()) continue;\n\n const currentVersion = await modelComponent.loadVersion(laneHead.toString(), repo);\n const otherVersion = await modelComponent.loadVersion(mainHead.toString(), repo);\n // base = common ancestor. When the lane is strictly behind main (no divergence) the common\n // ancestor IS the lane head, so the lane's own aspects serve as the base.\n const baseSnap = divergeData.commonSnapBeforeDiverge;\n const baseVersion = baseSnap ? await modelComponent.loadVersion(baseSnap.toString(), repo) : currentVersion;\n\n const configMerger = new ComponentConfigMerger(\n laneComp.id.toStringWithoutVersion(),\n workspaceIds,\n undefined, // merging from main (the default lane) — there's no Lane object for it\n currentVersion.extensions,\n baseVersion.extensions,\n otherVersion.extensions,\n laneId.toString(),\n mainLaneId.toString(),\n this.logger,\n 'ours' as MergeStrategy // keep the PR's config on a genuine conflict\n );\n const mergedConfig = configMerger.merge().getSuccessfullyMergedConfig();\n if (!mergedConfig || !Object.keys(mergedConfig).length) continue;\n\n // Strip dependency deletion markers (version: '-'); the aspects-merger applies mergedConfig\n // as-is, so a leftover '-' would land in the policy.\n this.filterDeletedDependenciesFromConfig(mergedConfig);\n\n // Upsert: addEntry throws if an entry for this component already exists. A prior\n // --keep-lane run that crashed mid-snap (or otherwise left unmerged.json entries behind)\n // would otherwise make every later run throw here, skip the component, and keep serving\n // stale config. Remove any existing entry first so repeated runs converge on main's latest.\n legacyScope.objects.unmergedComponents.removeComponent(laneComp.id);\n legacyScope.objects.unmergedComponents.addEntry({\n id: { scope: laneComp.id.scope, name: laneComp.id.fullName },\n head: mainHead,\n laneId: mainLaneId,\n mergedConfig,\n });\n syncedIds.push(laneComp.id);\n this.logger.console(\n chalk.blue(\n ` ${laneComp.id.toStringWithoutVersion()}: applying main's config (${Object.keys(mergedConfig).join(', ')})`\n )\n );\n } catch (e: any) {\n // Best-effort per component: one component's config-merge quirk shouldn't abort the whole\n // `bit ci pr`. Log and move on — the build just won't reflect that component's main-side\n // config this run.\n this.logger.console(\n chalk.yellow(` ${laneComp.id.toStringWithoutVersion()}: skipping config sync from main (${e?.message || e})`)\n );\n }\n }\n\n if (!syncedIds.length) {\n this.logger.console(chalk.blue('No config changes from main to sync'));\n return;\n }\n await legacyScope.objects.unmergedComponents.write();\n // The components were already loaded (and their aspects cached) earlier in this run, before the\n // unmergedComponents entries existed. Clear the cache so the upcoming `snap` reloads them and\n // the aspects-merger folds in the synced `mergedConfig`.\n this.workspace.clearAllComponentsCache();\n this.logger.console(chalk.green(`Synced config from main for ${syncedIds.length} component(s)`));\n }\n\n /**\n * Copied from `merging.main.runtime` (`filterDeletedDependenciesFromConfig`): the config merge\n * can emit deletion markers (`version: '-'`) for deps removed on main. The aspects-merger applies\n * `mergedConfig` verbatim, so strip those here to avoid writing a policy entry with version '-'.\n */\n private filterDeletedDependenciesFromConfig(mergeConfig?: Record<string, any>): void {\n const policy: Record<string, Array<{ version?: string }>> | undefined =\n mergeConfig?.[DependencyResolverAspect.id]?.policy;\n if (!policy) return;\n Object.keys(policy).forEach((depType) => {\n const filtered = policy[depType].filter((dep) => dep.version !== '-');\n if (filtered.length === 0) delete policy[depType];\n else policy[depType] = filtered;\n });\n }\n\n /**\n * Best-effort, fetch-free check for whether the current (PR) branch is *behind* the default\n * branch — i.e. the default branch has commits the PR branch doesn't contain.\n *\n * We intentionally do NOT `git fetch` here (a fetch in CI can hang on an interactive SSH\n * host-key prompt — that's why `isStaleCiRun` was removed in #10300). We compare against\n * whatever `origin/<default>` ref the checkout already has, which reflects the state the default\n * branch was in when this CI run started — exactly the reference point we care about.\n *\n * Returns true only when we can *confirm* the branch is behind. If the ref can't be resolved or\n * anything else goes wrong, returns false (treat as \"not behind\" / proceed) so we never silently\n * disable the main→lane config propagation.\n */\n private async isBranchBehindDefaultBranch(): Promise<boolean> {\n try {\n const defaultBranch = await this.getDefaultBranchName();\n const defaultRefSha = (await git.revparse([`refs/remotes/origin/${defaultBranch}`])).trim();\n const headSha = (await git.revparse(['HEAD'])).trim();\n if (defaultRefSha === headSha) return false; // identical → up to date\n // We deliberately do NOT use `merge-base --is-ancestor`: it reports the answer via exit code\n // (0 = ancestor, 1 = not), but simple-git's `raw` resolves rather than rejects on exit code\n // 1, so the \"not an ancestor\" case was silently read as \"is an ancestor\" — the behind check\n // never fired. Instead compute the merge-base and compare: `merge-base(A, B) === A` iff A is\n // an ancestor of B. When origin/<default> is an ancestor of HEAD the PR already contains it\n // (not behind); otherwise the default branch has commits HEAD doesn't (behind).\n const mergeBase = (await git.raw(['merge-base', defaultRefSha, headSha])).trim();\n return mergeBase !== defaultRefSha;\n } catch (err: any) {\n this.logger.console(\n chalk.yellow(\n `Could not determine whether the PR branch is up to date with the default branch ` +\n `(proceeding as if up to date): ${err?.message || err}`\n )\n );\n return false;\n }\n }\n\n async verifyWorkspaceStatus() {\n await this.verifyWorkspaceStatusInternal();\n\n this.logger.console('🔨 Build Process');\n const components = await this.workspace.list();\n\n this.logger.console(chalk.blue(`Building ${components.length} components`));\n\n const build = await this.builder.build(components);\n\n build.throwErrorsIfExist();\n\n this.logger.console(chalk.green('Components built'));\n\n return { code: 0, data: '' };\n }\n\n async snapPrCommit({\n laneIdStr,\n message,\n build,\n strict,\n dryRun,\n keepLane,\n }: {\n laneIdStr: string;\n message: string;\n build: boolean | undefined;\n strict: boolean | undefined;\n dryRun?: boolean;\n keepLane?: boolean;\n }) {\n this.logger.console(chalk.blue(`Lane name: ${laneIdStr}`));\n\n const originalLane = await this.lanes.getCurrentLane();\n\n const laneId = await this.lanes.parseLaneId(laneIdStr);\n\n await this.verifyWorkspaceStatusInternal(strict);\n\n await this.importer\n .import({\n ids: [],\n installNpmPackages: false,\n writeConfigFiles: false,\n })\n .catch((e) => {\n throw new Error(`Failed to import components: ${e.toString()}`);\n });\n\n this.logger.console('🔄 Lane Management');\n\n // `--keep-lane` opts into reusing the same remote lane across subsequent commits to a PR, so\n // the lane's history and any lane-based UI edits on Bit Cloud survive. Without it we use the\n // default, battle-tested flow: snap onto a throwaway temp lane and delete+recreate the final\n // lane at export time (the lane is recreated on every PR commit).\n if (keepLane) {\n return this.snapAndExportReusingLane({ laneId, originalLane, message, build, dryRun });\n }\n return this.snapAndExportWithTempLane({ laneId, originalLane, message, build, dryRun });\n }\n\n /**\n * `--keep-lane` flow: reuse the existing remote lane (or create it on the first run), merge main\n * into it to pick up config changes that landed since the fork, snap, and export with\n * adopt-on-conflict recovery for concurrent CI pushes. The lane object is preserved across PR\n * commits, so its history and lane-based UI edits on Bit Cloud survive.\n */\n private async snapAndExportReusingLane({\n laneId,\n originalLane,\n message,\n build,\n dryRun,\n }: {\n laneId: LaneId;\n originalLane: Lane | undefined;\n message: string;\n build: boolean | undefined;\n dryRun?: boolean;\n }) {\n // Query the remote (by name, to avoid fetching all lanes) so we know whether to reuse or create\n const existingLanes = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name }).catch((e) => {\n if (e.toString().includes('was not found')) return [];\n throw new Error(`Failed to check lane ${laneId.toString()}: ${e.toString()}`);\n });\n const laneExists = existingLanes.length > 0;\n\n let foundErr: Error | undefined;\n try {\n if (laneExists) {\n // Reuse the existing remote lane so that the lane history, lane-based UI edits, and\n // lane-history feature on Bit Cloud all survive across subsequent commits to the same PR.\n // switchToLane fetches the latest lane head from remote.\n this.logger.console(chalk.blue(`Lane ${laneId.toString()} exists on remote, reusing it`));\n await this.switchToLane(laneId.toString());\n // Verify the switch actually landed us on the lane before doing any lane work.\n // switchToLane logs-and-swallows switch failures, so without this guard a failed switch\n // would let syncConfigFromMain and snap run against the wrong lane.\n const switchedLane = await this.lanes.getCurrentLane();\n if (switchedLane?.name !== laneId.name) {\n throw new Error(\n `Expected to be on lane ${laneId.name} after switching, but current lane is ${switchedLane?.name ?? 'main'}`\n );\n }\n // Sync config-only changes from main onto the lane, so config that was tagged into objects\n // on main since the lane forked (e.g. `bit deps set` / `bit env set` from another PR, not\n // visible via the workspace's git checkout) is reflected on the lane. Source files are\n // git's job — see syncConfigFromMain.\n //\n // BUT only when the PR branch is actually up to date with the default branch. If the PR is\n // behind (hasn't pulled main's latest), its git checkout still reflects the older fork\n // point, so pulling main's newer config onto the lane would desync the lane from the\n // source. The author merges the default branch into their PR in git; the next `bit ci pr`\n // then propagates it here.\n if (await this.isBranchBehindDefaultBranch()) {\n this.logger.console(\n chalk.yellow(\n `PR branch is behind the default branch — skipping config sync from main. ` +\n `Merge or rebase the default branch into your PR to pick up main's latest config.`\n )\n );\n } else {\n await this.syncConfigFromMain(laneId);\n }\n } else {\n this.logger.console(chalk.blue(`Creating lane ${laneId.toString()}`));\n const createLaneResult = await this.lanes.createLane(laneId.name, {\n scope: laneId.scope,\n forkLaneNewScope: true,\n });\n this.logger.console(chalk.blue(`Created lane ${laneId.toString()} (hash: ${createLaneResult.hash})`));\n }\n\n const currentLane = await this.lanes.getCurrentLane();\n this.logger.console(chalk.blue(`Current lane: ${currentLane?.name ?? 'main'}`));\n if (currentLane?.name !== laneId.name) {\n throw new Error(`Expected to be on lane ${laneId.name}, but current lane is ${currentLane?.name ?? 'main'}`);\n }\n\n this.logger.console('📦 Snapping Components');\n const results = await this.snapping.snap({\n message,\n build,\n exitOnFirstFailedTask: true,\n });\n\n if (!results) {\n this.logger.console(chalk.yellow('No changes detected, nothing to snap'));\n return 'No changes detected, nothing to snap';\n }\n\n const { snappedComponents }: SnapResults = results;\n\n const snapOutput = snapResultOutput(results);\n this.logger.console(snapOutput);\n\n if (dryRun) {\n this.logger.console(chalk.yellow('🏃 Dry-run mode: skipping export'));\n this.logger.console(chalk.green(`Snapped ${snappedComponents.length} component(s) successfully`));\n return snapOutput;\n }\n\n this.logger.console(chalk.blue(`Exporting ${snappedComponents.length} components`));\n await this.exportWithAdoptOnConflict(laneId, snappedComponents);\n } catch (e: any) {\n foundErr = e;\n throw e;\n } finally {\n if (foundErr) {\n this.logger.console(chalk.red(`Found error: ${foundErr.message}`));\n }\n // Best-effort cleanup: switch back to the original lane/main. Wrap it so a cleanup\n // failure (failed switch/checkout) only warns instead of throwing out of `finally` and\n // masking the real error from snap/export above (also avoids no-unsafe-finally).\n try {\n this.logger.console('🔄 Cleanup');\n const targetLane = originalLane?.name ?? 'main';\n this.logger.console(chalk.blue(`Switching back to ${targetLane}`));\n\n const currentLane = await this.lanes.getCurrentLane();\n if (currentLane) {\n await this.switchToLane(targetLane);\n } else {\n this.logger.console(chalk.yellow('Already on main, checking out to head'));\n await this.lanes.checkout.checkout({ head: true, skipNpmInstall: true });\n }\n } catch (cleanupErr: any) {\n this.logger.consoleWarning(`Cleanup after PR snap failed: ${cleanupErr.message}`);\n }\n }\n }\n\n /**\n * Default flow: snap onto a uniquely-named temporary lane, then at export time delete any\n * existing remote lane and rename the temp lane to the final name. The temp name minimizes the\n * race window when multiple CI jobs run concurrently on the same branch. Trade-off: the final\n * lane is recreated on every PR commit, so its history and any lane-based UI edits on Bit Cloud\n * don't survive across commits — use `--keep-lane` for that.\n */\n private async snapAndExportWithTempLane({\n laneId,\n originalLane,\n message,\n build,\n dryRun,\n }: {\n laneId: LaneId;\n originalLane: Lane | undefined;\n message: string;\n build: boolean | undefined;\n dryRun?: boolean;\n }) {\n // Use unique temp lane name to avoid race conditions when multiple CI jobs run concurrently\n const tempLaneName = `${laneId.name}-${generateRandomStr(5)}`;\n\n let foundErr: Error | undefined;\n let renamedToFinalName = false;\n try {\n const createLaneResult = await this.lanes.createLane(tempLaneName, {\n scope: laneId.scope,\n forkLaneNewScope: true,\n });\n this.logger.console(\n chalk.blue(`Created temporary lane ${laneId.scope}/${tempLaneName} (hash: ${createLaneResult.hash})`)\n );\n\n const currentLane = await this.lanes.getCurrentLane();\n\n this.logger.console(chalk.blue(`Current lane: ${currentLane?.name ?? 'main'}`));\n\n if (currentLane?.name !== tempLaneName) {\n throw new Error(\n `Expected to be on lane ${tempLaneName} after creation, but current lane is ${currentLane?.name ?? 'main'}`\n );\n }\n\n this.logger.console('📦 Snapping Components');\n const results = await this.snapping.snap({\n message,\n build,\n exitOnFirstFailedTask: true,\n });\n\n if (!results) {\n // No changes to snap - switch back to main and remove the temp lane we created\n this.logger.console(chalk.yellow('No changes detected, removing temporary lane'));\n await this.switchToLane(originalLane?.name ?? 'main');\n await this.lanes.removeLanes([tempLaneName], { remote: false, force: true });\n return 'No changes detected, nothing to snap';\n }\n\n const { snappedComponents }: SnapResults = results;\n\n const snapOutput = snapResultOutput(results);\n this.logger.console(snapOutput);\n\n if (dryRun) {\n this.logger.console(chalk.yellow('🏃 Dry-run mode: skipping export, lane deletion, and rename'));\n this.logger.console(chalk.green(`Snapped ${snappedComponents.length} component(s) successfully`));\n this.logger.console(\n chalk.blue(\n `Temporary lane \"${laneId.scope}/${tempLaneName}\" kept for debugging. Remove it with: bit lane remove ${laneId.scope}/${tempLaneName}`\n )\n );\n return snapOutput;\n }\n\n // Finalize atomically: delete existing lane, rename temp lane, export\n this.logger.console('🔄 Finalizing Lane');\n\n // Check if original lane exists on remote and delete it (query by name to avoid fetching all lanes)\n const existingLanes = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name }).catch((e) => {\n // Lane not found is expected on first run - just means nothing to delete\n if (e.toString().includes('was not found')) {\n return [];\n }\n throw new Error(`Failed to check lane ${laneId.toString()}: ${e.toString()}`);\n });\n\n if (existingLanes.length) {\n this.logger.console(chalk.blue(`Deleting existing remote lane ${laneId.toString()}`));\n const archiveResult = await this.archiveLane(laneId.toString(), true); // throwOnError: delete must succeed before export\n if (archiveResult === 'not-found') {\n // `getLanes` just reported the lane exists, but the delete API says \"not found\". Re-query\n // to confirm. If the lane still shows up, something is off on the remote (delete can't\n // see what list/export can), and retrying will never converge.\n let stillExists;\n try {\n stillExists = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name });\n } catch (verifyErr: any) {\n throw new Error(\n `failed to verify whether remote lane ${laneId.toString()} still exists after delete returned \"not found\": ${verifyErr?.message || verifyErr}`\n );\n }\n if (stillExists.length) {\n throw new Error(\n `unable to delete remote lane ${laneId.toString()}: the remote reports the lane as \"not found\" from ` +\n `the delete API but still lists it from the query API. maybe this is a remote issue on bit.cloud. ` +\n `please contact support or manually delete the lane on bit.cloud before re-running CI.`\n );\n }\n }\n }\n\n // Rename temp lane to original name\n this.logger.console(chalk.blue(`Renaming lane from ${tempLaneName} to ${laneId.name}`));\n await this.lanes.rename(laneId.name, tempLaneName);\n renamedToFinalName = true;\n\n // Export with the correct name. Retry on hash-mismatch, which indicates a concurrent CI job\n // pushed the same lane id between our pre-export delete and our merge on the hub.\n this.logger.console(chalk.blue(`Exporting ${snappedComponents.length} components`));\n const exportResults = await this.exportWithRetryOnLaneHashMismatch(laneId.toString());\n this.logger.console(chalk.green(`Exported ${exportResults.componentsIds.length} components`));\n } catch (e: any) {\n foundErr = e;\n throw e;\n } finally {\n if (foundErr) {\n this.logger.console(chalk.red(`Found error: ${foundErr.message}`));\n }\n // Always switch back to the original lane\n this.logger.console('🔄 Cleanup');\n const targetLane = originalLane?.name ?? 'main';\n this.logger.console(chalk.blue(`Switching back to ${targetLane}`));\n\n const currentLane = await this.lanes.getCurrentLane();\n if (currentLane) {\n await this.switchToLane(targetLane);\n } else {\n this.logger.console(chalk.yellow('Already on main, checking out to head'));\n await this.lanes.checkout.checkout({ head: true, skipNpmInstall: true });\n }\n\n // Clean up orphaned temporary lane on error. Skip if the rename to the final name already\n // happened - in that case the temp name no longer exists locally, and the lane under the\n // final name may have been partially exported; leave it alone rather than wipe evidence.\n if (foundErr && !renamedToFinalName) {\n const tempLaneFullName = `${laneId.scope}/${tempLaneName}`;\n this.logger.console(chalk.blue(`Cleaning up temporary lane ${tempLaneFullName}`));\n try {\n await this.lanes.removeLanes([tempLaneFullName], { remote: false, force: true });\n this.logger.console(chalk.green(`Removed temporary lane ${tempLaneFullName}`));\n } catch (cleanupErr: any) {\n // Ignore cleanup errors to avoid masking the original error\n this.logger.console(chalk.yellow(`Failed to clean up temporary lane: ${cleanupErr?.message || cleanupErr}`));\n }\n }\n }\n }\n\n /**\n * Export with a recovery path for the two concurrent-CI conflicts that can surface from the\n * remote (see the marker constants at the top of the file): lane-hash mismatch (both runners\n * created fresh lane objects when the lane didn't yet exist on the remote) and per-component\n * divergence (both reused the existing lane but snapped the same component with different\n * content).\n *\n * Recovery: adopt-the-winner. The remote lane (whoever pushed first) becomes canonical. We\n * drop our local lane object, fetch the remote, rebase our snapped Version objects so each\n * one's parent points to the remote head for that component, then swap those rebased Versions\n * in as the new lane heads and re-export. Build artifacts are preserved — only the parent\n * pointers on the Version objects change. Result: both runners' snaps end up chained on a\n * single lane object (last-writer-wins on content for any contested component, with the\n * winner's snap preserved in history as the parent).\n */\n private async exportWithAdoptOnConflict(laneId: LaneId, snappedComponents: ConsumerComponent[]) {\n try {\n const exportResults = await this.exporter.export();\n this.logger.console(chalk.green(`Exported ${exportResults.componentsIds.length} components`));\n return;\n } catch (e: any) {\n const msg = e?.message || e?.toString() || '';\n const isLaneHashMismatch = msg.includes(LANE_HASH_MISMATCH_MARKER);\n const isComponentDivergence = msg.includes(COMPONENT_DIVERGENCE_MARKER);\n if (!isLaneHashMismatch && !isComponentDivergence) throw e;\n const cause = isLaneHashMismatch ? 'Lane hash mismatch' : 'Per-component divergence';\n this.logger.console(\n chalk.yellow(\n `${cause} on \"${laneId.toString()}\" — likely a concurrent CI push. Adopting the remote lane and rebasing local snaps onto its heads.`\n )\n );\n }\n\n const snappedHeads = snappedComponents.map((c) => {\n // A just-snapped component always has a version; guard defensively so a missing one fails\n // with a clear message instead of `Ref.from(undefined)`'s opaque \"hash argument is empty\".\n if (!c.version) {\n throw new Error(\n `unable to recover from the lane-hash mismatch: snapped component \"${c.id.toString()}\" has no version to rebase onto the remote lane`\n );\n }\n return { id: c.id, head: Ref.from(c.version) };\n });\n\n await this.rebaseOntoRemoteLane(laneId, snappedHeads);\n\n this.logger.console(chalk.blue('Retrying export with rebased snaps'));\n const exportResults = await this.exportWithBusyRetry();\n this.logger.console(chalk.green(`Exported ${exportResults.componentsIds.length} components after rebase`));\n }\n\n /**\n * Wrap `exporter.export()` with retry on the \"server is busy\" error. The retried export's\n * pending-dir lands behind whichever concurrent client is still in the remote's queue (we\n * arrived second by definition — we're the loser of the original race). The 60s wait inside\n * `export-validate.waitIfNeeded` covers the common case, but on slow CI hosts or large pushes\n * we sometimes time out before the other client finishes its persist. A short sleep + retry\n * here just gives the queue room to drain.\n */\n private async exportWithBusyRetry(maxAttempts = 3) {\n const isBusyErr = (err: any) => (err?.message || err?.toString() || '').includes('server is busy by other exports');\n let lastErr: any;\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n try {\n return await this.exporter.export();\n } catch (e: any) {\n lastErr = e;\n if (!isBusyErr(e)) throw e;\n this.logger.console(\n chalk.yellow(\n `Export attempt ${attempt}/${maxAttempts} blocked by a busy remote queue. Waiting before retrying.`\n )\n );\n await new Promise((resolve) => setTimeout(resolve, 2000 * attempt));\n }\n }\n throw lastErr;\n }\n\n private async rebaseOntoRemoteLane(laneId: LaneId, snappedHeads: Array<{ id: ComponentID; head: Ref }>) {\n const legacyScope = this.workspace.scope.legacyScope;\n const repo = legacyScope.objects;\n\n // Our local lane object (the one we just snapped onto) shares the LaneId with the remote\n // (winning) lane but has a different, randomly-minted hash. Fetching the remote lane writes it\n // into our scope via `sources.mergeLane`, which rejects a same-id/different-hash lane (\"a lane\n // with the same id already exists with a different hash\") — so we must drop our local lane\n // object BEFORE the fetch, not after. We can't use `lanes.removeLanes` (it refuses to remove\n // the currently-checked-out lane), so we trash the lane object directly; that also removes it\n // from the scope index, so `loadLane` (the guard's lookup) no longer finds it. Only the lane\n // pointer is trashed — the Version objects we snapped stay in the scope for the rebase below,\n // and the fetch immediately re-persists a same-id lane object, satisfying the current-lane\n // workspace pointer again.\n const localLane = await legacyScope.loadLane(laneId);\n if (localLane) {\n this.logger.console(chalk.blue(`Dropping local lane object ${laneId.toString()} to adopt the remote one`));\n await repo.moveObjectsToTrash([localLane.hash()]);\n }\n\n // Fetch the remote (winning) lane and the Version objects it points at. With our local lane\n // object gone, `mergeLane` sees no conflicting same-id lane and persists the remote one.\n this.logger.console(chalk.blue(`Fetching remote lane ${laneId.toString()}`));\n const remoteLane = await this.lanes.fetchLaneWithItsComponents(laneId);\n\n // Rewrite each snapped Version's parent to point at the remote head for that component.\n // Bit's Version objects aren't content-addressed — `_hash` is set once and not derived\n // from content — so we can mutate `parents` in place. The hash stays the same, so the\n // build artifacts referenced from the Version remain valid and the lane's component head\n // doesn't need to be re-pointed. The remote receives the updated Version because our\n // first failed export attempt was rejected during the export-validate step (via\n // `sources.mergeLane`'s same-id/different-hash guard) — *before* `ExportPersist` writes any\n // files to disk — so the remote doesn't yet have this hash and won't dedupe-skip it during\n // transfer.\n for (const snap of snappedHeads) {\n const remoteComp = remoteLane.components.find((c) => c.id.isEqualWithoutVersion(snap.id));\n if (!remoteComp) continue; // component is only on our lane, not on the remote — no rebase target\n const remoteHead = remoteComp.head;\n if (snap.head.isEqual(remoteHead)) continue;\n\n const version = (await repo.load(snap.head)) as Version | undefined;\n if (!version) {\n throw new Error(\n `rebaseOntoRemoteLane: unable to load Version object for ${snap.id.toString()} hash ${snap.head.toString()}`\n );\n }\n if (version.parents.some((p) => p.isEqual(remoteHead))) continue; // already chains correctly\n\n const beforeParents = version.parents.map((p) => p.toString().slice(0, 9)).join(',');\n // Re-point only the lane-lineage parent (the first parent — the predecessor snap on the\n // lane) to the remote head, preserving any additional parents. A snap produced after\n // `syncConfigFromMain` is a merge snap whose second parent links to main's head; overwriting\n // the whole array with `[remoteHead]` would silently drop that merge edge and corrupt the\n // lane's ancestry.\n version.parents = [remoteHead, ...version.parents.slice(1)];\n const afterParents = version.parents.map((p) => p.toString().slice(0, 9)).join(',');\n this.logger.console(\n chalk.blue(\n `Rebasing ${snap.id.toString()}@${snap.head.toString().slice(0, 9)}: parents [${beforeParents}] → [${afterParents}]`\n )\n );\n repo.add(version);\n\n // Keep the local VersionHistory in sync with the rewritten parents. The first (failed)\n // export already traversed and wrote VersionHistory with this version's *original* parent;\n // without this update the re-export's diverge computation reads that stale history, never\n // sees the remote head as an ancestor, and can send the wrong version set or throw a\n // spurious \"no common snap\" error. `updateRebasedVersionHistory` only touches the entry if\n // this version already exists in the history (it does, from that first traversal).\n const modelComponent = await legacyScope.getModelComponent(snap.id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(repo, [version]);\n if (versionHistory) repo.add(versionHistory);\n }\n\n // Replace the remote lane's component heads with our snapped Versions. Anything we\n // didn't snap stays as the remote had it.\n //\n // TODO(stale-runner): if two consecutive PR commits trigger two CI runs and the older one\n // finishes last, it will rebase its (older-content) snap on top of the newer one — the\n // newer commit's snap stays in history but the lane head regresses to the older content.\n // The fix needs git-SHA-aware staleness detection (embed `git rev-parse HEAD` in the snap\n // log on creation, compare against the remote head's stored SHA on rebase, abort if our\n // commit is an ancestor of theirs). The prior `isStaleCiRun` (removed in #10300 for\n // SSH-prompt reasons) attempted this via `git fetch`; we'd want a fetch-free variant here.\n const updatedComponents: LaneComponent[] = remoteLane.components.map((c) => {\n const snap = snappedHeads.find((s) => s.id.isEqualWithoutVersion(c.id));\n return snap ? { ...c, head: snap.head } : c;\n });\n // Pick up any components we snapped that aren't on the remote lane yet (newly added on this PR).\n for (const snap of snappedHeads) {\n if (!updatedComponents.some((c) => c.id.isEqualWithoutVersion(snap.id))) {\n updatedComponents.push({ id: snap.id, head: snap.head });\n }\n }\n remoteLane.setLaneComponents(updatedComponents);\n remoteLane.hasChanged = true;\n await legacyScope.lanes.saveLane(remoteLane, { saveLaneHistory: false });\n\n await repo.persist();\n\n // Make sure the workspace's current-lane pointer points at the lane we just adopted.\n this.workspace.consumer.setCurrentLane(laneId, true);\n await this.workspace.bitMap.write();\n }\n\n async mergePr({\n message: argMessage,\n build,\n strict,\n releaseType,\n preReleaseId,\n incrementBy,\n explicitVersionBump,\n verbose,\n versionsFile,\n autoMergeResolve,\n forceTheirs,\n laneName,\n skipPush,\n noBitmapCommit,\n }: {\n message?: string;\n build?: boolean;\n strict?: boolean;\n releaseType: ReleaseType;\n preReleaseId?: string;\n incrementBy?: number;\n explicitVersionBump?: boolean;\n verbose?: boolean;\n versionsFile?: string;\n autoMergeResolve?: MergeStrategy;\n forceTheirs?: boolean;\n laneName?: string;\n skipPush?: boolean;\n noBitmapCommit?: boolean;\n }) {\n // Capture the initial commit SHA before any operations modify the repository\n const initialCommitSha = await git.revparse(['HEAD']);\n\n const message = argMessage || (await this.getGitCommitMessage());\n if (!message) {\n throw new Error('Failed to get commit message from git. Please provide a message using --message option.');\n }\n\n const currentLane = await this.lanes.getCurrentLane();\n const laneComponents = currentLane?.components;\n if (currentLane) {\n // this doesn't normally happen. we expect this mergePr to be called from the default branch, which normally checks\n // out to main lane.\n this.logger.console(chalk.blue(`Currently on lane ${currentLane.name}, switching to main`));\n await this.switchToLane('main');\n // this is needed to make sure components that were created on the lane are now available on main.\n // without this, the switch to main above, marks those components as not-available, and won't be tagged later on.\n // don't use the high-level `consumer.resetLaneNew()`, because it deletes the entire local scope.\n const changedIds = this.workspace.consumer.bitMap.resetLaneComponentsToNew();\n if (changedIds.length) {\n const changedIdsList = ComponentIdList.fromArray(changedIds);\n await this.workspace.scope.legacyScope.removeMany(changedIdsList, true);\n\n await this.workspace.clearCache();\n await this.workspace.bitMap.write('reset lane new');\n }\n\n this.logger.console(chalk.green('Switched to main lane'));\n }\n\n // Pull latest changes from remote to ensure we have the most up-to-date .bitmap\n // This prevents issues when multiple PRs are merged in sequence\n const defaultBranch = await this.getDefaultBranchName();\n this.logger.console(chalk.blue(`Pulling latest git changes from ${defaultBranch} branch`));\n\n // Check if there are any changes to stash before rebasing\n const gitStatus = await git.status();\n const hasChanges = gitStatus.files.length > 0;\n\n if (hasChanges) {\n this.logger.console(chalk.yellow('Stashing uncommitted changes before rebase'));\n await git.stash(['push', '-u', '-m', 'CI merge temporary stash']);\n }\n\n await git.pull('origin', defaultBranch, { '--rebase': 'true' });\n\n if (hasChanges) {\n this.logger.console(chalk.yellow('Restoring stashed changes after rebase'));\n await git.stash(['pop']);\n }\n\n this.logger.console(chalk.green('Pulled latest git changes'));\n\n this.logger.console('🔄 Checking out to main head');\n await this.importer.importCurrentObjects();\n\n const checkoutProps = {\n forceOurs: !forceTheirs && !autoMergeResolve, // only force ours if neither forceTheirs nor autoMergeResolve is specified\n head: true,\n skipNpmInstall: true,\n ...(forceTheirs && { forceTheirs }),\n ...(autoMergeResolve && { mergeStrategy: autoMergeResolve }),\n };\n const checkoutResults = await this.checkout.checkout(checkoutProps);\n\n await this.workspace.bitMap.write('checkout head');\n this.logger.console(reportToString(checkoutOutput(checkoutResults, checkoutProps)));\n\n if (laneComponents?.length) {\n await this.restoreLaneConfigChanges(laneComponents);\n }\n\n // Check for workspace.jsonc conflicts\n if (\n checkoutResults.workspaceConfigUpdateResult?.workspaceDepsConflicts ||\n checkoutResults.workspaceConfigUpdateResult?.workspaceConfigConflictWriteError\n ) {\n this.logger.console(chalk.red('❌ workspace.jsonc conflicts detected during checkout'));\n this.logger.console(chalk.blue('\\nTo resolve these conflicts, please run:'));\n this.logger.console(chalk.bold(' bit checkout head'));\n this.logger.console(chalk.gray('\\nThis will allow you to manually resolve the conflicts in workspace.jsonc.'));\n\n throw new Error(\n 'Cannot complete CI merge due to workspace.jsonc conflicts. Please run \"bit checkout head\" and fix the conflicts manually.'\n );\n }\n\n // Check for conflicts when using manual merge strategy\n if (autoMergeResolve === 'manual' && checkoutResults.leftUnresolvedConflicts) {\n const componentsWithConflicts =\n checkoutResults.components?.filter(\n (c) => c.filesStatus && Object.values(c.filesStatus).some((status) => status === 'manual')\n ) || [];\n\n const conflictedComponentIds = componentsWithConflicts.map((c) => c.id.toString());\n\n this.logger.console(chalk.red('❌ Merge conflicts detected during checkout'));\n this.logger.console(chalk.yellow('The following components have conflicts:'));\n conflictedComponentIds.forEach((id) => {\n this.logger.console(chalk.yellow(` - ${id}`));\n });\n this.logger.console(chalk.blue('\\nTo resolve these conflicts, please run:'));\n this.logger.console(chalk.bold(' bit checkout head'));\n this.logger.console(chalk.gray('\\nThis will allow you to manually resolve the conflicts.'));\n\n throw new Error(\n 'Cannot complete CI merge due to unresolved conflicts. Please resolve conflicts manually and try again.'\n );\n }\n\n const { status } = await this.verifyWorkspaceStatusInternal(strict);\n\n const hasSoftTaggedComponents = status.softTaggedComponents.length > 0;\n\n this.logger.console('📦 Component Operations');\n this.logger.console(chalk.blue('Tagging components'));\n const finalReleaseType = await this.determineReleaseType(releaseType, explicitVersionBump);\n const tagResults = await this.snapping.tag({\n all: true,\n message,\n build,\n failFast: true,\n persist: hasSoftTaggedComponents,\n releaseType: finalReleaseType,\n preReleaseId,\n incrementBy,\n versionsFile,\n });\n\n if (tagResults) {\n const tagOutput = tagResultOutput(tagResults);\n this.logger.console(tagOutput);\n } else {\n this.logger.console(chalk.yellow('No components to tag'));\n }\n\n const hasTaggedComponents = tagResults?.taggedComponents && tagResults.taggedComponents.length > 0;\n\n if (hasTaggedComponents) {\n this.logger.console(chalk.blue('Exporting components'));\n const exportResult = await this.exporter.export();\n\n if (exportResult.componentsIds.length > 0) {\n this.logger.console(chalk.green(`Exported ${exportResult.componentsIds.length} component(s)`));\n } else {\n this.logger.console(chalk.yellow('Nothing to export'));\n }\n\n if (noBitmapCommit) {\n this.logger.console(\n chalk.yellow(\n 'Skipping bitmap commit (--no-bitmap-commit flag). The new versions are in scope; no git commit will be created on the default branch.'\n )\n );\n this.logger.console(\n chalk.gray(\n 'Developers auto-sync their local .bitmap on the next bit command after `git pull` when `bitmapAutoSync: true` is set in workspace.jsonc.'\n )\n );\n } else {\n await this.commitAndPushBitmapChanges({ verbose, skipPush, defaultBranch });\n }\n } else {\n this.logger.console(chalk.yellow('No components were tagged, skipping export and git operations'));\n }\n\n this.logger.console(chalk.green('Merged PR'));\n\n // Enhanced lane cleanup logic\n await this.performLaneCleanup(currentLane, laneName, initialCommitSha);\n\n return { code: 0, data: '' };\n }\n\n /**\n * Stage every changed file (post-tag/export the bitmap, lockfiles, and any files\n * touched by `bit checkout head` may differ), commit with the configured message,\n * rebase against origin, and push — unless `skipPush` was passed.\n */\n private async commitAndPushBitmapChanges({\n verbose,\n skipPush,\n defaultBranch,\n }: {\n verbose?: boolean;\n skipPush?: boolean;\n defaultBranch: string;\n }) {\n this.logger.console('🔄 Git Operations');\n await git.addConfig('user.email', 'bit-ci[bot]@bit.cloud');\n await git.addConfig('user.name', 'Bit CI');\n\n const statusBeforeCommit = await git.status();\n this.logger.console(chalk.blue(`Git status before commit: ${statusBeforeCommit.files.length} files`));\n statusBeforeCommit.files.forEach((file) => {\n this.logger.console(chalk.gray(` ${file.working_dir}${file.index} ${file.path}`));\n });\n\n if (verbose && statusBeforeCommit.files.length > 0) {\n try {\n const diff = await git.diff();\n if (diff) {\n this.logger.console(chalk.blue('Git diff before commit:'));\n this.logger.console(diff);\n }\n } catch (error) {\n this.logger.console(chalk.yellow(`Failed to show git diff: ${error}`));\n }\n }\n\n // Stage everything: `bit checkout head` earlier in the flow may modify files\n // beyond .bitmap and pnpm-lock.yaml, so a narrow `git add` would miss them.\n await git.add(['.']);\n const commitMessage = await this.getCustomCommitMessage();\n await git.commit(commitMessage);\n\n const statusAfterCommit = await git.status();\n this.logger.console(chalk.blue(`Git status after commit: ${statusAfterCommit.files.length} files`));\n statusAfterCommit.files.forEach((file) => {\n this.logger.console(chalk.gray(` ${file.working_dir}${file.index} ${file.path}`));\n });\n\n await git.pull('origin', defaultBranch, { '--rebase': 'true' });\n if (skipPush) {\n this.logger.console(chalk.yellow('Skipping git push (--skip-push flag)'));\n return;\n }\n await git.push('origin', defaultBranch);\n }\n\n /**\n * Compare lane Version extensions with main Version extensions for each component.\n * Any config differences (e.g. env-set, deps-set) are saved to .bitmap so they survive\n * the switch from lane to main and get included in the subsequent tag.\n */\n private async restoreLaneConfigChanges(laneComponents: LaneComponent[]) {\n const scope = this.workspace.scope.legacyScope;\n const repo = scope.objects;\n let hasChanges = false;\n\n const activeComponents = laneComponents.filter((c) => !c.isDeleted);\n await Promise.all(\n activeComponents.map(async (laneComp) => {\n const laneVersion = (await repo.load(laneComp.head)) as Version;\n if (!laneVersion) {\n this.logger.console(chalk.yellow(`Warning: could not load Version object for ${laneComp.id.toString()}`));\n return;\n }\n\n const laneConfig = laneVersion.extensions.toConfigObject();\n if (!laneConfig || Object.keys(laneConfig).length === 0) return;\n\n // Get main Version for comparison\n let mainConfig: Record<string, any> = {};\n const modelComp = await scope.getModelComponentIfExist(laneComp.id.changeVersion(undefined));\n const mainHead = modelComp?.getHead();\n if (mainHead) {\n const mainVersion = (await repo.load(mainHead)) as Version;\n mainConfig = mainVersion?.extensions.toConfigObject() ?? {};\n }\n\n for (const [aspectId, config] of Object.entries(laneConfig)) {\n if (!isEqual(config, mainConfig[aspectId])) {\n const updated = this.workspace.bitMap.addComponentConfig(\n laneComp.id,\n aspectId,\n config as Record<string, any>\n );\n if (updated) hasChanges = true;\n }\n }\n })\n );\n\n if (hasChanges) {\n await this.workspace.bitMap.write('restore lane config');\n await this.workspace.clearCache();\n this.logger.console(chalk.blue('Restored config changes from lane'));\n }\n }\n\n /**\n * Performs lane cleanup by attempting to detect and delete the source lane\n * after a successful merge, even when running on the main branch\n */\n private async performLaneCleanup(currentLane: any, explicitLaneName?: string, initialCommitSha?: string) {\n this.logger.console('🗑️ Lane Cleanup');\n\n // If we already have a current lane, use it\n if (currentLane) {\n this.logger.console(chalk.blue(`Found current lane: ${currentLane.name}`));\n const laneId = currentLane.id();\n await this.archiveLane(laneId.toString());\n return;\n }\n\n // If no current lane but explicit lane name provided, try to delete it\n if (explicitLaneName) {\n this.logger.console(chalk.blue(`Using explicitly provided lane name: ${explicitLaneName}`));\n try {\n const laneId = await this.lanes.parseLaneId(explicitLaneName);\n await this.archiveLane(laneId.toString());\n return;\n } catch (e: any) {\n this.logger.console(chalk.yellow(`Failed to parse lane name '${explicitLaneName}': ${e.message}`));\n }\n }\n\n // Try to auto-detect source branch/lane name using the dedicated detector\n const sourceBranchDetector = new SourceBranchDetector(this.logger);\n const sourceBranchName = await sourceBranchDetector.getSourceBranchName(initialCommitSha);\n if (!sourceBranchName) {\n this.logger.console(chalk.yellow('No current lane and unable to detect source branch - skipping lane cleanup'));\n return;\n }\n try {\n const laneIdStr = this.convertBranchToLaneId(sourceBranchName);\n\n this.logger.console(\n chalk.blue(`Attempting to delete lane based on source branch: ${sourceBranchName} -> ${laneIdStr}`)\n );\n\n const laneId = await this.lanes.parseLaneId(laneIdStr);\n await this.archiveLane(laneId.toString());\n } catch (e: any) {\n this.logger.console(\n chalk.yellow(`Error during lane cleanup for source branch '${sourceBranchName}': ${e.message}`)\n );\n }\n }\n\n /**\n * Export with retry on lane hash-mismatch, caused by a concurrent `bit ci pr` run pushing the\n * same lane id between our pre-export delete and the hub's merge (the export takes 1-2 minutes,\n * plenty of time to race). Used by the default (temp-lane) flow. On mismatch we delete the\n * remote lane and retry — the temp-lane flow recreates the lane on every run anyway, so there's\n * no lane history to preserve. (The `--keep-lane` flow instead adopts the remote lane and\n * rebases onto it; see `exportWithAdoptOnConflict`.)\n */\n private async exportWithRetryOnLaneHashMismatch(laneIdStr: string, maxAttempts = 3) {\n const isHashMismatchErr = (err: any) => (err?.message || err?.toString() || '').includes(LANE_HASH_MISMATCH_MARKER);\n\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n try {\n return await this.exporter.export();\n } catch (e: any) {\n if (!isHashMismatchErr(e) || attempt === maxAttempts) throw e;\n this.logger.console(\n chalk.yellow(\n `Export attempt ${attempt}/${maxAttempts} failed with lane hash mismatch on \"${laneIdStr}\" (likely a concurrent CI push). Deleting remote lane and retrying.`\n )\n );\n try {\n await this.archiveLane(laneIdStr, true);\n } catch (archiveErr: any) {\n // Preserve the original export error - rethrowing the archive error would hide the real\n // reason the push was rejected.\n this.logger.console(\n chalk.yellow(\n `Failed to delete remote lane \"${laneIdStr}\" while recovering from hash mismatch: ${archiveErr?.message || archiveErr}. Rethrowing the original export error.`\n )\n );\n if (e && typeof e === 'object' && (e as any).cause == null) {\n (e as any).cause = archiveErr;\n }\n throw e;\n }\n }\n }\n throw new Error(`exportWithRetryOnLaneHashMismatch: exhausted ${maxAttempts} attempts for lane ${laneIdStr}`);\n }\n\n /**\n * Archives (deletes) a lane with proper error handling and logging.\n * @param throwOnError - if true, throws on failure (use for critical operations like pre-export cleanup)\n */\n private async archiveLane(laneId: string, throwOnError = false): Promise<'deleted' | 'not-found' | 'error'> {\n try {\n this.logger.console(chalk.blue(`Archiving lane ${laneId}`));\n // force means to remove the lane even if it was not merged. in this case, we don't care much because main already has the changes.\n const archiveLane = await this.lanes.removeLanes([laneId], { remote: true, force: true });\n if (archiveLane.length) {\n this.logger.console(chalk.green(`Lane '${laneId}' archived successfully`));\n return 'deleted';\n }\n this.logger.console(chalk.yellow(`Failed to archive lane '${laneId}' - no lanes were removed`));\n return 'not-found';\n } catch (e: any) {\n if (e.message?.includes('was not found') || e.toString().includes('was not found')) {\n this.logger.console(chalk.yellow(`Lane '${laneId}' was not found on the remote`));\n return 'not-found';\n }\n this.logger.console(chalk.red(`Error archiving lane '${laneId}': ${e.message}`));\n if (throwOnError) {\n throw new Error(`Failed to delete remote lane '${laneId}': ${e.message}`);\n }\n return 'error';\n // Don't throw the error - lane cleanup is not critical to the merge process\n }\n }\n\n /**\n * Auto-detect version bump from commit messages if no explicit version bump was provided\n */\n private async determineReleaseType(releaseType: ReleaseType, explicitVersionBump?: boolean): Promise<ReleaseType> {\n if (explicitVersionBump) {\n this.logger.console(chalk.blue(`Using explicit version bump: ${releaseType}`));\n return releaseType;\n }\n // Only auto-detect if user didn't specify any version flags\n const lastCommit = await this.getGitCommitMessage();\n if (!lastCommit) {\n this.logger.console(chalk.blue('No commit message found, using default patch'));\n return releaseType;\n }\n const detectedReleaseType = this.parseVersionBumpFromCommit(lastCommit);\n if (detectedReleaseType) {\n this.logger.console(chalk.green(`Auto-detected version bump: ${detectedReleaseType}`));\n return detectedReleaseType;\n }\n this.logger.console(chalk.blue('No specific version bump detected, using default patch'));\n return releaseType;\n }\n}\n\nfunction reportToString(result: string | { data: string }): string {\n return typeof result === 'string' ? result : result.data;\n}\n\nCiAspect.addRuntime(CiMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,M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AAO,CAACC,gBAAK,CAACY,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACzF,OAAOqM,WAAW;EACpB;AACF;AAACwF,OAAA,CAAA7V,MAAA,GAAAA,MAAA;AAAAlB,eAAA,CAv3CYkB,MAAM,aACA8V,kBAAW;AAAAhX,eAAA,CADjBkB,MAAM,kBAGU,CACzB+V,gBAAS,EACTC,4BAAe,EACfC,sBAAY,EACZC,wBAAa,EACbC,sBAAY,EACZC,oBAAW,EACXC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,0BAAc,CACf;AAAA1X,eAAA,CAdUkB,MAAM,WAgBG,EAAE;AAy2CxB,SAASiS,cAAcA,CAACvP,MAAiC,EAAU;EACjE,OAAO,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAAC3G,IAAI;AAC1D;AAEAiF,cAAQ,CAACyV,UAAU,CAACzW,MAAM,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_workspace","_builder","_status","_lanes","_snapping","_export","_importer","_checkout","_component","_configMerger","_dependencyResolver","_execa","_interopRequireDefault","_chalk","_ci","_ci2","_verify","_pr","_merge","_git","_componentId","_lodash","_objects","_sourceBranchDetector","_toolboxString","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LANE_HASH_MISMATCH_MARKER","COMPONENT_DIVERGENCE_MARKER","CiMain","constructor","workspace","builder","status","lanes","snapping","exporter","importer","checkout","logger","config","provider","cli","loggerAspect","createLogger","CiAspect","id","ci","ciCmd","CiCmd","commands","CiVerifyCmd","CiPrCmd","CiMergeCmd","register","getBranchName","process","env","GITHUB_HEAD_REF","branch","git","current","Error","toString","convertBranchToLaneId","branchName","sanitizedBranch","replace","toLowerCase","defaultScope","getDefaultBranchName","result","raw","defaultBranch","trim","split","pop","branches","all","includes","console","chalk","yellow","getGitCommitMessage","commit","log","maxCount","latest","message","body","parseVersionBumpFromCommit","commitMessage","useExplicitBumpKeywords","blue","useConventionalCommitsForVersionBump","test","getCustomCommitMessage","commitMessageScript","parts","command","args","slice","execa","cwd","path","encoding","customMessage","stdout","green","verifyWorkspaceStatusInternal","strict","statusOutput","code","formatStatusOutput","warnings","failOnError","consoleSuccess","switchToLane","laneName","options","switchLanes","forceOurs","workspaceOnly","skipDependencyInstallation","undefined","red","syncConfigFromMain","laneId","legacyScope","scope","repo","objects","mainLaneId","getDefaultLaneId","currentLane","getCurrentLane","workspaceIds","listIds","syncedIds","laneComp","components","modelComponent","getModelComponent","mainHead","head","laneHead","isEqual","divergeData","getDivergeData","sourceHead","targetHead","throws","isTargetAhead","isDiverged","currentVersion","loadVersion","otherVersion","baseSnap","commonSnapBeforeDiverge","baseVersion","configMerger","ComponentConfigMerger","toStringWithoutVersion","extensions","mergedConfig","merge","getSuccessfullyMergedConfig","filterDeletedDependenciesFromConfig","unmergedComponents","removeComponent","addEntry","name","fullName","join","write","clearAllComponentsCache","mergeConfig","policy","DependencyResolverAspect","depType","filtered","dep","version","isBranchBehindDefaultBranch","defaultRefSha","revparse","headSha","mergeBase","err","verifyWorkspaceStatus","list","build","throwErrorsIfExist","snapPrCommit","laneIdStr","dryRun","keepLane","originalLane","parseLaneId","import","ids","installNpmPackages","writeConfigFiles","catch","snapAndExportReusingLane","snapAndExportWithTempLane","existingLanes","getLanes","remote","laneExists","foundErr","switchErr","switchedLane","landedOnLane","errMsg","isStaleLane","staleHash","hash","recheck","currentRemoteHash","remoteChanged","removeLanes","force","msg","localLane","loadLane","moveObjectsToTrash","resetErr","afterReset","createLaneResult","createLane","forkLaneNewScope","results","snap","exitOnFirstFailedTask","snappedComponents","snapOutput","snapResultOutput","exportWithAdoptOnConflict","targetLane","skipNpmInstall","cleanupErr","consoleWarning","tempLaneName","generateRandomStr","renamedToFinalName","archiveResult","archiveLane","stillExists","verifyErr","rename","exportResults","exportWithRetryOnLaneHashMismatch","componentsIds","tempLaneFullName","export","isLaneHashMismatch","isComponentDivergence","cause","snappedHeads","map","c","Ref","from","rebaseOntoRemoteLane","exportWithBusyRetry","maxAttempts","isBusyErr","lastErr","attempt","Promise","resolve","setTimeout","remoteLane","fetchLaneWithItsComponents","remoteComp","find","isEqualWithoutVersion","remoteHead","load","parents","some","p","beforeParents","afterParents","add","versionHistory","updateRebasedVersionHistory","updatedComponents","s","setLaneComponents","hasChanged","saveLane","saveLaneHistory","persist","consumer","setCurrentLane","bitMap","mergePr","argMessage","releaseType","preReleaseId","incrementBy","explicitVersionBump","verbose","versionsFile","autoMergeResolve","forceTheirs","skipPush","noBitmapCommit","initialCommitSha","laneComponents","changedIds","resetLaneComponentsToNew","changedIdsList","ComponentIdList","fromArray","removeMany","clearCache","gitStatus","hasChanges","files","stash","pull","importCurrentObjects","checkoutProps","mergeStrategy","checkoutResults","reportToString","checkoutOutput","restoreLaneConfigChanges","workspaceConfigUpdateResult","workspaceDepsConflicts","workspaceConfigConflictWriteError","bold","gray","leftUnresolvedConflicts","componentsWithConflicts","filesStatus","values","conflictedComponentIds","hasSoftTaggedComponents","softTaggedComponents","finalReleaseType","determineReleaseType","tagResults","tag","failFast","tagOutput","tagResultOutput","hasTaggedComponents","taggedComponents","exportResult","commitAndPushBitmapChanges","performLaneCleanup","addConfig","statusBeforeCommit","file","working_dir","index","diff","error","statusAfterCommit","activeComponents","isDeleted","laneVersion","laneConfig","toConfigObject","mainConfig","modelComp","getModelComponentIfExist","changeVersion","getHead","mainVersion","aspectId","entries","updated","addComponentConfig","explicitLaneName","sourceBranchDetector","SourceBranchDetector","sourceBranchName","getSourceBranchName","isHashMismatchErr","archiveErr","throwOnError","lastCommit","detectedReleaseType","exports","MainRuntime","CLIAspect","WorkspaceAspect","LoggerAspect","BuilderAspect","StatusAspect","LanesAspect","SnappingAspect","ExportAspect","ImporterAspect","CheckoutAspect","addRuntime"],"sources":["ci.main.runtime.ts"],"sourcesContent":["import type { RuntimeDefinition } from '@teambit/harmony';\nimport { CLIAspect, type CLIMain, MainRuntime } from '@teambit/cli';\nimport { LoggerAspect, type LoggerMain, type Logger } from '@teambit/logger';\nimport { WorkspaceAspect, type Workspace } from '@teambit/workspace';\nimport { BuilderAspect, type BuilderMain } from '@teambit/builder';\nimport { StatusAspect, type StatusMain } from '@teambit/status';\nimport { LanesAspect } from '@teambit/lanes';\nimport type { SwitchLaneOptions, LanesMain } from '@teambit/lanes';\nimport { SnappingAspect, tagResultOutput, snapResultOutput } from '@teambit/snapping';\nimport type { SnapResults, SnappingMain } from '@teambit/snapping';\nimport { ExportAspect, type ExportMain } from '@teambit/export';\nimport { ImporterAspect, type ImporterMain } from '@teambit/importer';\nimport { CheckoutAspect, checkoutOutput, type CheckoutMain } from '@teambit/checkout';\nimport type { MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { getDivergeData } from '@teambit/component.snap-distance';\nimport { ComponentConfigMerger } from '@teambit/config-merger';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport execa from 'execa';\nimport chalk from 'chalk';\nimport type { ReleaseType } from 'semver';\nimport { CiAspect } from './ci.aspect';\nimport { CiCmd } from './ci.cmd';\nimport { CiVerifyCmd } from './commands/verify.cmd';\nimport { CiPrCmd } from './commands/pr.cmd';\nimport { CiMergeCmd } from './commands/merge.cmd';\nimport { git } from './git';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { ComponentID } from '@teambit/component-id';\nimport { isEqual } from 'lodash';\nimport type { Version, LaneComponent, Lane } from '@teambit/objects';\nimport { Ref } from '@teambit/objects';\nimport type { LaneId } from '@teambit/lane-id';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { SourceBranchDetector } from './source-branch-detector';\nimport { generateRandomStr } from '@teambit/toolbox.string.random';\n\n// Two distinct conflicts can surface from the remote on a concurrent `bit ci pr` race.\n// LANE_HASH_MISMATCH fires when both runners called `Lane.create` (the lane didn't exist on\n// the remote yet), so they each minted a random `sha1(v4())` hash — `sources.mergeLane` then\n// rejects the second push's lane object on hash mismatch.\n// COMPONENT_DIVERGENCE fires when the lane already exists (both runners `switchToLane`'d\n// and got the same lane hash) but they both snapped the SAME component with DIFFERENT\n// content — `mergeLane`'s per-component diverge check collects a `ComponentNeedsUpdate`\n// and throws `MergeConflictOnRemote(\"merge error occurred when exporting the component(s)…\")`.\n// Both recover through the same adopt-and-rebase path in `rebaseOntoRemoteLane`.\nconst LANE_HASH_MISMATCH_MARKER = 'a lane with the same id already exists with a different hash';\nconst COMPONENT_DIVERGENCE_MARKER = 'merge error occurred when exporting';\nexport interface CiWorkspaceConfig {\n /**\n * Path to a custom script that generates commit messages for `bit ci merge` operations.\n * The script will be executed when components are tagged and committed to the repository.\n * If not specified, falls back to the default commit message:\n * \"chore: update .bitmap and lockfiles as needed [skip ci]\"\n *\n * @example\n * ```json\n * {\n * \"teambit.git/ci\": {\n * \"commitMessageScript\": \"node scripts/generate-commit-message.js\"\n * }\n * }\n * ```\n */\n commitMessageScript?: string;\n\n /**\n * Enables automatic version bump detection from conventional commit messages.\n * When enabled, the system analyzes commit messages to determine the appropriate version bump:\n * - `feat!:` or `BREAKING CHANGE` → major version bump\n * - `feat:` → minor version bump\n * - `fix:` → patch version bump\n *\n * Only applies when no explicit version flags (--patch, --minor, --major) are provided.\n *\n * @default false\n * @example\n * ```json\n * {\n * \"teambit.git/ci\": {\n * \"useConventionalCommitsForVersionBump\": true\n * }\n * }\n * ```\n */\n useConventionalCommitsForVersionBump?: boolean;\n\n /**\n * Enables detection of explicit version bump keywords in commit messages.\n * When enabled, the system looks for these keywords in commit messages:\n * - `BIT-BUMP-MAJOR` → major version bump\n * - `BIT-BUMP-MINOR` → minor version bump\n *\n * These keywords have higher priority than conventional commits parsing.\n * Only applies when no explicit version flags are provided.\n *\n * @default true\n * @example\n * ```json\n * {\n * \"teambit.git/ci\": {\n * \"useExplicitBumpKeywords\": true\n * }\n * }\n * ```\n */\n useExplicitBumpKeywords?: boolean;\n}\n\nexport class CiMain {\n static runtime = MainRuntime as RuntimeDefinition;\n\n static dependencies: any = [\n CLIAspect,\n WorkspaceAspect,\n LoggerAspect,\n BuilderAspect,\n StatusAspect,\n LanesAspect,\n SnappingAspect,\n ExportAspect,\n ImporterAspect,\n CheckoutAspect,\n ];\n\n static slots: any = [];\n\n constructor(\n private workspace: Workspace,\n\n private builder: BuilderMain,\n\n private status: StatusMain,\n\n private lanes: LanesMain,\n\n private snapping: SnappingMain,\n\n private exporter: ExportMain,\n\n private importer: ImporterMain,\n\n private checkout: CheckoutMain,\n\n private logger: Logger,\n\n private config: CiWorkspaceConfig\n ) {}\n\n static async provider(\n [cli, workspace, loggerAspect, builder, status, lanes, snapping, exporter, importer, checkout]: [\n CLIMain,\n Workspace,\n LoggerMain,\n BuilderMain,\n StatusMain,\n LanesMain,\n SnappingMain,\n ExportMain,\n ImporterMain,\n CheckoutMain,\n ],\n config: CiWorkspaceConfig\n ) {\n const logger = loggerAspect.createLogger(CiAspect.id);\n const ci = new CiMain(workspace, builder, status, lanes, snapping, exporter, importer, checkout, logger, config);\n const ciCmd = new CiCmd(workspace, logger);\n ciCmd.commands = [\n new CiVerifyCmd(workspace, logger, ci),\n new CiPrCmd(workspace, logger, ci),\n new CiMergeCmd(workspace, logger, ci),\n ];\n cli.register(ciCmd);\n\n return ci;\n }\n\n async getBranchName() {\n try {\n // if we are running on github, use the GITHUB_HEAD_REF env var\n if (process.env.GITHUB_HEAD_REF) return process.env.GITHUB_HEAD_REF;\n\n const branch = await git.branch();\n return branch.current;\n } catch (e: any) {\n throw new Error(`Unable to read branch: ${e.toString()}`);\n }\n }\n\n /**\n * Converts a branch name to a lane ID string using Bit's naming conventions.\n * Sanitizes branch name by replacing slashes and dots with dashes, converting to lowercase, then\n * prefixes with the workspace's default scope.\n *\n * @param branchName - The git branch name to convert\n * @returns Lane ID in format: {defaultScope}/{sanitizedBranch}\n * @example convertBranchToLaneId(\"feature/New-Component\") => \"my-scope/feature-new-component\"\n */\n convertBranchToLaneId(branchName: string): string {\n // Sanitize branch name to make it valid for Bit lane IDs by replacing slashes and dots with dashes\n // and converting to lowercase\n const sanitizedBranch = branchName.replace(/[/.]/g, '-').toLowerCase();\n return `${this.workspace.defaultScope}/${sanitizedBranch}`;\n }\n\n async getDefaultBranchName() {\n try {\n // Try to get the default branch from git symbolic-ref\n const result = await git.raw(['symbolic-ref', 'refs/remotes/origin/HEAD']);\n const defaultBranch = result.trim().split('/').pop();\n return defaultBranch || 'master';\n } catch (e: any) {\n // Fallback to common default branch names\n try {\n const branches = await git.branch(['-r']);\n if (branches.all.includes('origin/main')) return 'main';\n if (branches.all.includes('origin/master')) return 'master';\n return 'master'; // Final fallback\n } catch {\n this.logger.console(chalk.yellow(`Unable to detect default branch, using 'master': ${e.toString()}`));\n return 'master';\n }\n }\n }\n\n async getGitCommitMessage() {\n try {\n const commit = await git.log({\n maxCount: 1,\n });\n if (!commit.latest) {\n return null;\n }\n const { message, body } = commit.latest;\n return body ? `${message}\\n\\n${body}` : message;\n } catch (e: any) {\n throw new Error(`Unable to read commit message: ${e.toString()}`);\n }\n }\n\n private parseVersionBumpFromCommit(commitMessage: string): ReleaseType | null {\n // Check explicit bump keywords (highest priority after env vars)\n if (this.config.useExplicitBumpKeywords !== false) {\n // default to true\n if (commitMessage.includes('BIT-BUMP-MAJOR')) {\n this.logger.console(chalk.blue('Found BIT-BUMP-MAJOR keyword in commit message'));\n return 'major';\n }\n if (commitMessage.includes('BIT-BUMP-MINOR')) {\n this.logger.console(chalk.blue('Found BIT-BUMP-MINOR keyword in commit message'));\n return 'minor';\n }\n }\n\n // Check conventional commits if enabled\n if (this.config.useConventionalCommitsForVersionBump) {\n // Check for breaking changes (major version bump)\n if (/^feat!(\\(.+\\))?:|^fix!(\\(.+\\))?:|BREAKING CHANGE/m.test(commitMessage)) {\n this.logger.console(chalk.blue('Found breaking changes in commit message (conventional commits)'));\n return 'major';\n }\n\n // Check for features (minor version bump)\n if (/^feat(\\(.+\\))?:/m.test(commitMessage)) {\n this.logger.console(chalk.blue('Found feature commits (conventional commits)'));\n return 'minor';\n }\n\n // Check for fixes (patch version bump) - explicit patch not needed as it's default\n if (/^fix(\\(.+\\))?:/m.test(commitMessage)) {\n this.logger.console(chalk.blue('Found fix commits (conventional commits) - using default patch'));\n return 'patch';\n }\n }\n\n return null; // No specific version bump detected\n }\n\n private async getCustomCommitMessage() {\n try {\n const commitMessageScript = this.config.commitMessageScript;\n\n if (commitMessageScript) {\n this.logger.console(chalk.blue(`Running custom commit message script: ${commitMessageScript}`));\n\n // Parse the command to avoid shell injection\n const parts = commitMessageScript.split(' ');\n const command = parts[0];\n const args = parts.slice(1);\n\n const result = await execa(command, args, {\n cwd: this.workspace.path,\n encoding: 'utf8',\n });\n const customMessage = result.stdout.trim();\n\n if (customMessage) {\n this.logger.console(chalk.green(`Using custom commit message: ${customMessage}`));\n return customMessage;\n }\n }\n } catch (e: any) {\n this.logger.console(chalk.yellow(`Failed to run custom commit message script: ${e.toString()}`));\n }\n\n // Fallback to default message\n return 'chore: update .bitmap and lockfiles as needed [skip ci]';\n }\n\n private async verifyWorkspaceStatusInternal(strict: boolean = false) {\n this.logger.console('📊 Workspace Status');\n this.logger.console(chalk.blue('Verifying status of workspace'));\n\n const status = await this.status.status({ lanes: true });\n const { data: statusOutput, code } = await this.status.formatStatusOutput(\n status,\n strict\n ? { strict: true, warnings: true } // When strict=true, fail on both errors and warnings\n : { failOnError: true, warnings: false } // By default, fail only on errors (tag blockers)\n );\n\n // Log the formatted status output\n this.logger.console(statusOutput);\n\n if (code !== 0) {\n throw new Error('Workspace status verification failed');\n }\n\n this.logger.consoleSuccess(chalk.green('Workspace status is correct'));\n return { status };\n }\n\n /**\n * Returns the caught Error on failure, or undefined on success (including the \"already checked\n * out\" no-op case). Callers that need to react to a specific failure mode (e.g. stale lane) can\n * inspect the returned error; existing callers ignore it and rely on a follow-up\n * `getCurrentLane()` check.\n */\n private async switchToLane(laneName: string, options: SwitchLaneOptions = {}): Promise<Error | undefined> {\n this.logger.console(chalk.blue(`Switching to ${laneName}`));\n try {\n await this.lanes.switchLanes(laneName, {\n forceOurs: true,\n workspaceOnly: true,\n skipDependencyInstallation: true,\n ...options,\n });\n } catch (e: any) {\n if (e?.toString().includes('already checked out')) {\n this.logger.console(chalk.yellow(`Lane ${laneName} already checked out, skipping checkout`));\n return undefined;\n }\n this.logger.console(chalk.red(`Failed switching to ${laneName}: ${e?.toString() ?? e}`));\n return e;\n }\n return undefined;\n }\n\n /**\n * Sync *config-only* changes from main onto the lane — without a full `bit lane merge`.\n *\n * In this workflow git is the source of truth for files: the PR author merges the default branch\n * into their PR branch, so source changes arrive via git. The one thing git can't carry is\n * config that's already been *tagged into objects* on main — e.g. another PR ran `bit env set` /\n * `bit deps set`; those records lived in `.bitmap`, rode git into main, and `bit ci merge` baked\n * them into the component's Version (clearing them from `.bitmap`). A long-running PR's lane\n * would otherwise miss them.\n *\n * A full lane merge is the wrong tool here: it does a 3-way *file* merge and refuses to run while\n * the workspace has modified components — but in `bit ci pr` the workspace is always dirty (the\n * PR's changes, not yet snapped). So instead we do a per-component 3-way merge of the aspect\n * *config only* (base = common ancestor, ours = lane, theirs = main), keeping the PR's config on\n * conflict, and stash the result on an `unmergedComponents` entry's `mergedConfig`. The\n * subsequent `snap` reads it (via the aspects-merger on component load) and bakes main's config\n * into the new snap, while the snap's files still come from the workspace (git). No file\n * checkout, so no clean-workspace requirement.\n */\n private async syncConfigFromMain(laneId: LaneId) {\n const legacyScope = this.workspace.scope.legacyScope;\n const repo = legacyScope.objects;\n const mainLaneId = this.lanes.getDefaultLaneId();\n const currentLane = await this.lanes.getCurrentLane();\n if (!currentLane) return;\n const workspaceIds = this.workspace.listIds();\n\n this.logger.console(chalk.blue(`Syncing config changes from ${mainLaneId.toString()} into ${laneId.toString()}`));\n\n const syncedIds: ComponentID[] = [];\n for (const laneComp of currentLane.components) {\n try {\n const modelComponent = await legacyScope.getModelComponent(laneComp.id);\n const mainHead = modelComponent.head; // the component's head on main\n if (!mainHead) continue; // component isn't on main — nothing to sync from there\n const laneHead = laneComp.head;\n if (mainHead.isEqual(laneHead)) continue; // lane already points at main's head\n\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: laneHead,\n targetHead: mainHead,\n throws: false,\n });\n // Only sync when main has snaps the lane doesn't (target ahead, or diverged). If the lane\n // is ahead-only / equal there's nothing on main to bring in.\n if (!divergeData.isTargetAhead() && !divergeData.isDiverged()) continue;\n\n const currentVersion = await modelComponent.loadVersion(laneHead.toString(), repo);\n const otherVersion = await modelComponent.loadVersion(mainHead.toString(), repo);\n // base = common ancestor. When the lane is strictly behind main (no divergence) the common\n // ancestor IS the lane head, so the lane's own aspects serve as the base.\n const baseSnap = divergeData.commonSnapBeforeDiverge;\n const baseVersion = baseSnap ? await modelComponent.loadVersion(baseSnap.toString(), repo) : currentVersion;\n\n const configMerger = new ComponentConfigMerger(\n laneComp.id.toStringWithoutVersion(),\n workspaceIds,\n undefined, // merging from main (the default lane) — there's no Lane object for it\n currentVersion.extensions,\n baseVersion.extensions,\n otherVersion.extensions,\n laneId.toString(),\n mainLaneId.toString(),\n this.logger,\n 'ours' as MergeStrategy // keep the PR's config on a genuine conflict\n );\n const mergedConfig = configMerger.merge().getSuccessfullyMergedConfig();\n if (!mergedConfig || !Object.keys(mergedConfig).length) continue;\n\n // Strip dependency deletion markers (version: '-'); the aspects-merger applies mergedConfig\n // as-is, so a leftover '-' would land in the policy.\n this.filterDeletedDependenciesFromConfig(mergedConfig);\n\n // Upsert: addEntry throws if an entry for this component already exists. A prior\n // --keep-lane run that crashed mid-snap (or otherwise left unmerged.json entries behind)\n // would otherwise make every later run throw here, skip the component, and keep serving\n // stale config. Remove any existing entry first so repeated runs converge on main's latest.\n legacyScope.objects.unmergedComponents.removeComponent(laneComp.id);\n legacyScope.objects.unmergedComponents.addEntry({\n id: { scope: laneComp.id.scope, name: laneComp.id.fullName },\n head: mainHead,\n laneId: mainLaneId,\n mergedConfig,\n });\n syncedIds.push(laneComp.id);\n this.logger.console(\n chalk.blue(\n ` ${laneComp.id.toStringWithoutVersion()}: applying main's config (${Object.keys(mergedConfig).join(', ')})`\n )\n );\n } catch (e: any) {\n // Best-effort per component: one component's config-merge quirk shouldn't abort the whole\n // `bit ci pr`. Log and move on — the build just won't reflect that component's main-side\n // config this run.\n this.logger.console(\n chalk.yellow(` ${laneComp.id.toStringWithoutVersion()}: skipping config sync from main (${e?.message || e})`)\n );\n }\n }\n\n if (!syncedIds.length) {\n this.logger.console(chalk.blue('No config changes from main to sync'));\n return;\n }\n await legacyScope.objects.unmergedComponents.write();\n // The components were already loaded (and their aspects cached) earlier in this run, before the\n // unmergedComponents entries existed. Clear the cache so the upcoming `snap` reloads them and\n // the aspects-merger folds in the synced `mergedConfig`.\n this.workspace.clearAllComponentsCache();\n this.logger.console(chalk.green(`Synced config from main for ${syncedIds.length} component(s)`));\n }\n\n /**\n * Copied from `merging.main.runtime` (`filterDeletedDependenciesFromConfig`): the config merge\n * can emit deletion markers (`version: '-'`) for deps removed on main. The aspects-merger applies\n * `mergedConfig` verbatim, so strip those here to avoid writing a policy entry with version '-'.\n */\n private filterDeletedDependenciesFromConfig(mergeConfig?: Record<string, any>): void {\n const policy: Record<string, Array<{ version?: string }>> | undefined =\n mergeConfig?.[DependencyResolverAspect.id]?.policy;\n if (!policy) return;\n Object.keys(policy).forEach((depType) => {\n const filtered = policy[depType].filter((dep) => dep.version !== '-');\n if (filtered.length === 0) delete policy[depType];\n else policy[depType] = filtered;\n });\n }\n\n /**\n * Best-effort, fetch-free check for whether the current (PR) branch is *behind* the default\n * branch — i.e. the default branch has commits the PR branch doesn't contain.\n *\n * We intentionally do NOT `git fetch` here (a fetch in CI can hang on an interactive SSH\n * host-key prompt — that's why `isStaleCiRun` was removed in #10300). We compare against\n * whatever `origin/<default>` ref the checkout already has, which reflects the state the default\n * branch was in when this CI run started — exactly the reference point we care about.\n *\n * Returns true only when we can *confirm* the branch is behind. If the ref can't be resolved or\n * anything else goes wrong, returns false (treat as \"not behind\" / proceed) so we never silently\n * disable the main→lane config propagation.\n */\n private async isBranchBehindDefaultBranch(): Promise<boolean> {\n try {\n const defaultBranch = await this.getDefaultBranchName();\n const defaultRefSha = (await git.revparse([`refs/remotes/origin/${defaultBranch}`])).trim();\n const headSha = (await git.revparse(['HEAD'])).trim();\n if (defaultRefSha === headSha) return false; // identical → up to date\n // We deliberately do NOT use `merge-base --is-ancestor`: it reports the answer via exit code\n // (0 = ancestor, 1 = not), but simple-git's `raw` resolves rather than rejects on exit code\n // 1, so the \"not an ancestor\" case was silently read as \"is an ancestor\" — the behind check\n // never fired. Instead compute the merge-base and compare: `merge-base(A, B) === A` iff A is\n // an ancestor of B. When origin/<default> is an ancestor of HEAD the PR already contains it\n // (not behind); otherwise the default branch has commits HEAD doesn't (behind).\n const mergeBase = (await git.raw(['merge-base', defaultRefSha, headSha])).trim();\n return mergeBase !== defaultRefSha;\n } catch (err: any) {\n this.logger.console(\n chalk.yellow(\n `Could not determine whether the PR branch is up to date with the default branch ` +\n `(proceeding as if up to date): ${err?.message || err}`\n )\n );\n return false;\n }\n }\n\n async verifyWorkspaceStatus() {\n await this.verifyWorkspaceStatusInternal();\n\n this.logger.console('🔨 Build Process');\n const components = await this.workspace.list();\n\n this.logger.console(chalk.blue(`Building ${components.length} components`));\n\n const build = await this.builder.build(components);\n\n build.throwErrorsIfExist();\n\n this.logger.console(chalk.green('Components built'));\n\n return { code: 0, data: '' };\n }\n\n async snapPrCommit({\n laneIdStr,\n message,\n build,\n strict,\n dryRun,\n keepLane,\n }: {\n laneIdStr: string;\n message: string;\n build: boolean | undefined;\n strict: boolean | undefined;\n dryRun?: boolean;\n keepLane?: boolean;\n }) {\n this.logger.console(chalk.blue(`Lane name: ${laneIdStr}`));\n\n const originalLane = await this.lanes.getCurrentLane();\n\n const laneId = await this.lanes.parseLaneId(laneIdStr);\n\n await this.verifyWorkspaceStatusInternal(strict);\n\n await this.importer\n .import({\n ids: [],\n installNpmPackages: false,\n writeConfigFiles: false,\n })\n .catch((e) => {\n throw new Error(`Failed to import components: ${e.toString()}`);\n });\n\n this.logger.console('🔄 Lane Management');\n\n // `--keep-lane` opts into reusing the same remote lane across subsequent commits to a PR, so\n // the lane's history and any lane-based UI edits on Bit Cloud survive. Without it we use the\n // default, battle-tested flow: snap onto a throwaway temp lane and delete+recreate the final\n // lane at export time (the lane is recreated on every PR commit).\n if (keepLane) {\n return this.snapAndExportReusingLane({ laneId, originalLane, message, build, dryRun });\n }\n return this.snapAndExportWithTempLane({ laneId, originalLane, message, build, dryRun });\n }\n\n /**\n * `--keep-lane` flow: reuse the existing remote lane (or create it on the first run), merge main\n * into it to pick up config changes that landed since the fork, snap, and export with\n * adopt-on-conflict recovery for concurrent CI pushes. The lane object is preserved across PR\n * commits, so its history and lane-based UI edits on Bit Cloud survive.\n */\n private async snapAndExportReusingLane({\n laneId,\n originalLane,\n message,\n build,\n dryRun,\n }: {\n laneId: LaneId;\n originalLane: Lane | undefined;\n message: string;\n build: boolean | undefined;\n dryRun?: boolean;\n }) {\n // Query the remote (by name, to avoid fetching all lanes) so we know whether to reuse or create\n const existingLanes = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name }).catch((e) => {\n if (e.toString().includes('was not found')) return [];\n throw new Error(`Failed to check lane ${laneId.toString()}: ${e.toString()}`);\n });\n const laneExists = existingLanes.length > 0;\n\n let foundErr: Error | undefined;\n try {\n if (laneExists) {\n // Reuse the existing remote lane so that the lane history, lane-based UI edits, and\n // lane-history feature on Bit Cloud all survive across subsequent commits to the same PR.\n // switchToLane fetches the latest lane head from remote.\n this.logger.console(chalk.blue(`Lane ${laneId.toString()} exists on remote, reusing it`));\n const switchErr = await this.switchToLane(laneId.toString());\n // switchToLane returns the caught error (undefined on success). Combine with a\n // current-lane-state probe — comparing BOTH name AND scope, so a same-named lane in a\n // different scope can't masquerade as a successful switch.\n const switchedLane = await this.lanes.getCurrentLane();\n const landedOnLane = switchedLane?.name === laneId.name && switchedLane?.scope === laneId.scope;\n if (landedOnLane) {\n // Sync config-only changes from main onto the lane, so config that was tagged into\n // objects on main since the lane forked (e.g. `bit deps set` / `bit env set` from\n // another PR, not visible via the workspace's git checkout) is reflected on the lane.\n // Source files are git's job — see syncConfigFromMain.\n //\n // BUT only when the PR branch is actually up to date with the default branch. If the PR\n // is behind (hasn't pulled main's latest), its git checkout still reflects the older\n // fork point, so pulling main's newer config onto the lane would desync the lane from\n // the source. The author merges the default branch into their PR in git; the next\n // `bit ci pr` then propagates it here.\n if (await this.isBranchBehindDefaultBranch()) {\n this.logger.console(\n chalk.yellow(\n `PR branch is behind the default branch — skipping config sync from main. ` +\n `Merge or rebase the default branch into your PR to pick up main's latest config.`\n )\n );\n } else {\n await this.syncConfigFromMain(laneId);\n }\n } else {\n // Switch failed even though the remote lane exists. The destructive recovery below\n // (delete the remote lane + recreate fresh) is safe only when the failure is the\n // specific \"stale lane\" pattern — the lane references a ModelComponent the PR has\n // since removed/renamed (`unable to merge lane …, the component … was not found`).\n // For any other failure (transient network blip during fetch, auth error, lane locked\n // by Cloud UI, etc.) destroying lane history would be the wrong response, so we\n // rethrow and let the caller report the real cause.\n const errMsg = switchErr?.toString() ?? '';\n const isStaleLane = errMsg.includes('unable to merge lane');\n if (!isStaleLane) {\n throw new Error(\n `Failed to switch to remote lane ${laneId.toString()}: ${errMsg || '(no error captured)'}. ` +\n `Refusing destructive recovery for this failure class — the error doesn't match the ` +\n `stale-lane marker, so deleting the lane could destroy real history. Investigate or retry.`\n );\n }\n this.logger.console(\n chalk.yellow(\n `Stale remote lane ${laneId.toString()} — switching failed. ` +\n `Deleting it and creating a fresh lane to recover.`\n )\n );\n // Re-check the remote lane's hash immediately before deleting. The central-hub delete\n // API is name-based — there's no compare-and-swap — so two CI jobs racing the same\n // recovery could otherwise have job B delete job A's freshly-recreated lane. By\n // re-fetching here we shrink the TOCTOU window to milliseconds: if A's recreate landed\n // before our re-fetch, the hash changed and we skip the delete entirely. The downstream\n // export then hits the lane-hash mismatch and lands in `exportWithAdoptOnConflict`,\n // which rebases our snaps onto the winner's lane — no destroyed history.\n const staleHash = existingLanes[0]?.hash;\n const recheck = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name }).catch(() => []);\n const currentRemoteHash = recheck[0]?.hash;\n const remoteChanged = staleHash && currentRemoteHash && currentRemoteHash !== staleHash;\n if (remoteChanged) {\n this.logger.console(\n chalk.blue(\n `Remote lane ${laneId.toString()} changed since we first checked (hash ` +\n `${staleHash.slice(0, 9)} → ${currentRemoteHash.slice(0, 9)}) — another concurrent ` +\n `recovery already recreated it. Skipping the delete; export will adopt-on-conflict.`\n )\n );\n } else {\n await this.lanes.removeLanes([laneId.toString()], { remote: true, force: true }).catch((e) => {\n const msg = e?.toString() ?? '';\n // Tolerate the race where another concurrent recovery deleted the lane first — the\n // desired post-condition (lane gone from remote) is already met.\n if (msg.includes('was not found') || msg.includes('not found')) {\n this.logger.console(chalk.blue(`Remote lane ${laneId.toString()} was already gone — proceeding`));\n return;\n }\n throw new Error(`Failed to delete stale remote lane ${laneId.toString()}: ${msg || e}`);\n });\n }\n // switchToLane fetched the remote lane and persisted it into the local scope's lane\n // index (via `importLaneObject` → `legacyScope.lanes.saveLane`) BEFORE the underlying\n // merge failed. Without dropping that local copy here, the upcoming `createLane` would\n // hit the \"lane … already exists\" guard in create-lane.ts. Same trash-the-local-object\n // pattern as `rebaseOntoRemoteLane`.\n const legacyScope = this.workspace.scope.legacyScope;\n const localLane = await legacyScope.loadLane(laneId);\n if (localLane) {\n await legacyScope.objects.moveObjectsToTrash([localLane.hash()]);\n }\n // Reset the workspace's current-lane pointer to main before createLane, so the new lane\n // is forked from main with an empty component list. `createLane` populates new lanes\n // from `consumer.getCurrentLaneObject()` regardless of `forkLaneNewScope` (which only\n // suppresses the cross-scope guard) — if `originalLane` is non-default (a developer\n // running `bit ci pr` from a lane), without this reset the \"fresh\" lane would silently\n // inherit `originalLane`'s components. Check the return value: a silent failure here\n // would defeat the whole point of the reset.\n const resetErr = await this.switchToLane('main');\n const afterReset = await this.lanes.getCurrentLane();\n if (resetErr || afterReset) {\n throw new Error(\n `Failed to reset to main before recreating ${laneId.toString()}: ` +\n `${resetErr?.toString() ?? `(still on lane \"${afterReset?.name}\")`}. ` +\n `Aborting to avoid silently forking the recreated lane from the wrong source.`\n );\n }\n const createLaneResult = await this.lanes.createLane(laneId.name, {\n scope: laneId.scope,\n forkLaneNewScope: true,\n });\n this.logger.console(chalk.blue(`Recreated lane ${laneId.toString()} (hash: ${createLaneResult.hash})`));\n }\n } else {\n this.logger.console(chalk.blue(`Creating lane ${laneId.toString()}`));\n const createLaneResult = await this.lanes.createLane(laneId.name, {\n scope: laneId.scope,\n forkLaneNewScope: true,\n });\n this.logger.console(chalk.blue(`Created lane ${laneId.toString()} (hash: ${createLaneResult.hash})`));\n }\n\n const currentLane = await this.lanes.getCurrentLane();\n this.logger.console(chalk.blue(`Current lane: ${currentLane?.name ?? 'main'}`));\n if (currentLane?.name !== laneId.name) {\n throw new Error(`Expected to be on lane ${laneId.name}, but current lane is ${currentLane?.name ?? 'main'}`);\n }\n\n this.logger.console('📦 Snapping Components');\n const results = await this.snapping.snap({\n message,\n build,\n exitOnFirstFailedTask: true,\n });\n\n if (!results) {\n this.logger.console(chalk.yellow('No changes detected, nothing to snap'));\n return 'No changes detected, nothing to snap';\n }\n\n const { snappedComponents }: SnapResults = results;\n\n const snapOutput = snapResultOutput(results);\n this.logger.console(snapOutput);\n\n if (dryRun) {\n this.logger.console(chalk.yellow('🏃 Dry-run mode: skipping export'));\n this.logger.console(chalk.green(`Snapped ${snappedComponents.length} component(s) successfully`));\n return snapOutput;\n }\n\n this.logger.console(chalk.blue(`Exporting ${snappedComponents.length} components`));\n await this.exportWithAdoptOnConflict(laneId, snappedComponents);\n } catch (e: any) {\n foundErr = e;\n throw e;\n } finally {\n if (foundErr) {\n this.logger.console(chalk.red(`Found error: ${foundErr.message}`));\n }\n // Best-effort cleanup: switch back to the original lane/main. Wrap it so a cleanup\n // failure (failed switch/checkout) only warns instead of throwing out of `finally` and\n // masking the real error from snap/export above (also avoids no-unsafe-finally).\n try {\n this.logger.console('🔄 Cleanup');\n const targetLane = originalLane?.name ?? 'main';\n this.logger.console(chalk.blue(`Switching back to ${targetLane}`));\n\n const currentLane = await this.lanes.getCurrentLane();\n if (currentLane) {\n await this.switchToLane(targetLane);\n } else {\n this.logger.console(chalk.yellow('Already on main, checking out to head'));\n await this.lanes.checkout.checkout({ head: true, skipNpmInstall: true });\n }\n } catch (cleanupErr: any) {\n this.logger.consoleWarning(`Cleanup after PR snap failed: ${cleanupErr.message}`);\n }\n }\n }\n\n /**\n * Default flow: snap onto a uniquely-named temporary lane, then at export time delete any\n * existing remote lane and rename the temp lane to the final name. The temp name minimizes the\n * race window when multiple CI jobs run concurrently on the same branch. Trade-off: the final\n * lane is recreated on every PR commit, so its history and any lane-based UI edits on Bit Cloud\n * don't survive across commits — use `--keep-lane` for that.\n */\n private async snapAndExportWithTempLane({\n laneId,\n originalLane,\n message,\n build,\n dryRun,\n }: {\n laneId: LaneId;\n originalLane: Lane | undefined;\n message: string;\n build: boolean | undefined;\n dryRun?: boolean;\n }) {\n // Use unique temp lane name to avoid race conditions when multiple CI jobs run concurrently\n const tempLaneName = `${laneId.name}-${generateRandomStr(5)}`;\n\n let foundErr: Error | undefined;\n let renamedToFinalName = false;\n try {\n const createLaneResult = await this.lanes.createLane(tempLaneName, {\n scope: laneId.scope,\n forkLaneNewScope: true,\n });\n this.logger.console(\n chalk.blue(`Created temporary lane ${laneId.scope}/${tempLaneName} (hash: ${createLaneResult.hash})`)\n );\n\n const currentLane = await this.lanes.getCurrentLane();\n\n this.logger.console(chalk.blue(`Current lane: ${currentLane?.name ?? 'main'}`));\n\n if (currentLane?.name !== tempLaneName) {\n throw new Error(\n `Expected to be on lane ${tempLaneName} after creation, but current lane is ${currentLane?.name ?? 'main'}`\n );\n }\n\n this.logger.console('📦 Snapping Components');\n const results = await this.snapping.snap({\n message,\n build,\n exitOnFirstFailedTask: true,\n });\n\n if (!results) {\n // No changes to snap - switch back to main and remove the temp lane we created\n this.logger.console(chalk.yellow('No changes detected, removing temporary lane'));\n await this.switchToLane(originalLane?.name ?? 'main');\n await this.lanes.removeLanes([tempLaneName], { remote: false, force: true });\n return 'No changes detected, nothing to snap';\n }\n\n const { snappedComponents }: SnapResults = results;\n\n const snapOutput = snapResultOutput(results);\n this.logger.console(snapOutput);\n\n if (dryRun) {\n this.logger.console(chalk.yellow('🏃 Dry-run mode: skipping export, lane deletion, and rename'));\n this.logger.console(chalk.green(`Snapped ${snappedComponents.length} component(s) successfully`));\n this.logger.console(\n chalk.blue(\n `Temporary lane \"${laneId.scope}/${tempLaneName}\" kept for debugging. Remove it with: bit lane remove ${laneId.scope}/${tempLaneName}`\n )\n );\n return snapOutput;\n }\n\n // Finalize atomically: delete existing lane, rename temp lane, export\n this.logger.console('🔄 Finalizing Lane');\n\n // Check if original lane exists on remote and delete it (query by name to avoid fetching all lanes)\n const existingLanes = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name }).catch((e) => {\n // Lane not found is expected on first run - just means nothing to delete\n if (e.toString().includes('was not found')) {\n return [];\n }\n throw new Error(`Failed to check lane ${laneId.toString()}: ${e.toString()}`);\n });\n\n if (existingLanes.length) {\n this.logger.console(chalk.blue(`Deleting existing remote lane ${laneId.toString()}`));\n const archiveResult = await this.archiveLane(laneId.toString(), true); // throwOnError: delete must succeed before export\n if (archiveResult === 'not-found') {\n // `getLanes` just reported the lane exists, but the delete API says \"not found\". Re-query\n // to confirm. If the lane still shows up, something is off on the remote (delete can't\n // see what list/export can), and retrying will never converge.\n let stillExists;\n try {\n stillExists = await this.lanes.getLanes({ remote: laneId.scope, name: laneId.name });\n } catch (verifyErr: any) {\n throw new Error(\n `failed to verify whether remote lane ${laneId.toString()} still exists after delete returned \"not found\": ${verifyErr?.message || verifyErr}`\n );\n }\n if (stillExists.length) {\n throw new Error(\n `unable to delete remote lane ${laneId.toString()}: the remote reports the lane as \"not found\" from ` +\n `the delete API but still lists it from the query API. maybe this is a remote issue on bit.cloud. ` +\n `please contact support or manually delete the lane on bit.cloud before re-running CI.`\n );\n }\n }\n }\n\n // Rename temp lane to original name\n this.logger.console(chalk.blue(`Renaming lane from ${tempLaneName} to ${laneId.name}`));\n await this.lanes.rename(laneId.name, tempLaneName);\n renamedToFinalName = true;\n\n // Export with the correct name. Retry on hash-mismatch, which indicates a concurrent CI job\n // pushed the same lane id between our pre-export delete and our merge on the hub.\n this.logger.console(chalk.blue(`Exporting ${snappedComponents.length} components`));\n const exportResults = await this.exportWithRetryOnLaneHashMismatch(laneId.toString());\n this.logger.console(chalk.green(`Exported ${exportResults.componentsIds.length} components`));\n } catch (e: any) {\n foundErr = e;\n throw e;\n } finally {\n if (foundErr) {\n this.logger.console(chalk.red(`Found error: ${foundErr.message}`));\n }\n // Always switch back to the original lane\n this.logger.console('🔄 Cleanup');\n const targetLane = originalLane?.name ?? 'main';\n this.logger.console(chalk.blue(`Switching back to ${targetLane}`));\n\n const currentLane = await this.lanes.getCurrentLane();\n if (currentLane) {\n await this.switchToLane(targetLane);\n } else {\n this.logger.console(chalk.yellow('Already on main, checking out to head'));\n await this.lanes.checkout.checkout({ head: true, skipNpmInstall: true });\n }\n\n // Clean up orphaned temporary lane on error. Skip if the rename to the final name already\n // happened - in that case the temp name no longer exists locally, and the lane under the\n // final name may have been partially exported; leave it alone rather than wipe evidence.\n if (foundErr && !renamedToFinalName) {\n const tempLaneFullName = `${laneId.scope}/${tempLaneName}`;\n this.logger.console(chalk.blue(`Cleaning up temporary lane ${tempLaneFullName}`));\n try {\n await this.lanes.removeLanes([tempLaneFullName], { remote: false, force: true });\n this.logger.console(chalk.green(`Removed temporary lane ${tempLaneFullName}`));\n } catch (cleanupErr: any) {\n // Ignore cleanup errors to avoid masking the original error\n this.logger.console(chalk.yellow(`Failed to clean up temporary lane: ${cleanupErr?.message || cleanupErr}`));\n }\n }\n }\n }\n\n /**\n * Export with a recovery path for the two concurrent-CI conflicts that can surface from the\n * remote (see the marker constants at the top of the file): lane-hash mismatch (both runners\n * created fresh lane objects when the lane didn't yet exist on the remote) and per-component\n * divergence (both reused the existing lane but snapped the same component with different\n * content).\n *\n * Recovery: adopt-the-winner. The remote lane (whoever pushed first) becomes canonical. We\n * drop our local lane object, fetch the remote, rebase our snapped Version objects so each\n * one's parent points to the remote head for that component, then swap those rebased Versions\n * in as the new lane heads and re-export. Build artifacts are preserved — only the parent\n * pointers on the Version objects change. Result: both runners' snaps end up chained on a\n * single lane object (last-writer-wins on content for any contested component, with the\n * winner's snap preserved in history as the parent).\n */\n private async exportWithAdoptOnConflict(laneId: LaneId, snappedComponents: ConsumerComponent[]) {\n try {\n const exportResults = await this.exporter.export();\n this.logger.console(chalk.green(`Exported ${exportResults.componentsIds.length} components`));\n return;\n } catch (e: any) {\n const msg = e?.message || e?.toString() || '';\n const isLaneHashMismatch = msg.includes(LANE_HASH_MISMATCH_MARKER);\n const isComponentDivergence = msg.includes(COMPONENT_DIVERGENCE_MARKER);\n if (!isLaneHashMismatch && !isComponentDivergence) throw e;\n const cause = isLaneHashMismatch ? 'Lane hash mismatch' : 'Per-component divergence';\n this.logger.console(\n chalk.yellow(\n `${cause} on \"${laneId.toString()}\" — likely a concurrent CI push. Adopting the remote lane and rebasing local snaps onto its heads.`\n )\n );\n }\n\n const snappedHeads = snappedComponents.map((c) => {\n // A just-snapped component always has a version; guard defensively so a missing one fails\n // with a clear message instead of `Ref.from(undefined)`'s opaque \"hash argument is empty\".\n if (!c.version) {\n throw new Error(\n `unable to recover from the lane-hash mismatch: snapped component \"${c.id.toString()}\" has no version to rebase onto the remote lane`\n );\n }\n return { id: c.id, head: Ref.from(c.version) };\n });\n\n await this.rebaseOntoRemoteLane(laneId, snappedHeads);\n\n this.logger.console(chalk.blue('Retrying export with rebased snaps'));\n const exportResults = await this.exportWithBusyRetry();\n this.logger.console(chalk.green(`Exported ${exportResults.componentsIds.length} components after rebase`));\n }\n\n /**\n * Wrap `exporter.export()` with retry on the \"server is busy\" error. The retried export's\n * pending-dir lands behind whichever concurrent client is still in the remote's queue (we\n * arrived second by definition — we're the loser of the original race). The 60s wait inside\n * `export-validate.waitIfNeeded` covers the common case, but on slow CI hosts or large pushes\n * we sometimes time out before the other client finishes its persist. A short sleep + retry\n * here just gives the queue room to drain.\n */\n private async exportWithBusyRetry(maxAttempts = 3) {\n const isBusyErr = (err: any) => (err?.message || err?.toString() || '').includes('server is busy by other exports');\n let lastErr: any;\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n try {\n return await this.exporter.export();\n } catch (e: any) {\n lastErr = e;\n if (!isBusyErr(e)) throw e;\n this.logger.console(\n chalk.yellow(\n `Export attempt ${attempt}/${maxAttempts} blocked by a busy remote queue. Waiting before retrying.`\n )\n );\n await new Promise((resolve) => setTimeout(resolve, 2000 * attempt));\n }\n }\n throw lastErr;\n }\n\n private async rebaseOntoRemoteLane(laneId: LaneId, snappedHeads: Array<{ id: ComponentID; head: Ref }>) {\n const legacyScope = this.workspace.scope.legacyScope;\n const repo = legacyScope.objects;\n\n // Our local lane object (the one we just snapped onto) shares the LaneId with the remote\n // (winning) lane but has a different, randomly-minted hash. Fetching the remote lane writes it\n // into our scope via `sources.mergeLane`, which rejects a same-id/different-hash lane (\"a lane\n // with the same id already exists with a different hash\") — so we must drop our local lane\n // object BEFORE the fetch, not after. We can't use `lanes.removeLanes` (it refuses to remove\n // the currently-checked-out lane), so we trash the lane object directly; that also removes it\n // from the scope index, so `loadLane` (the guard's lookup) no longer finds it. Only the lane\n // pointer is trashed — the Version objects we snapped stay in the scope for the rebase below,\n // and the fetch immediately re-persists a same-id lane object, satisfying the current-lane\n // workspace pointer again.\n const localLane = await legacyScope.loadLane(laneId);\n if (localLane) {\n this.logger.console(chalk.blue(`Dropping local lane object ${laneId.toString()} to adopt the remote one`));\n await repo.moveObjectsToTrash([localLane.hash()]);\n }\n\n // Fetch the remote (winning) lane and the Version objects it points at. With our local lane\n // object gone, `mergeLane` sees no conflicting same-id lane and persists the remote one.\n this.logger.console(chalk.blue(`Fetching remote lane ${laneId.toString()}`));\n const remoteLane = await this.lanes.fetchLaneWithItsComponents(laneId);\n\n // Rewrite each snapped Version's parent to point at the remote head for that component.\n // Bit's Version objects aren't content-addressed — `_hash` is set once and not derived\n // from content — so we can mutate `parents` in place. The hash stays the same, so the\n // build artifacts referenced from the Version remain valid and the lane's component head\n // doesn't need to be re-pointed. The remote receives the updated Version because our\n // first failed export attempt was rejected during the export-validate step (via\n // `sources.mergeLane`'s same-id/different-hash guard) — *before* `ExportPersist` writes any\n // files to disk — so the remote doesn't yet have this hash and won't dedupe-skip it during\n // transfer.\n for (const snap of snappedHeads) {\n const remoteComp = remoteLane.components.find((c) => c.id.isEqualWithoutVersion(snap.id));\n if (!remoteComp) continue; // component is only on our lane, not on the remote — no rebase target\n const remoteHead = remoteComp.head;\n if (snap.head.isEqual(remoteHead)) continue;\n\n const version = (await repo.load(snap.head)) as Version | undefined;\n if (!version) {\n throw new Error(\n `rebaseOntoRemoteLane: unable to load Version object for ${snap.id.toString()} hash ${snap.head.toString()}`\n );\n }\n if (version.parents.some((p) => p.isEqual(remoteHead))) continue; // already chains correctly\n\n const beforeParents = version.parents.map((p) => p.toString().slice(0, 9)).join(',');\n // Re-point only the lane-lineage parent (the first parent — the predecessor snap on the\n // lane) to the remote head, preserving any additional parents. A snap produced after\n // `syncConfigFromMain` is a merge snap whose second parent links to main's head; overwriting\n // the whole array with `[remoteHead]` would silently drop that merge edge and corrupt the\n // lane's ancestry.\n version.parents = [remoteHead, ...version.parents.slice(1)];\n const afterParents = version.parents.map((p) => p.toString().slice(0, 9)).join(',');\n this.logger.console(\n chalk.blue(\n `Rebasing ${snap.id.toString()}@${snap.head.toString().slice(0, 9)}: parents [${beforeParents}] → [${afterParents}]`\n )\n );\n repo.add(version);\n\n // Keep the local VersionHistory in sync with the rewritten parents. The first (failed)\n // export already traversed and wrote VersionHistory with this version's *original* parent;\n // without this update the re-export's diverge computation reads that stale history, never\n // sees the remote head as an ancestor, and can send the wrong version set or throw a\n // spurious \"no common snap\" error. `updateRebasedVersionHistory` only touches the entry if\n // this version already exists in the history (it does, from that first traversal).\n const modelComponent = await legacyScope.getModelComponent(snap.id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(repo, [version]);\n if (versionHistory) repo.add(versionHistory);\n }\n\n // Replace the remote lane's component heads with our snapped Versions. Anything we\n // didn't snap stays as the remote had it.\n //\n // TODO(stale-runner): if two consecutive PR commits trigger two CI runs and the older one\n // finishes last, it will rebase its (older-content) snap on top of the newer one — the\n // newer commit's snap stays in history but the lane head regresses to the older content.\n // The fix needs git-SHA-aware staleness detection (embed `git rev-parse HEAD` in the snap\n // log on creation, compare against the remote head's stored SHA on rebase, abort if our\n // commit is an ancestor of theirs). The prior `isStaleCiRun` (removed in #10300 for\n // SSH-prompt reasons) attempted this via `git fetch`; we'd want a fetch-free variant here.\n const updatedComponents: LaneComponent[] = remoteLane.components.map((c) => {\n const snap = snappedHeads.find((s) => s.id.isEqualWithoutVersion(c.id));\n return snap ? { ...c, head: snap.head } : c;\n });\n // Pick up any components we snapped that aren't on the remote lane yet (newly added on this PR).\n for (const snap of snappedHeads) {\n if (!updatedComponents.some((c) => c.id.isEqualWithoutVersion(snap.id))) {\n updatedComponents.push({ id: snap.id, head: snap.head });\n }\n }\n remoteLane.setLaneComponents(updatedComponents);\n remoteLane.hasChanged = true;\n await legacyScope.lanes.saveLane(remoteLane, { saveLaneHistory: false });\n\n await repo.persist();\n\n // Make sure the workspace's current-lane pointer points at the lane we just adopted.\n this.workspace.consumer.setCurrentLane(laneId, true);\n await this.workspace.bitMap.write();\n }\n\n async mergePr({\n message: argMessage,\n build,\n strict,\n releaseType,\n preReleaseId,\n incrementBy,\n explicitVersionBump,\n verbose,\n versionsFile,\n autoMergeResolve,\n forceTheirs,\n laneName,\n skipPush,\n noBitmapCommit,\n }: {\n message?: string;\n build?: boolean;\n strict?: boolean;\n releaseType: ReleaseType;\n preReleaseId?: string;\n incrementBy?: number;\n explicitVersionBump?: boolean;\n verbose?: boolean;\n versionsFile?: string;\n autoMergeResolve?: MergeStrategy;\n forceTheirs?: boolean;\n laneName?: string;\n skipPush?: boolean;\n noBitmapCommit?: boolean;\n }) {\n // Capture the initial commit SHA before any operations modify the repository\n const initialCommitSha = await git.revparse(['HEAD']);\n\n const message = argMessage || (await this.getGitCommitMessage());\n if (!message) {\n throw new Error('Failed to get commit message from git. Please provide a message using --message option.');\n }\n\n const currentLane = await this.lanes.getCurrentLane();\n const laneComponents = currentLane?.components;\n if (currentLane) {\n // this doesn't normally happen. we expect this mergePr to be called from the default branch, which normally checks\n // out to main lane.\n this.logger.console(chalk.blue(`Currently on lane ${currentLane.name}, switching to main`));\n await this.switchToLane('main');\n // this is needed to make sure components that were created on the lane are now available on main.\n // without this, the switch to main above, marks those components as not-available, and won't be tagged later on.\n // don't use the high-level `consumer.resetLaneNew()`, because it deletes the entire local scope.\n const changedIds = this.workspace.consumer.bitMap.resetLaneComponentsToNew();\n if (changedIds.length) {\n const changedIdsList = ComponentIdList.fromArray(changedIds);\n await this.workspace.scope.legacyScope.removeMany(changedIdsList, true);\n\n await this.workspace.clearCache();\n await this.workspace.bitMap.write('reset lane new');\n }\n\n this.logger.console(chalk.green('Switched to main lane'));\n }\n\n // Pull latest changes from remote to ensure we have the most up-to-date .bitmap\n // This prevents issues when multiple PRs are merged in sequence\n const defaultBranch = await this.getDefaultBranchName();\n this.logger.console(chalk.blue(`Pulling latest git changes from ${defaultBranch} branch`));\n\n // Check if there are any changes to stash before rebasing\n const gitStatus = await git.status();\n const hasChanges = gitStatus.files.length > 0;\n\n if (hasChanges) {\n this.logger.console(chalk.yellow('Stashing uncommitted changes before rebase'));\n await git.stash(['push', '-u', '-m', 'CI merge temporary stash']);\n }\n\n await git.pull('origin', defaultBranch, { '--rebase': 'true' });\n\n if (hasChanges) {\n this.logger.console(chalk.yellow('Restoring stashed changes after rebase'));\n await git.stash(['pop']);\n }\n\n this.logger.console(chalk.green('Pulled latest git changes'));\n\n this.logger.console('🔄 Checking out to main head');\n await this.importer.importCurrentObjects();\n\n const checkoutProps = {\n forceOurs: !forceTheirs && !autoMergeResolve, // only force ours if neither forceTheirs nor autoMergeResolve is specified\n head: true,\n skipNpmInstall: true,\n ...(forceTheirs && { forceTheirs }),\n ...(autoMergeResolve && { mergeStrategy: autoMergeResolve }),\n };\n const checkoutResults = await this.checkout.checkout(checkoutProps);\n\n await this.workspace.bitMap.write('checkout head');\n this.logger.console(reportToString(checkoutOutput(checkoutResults, checkoutProps)));\n\n if (laneComponents?.length) {\n await this.restoreLaneConfigChanges(laneComponents);\n }\n\n // Check for workspace.jsonc conflicts\n if (\n checkoutResults.workspaceConfigUpdateResult?.workspaceDepsConflicts ||\n checkoutResults.workspaceConfigUpdateResult?.workspaceConfigConflictWriteError\n ) {\n this.logger.console(chalk.red('❌ workspace.jsonc conflicts detected during checkout'));\n this.logger.console(chalk.blue('\\nTo resolve these conflicts, please run:'));\n this.logger.console(chalk.bold(' bit checkout head'));\n this.logger.console(chalk.gray('\\nThis will allow you to manually resolve the conflicts in workspace.jsonc.'));\n\n throw new Error(\n 'Cannot complete CI merge due to workspace.jsonc conflicts. Please run \"bit checkout head\" and fix the conflicts manually.'\n );\n }\n\n // Check for conflicts when using manual merge strategy\n if (autoMergeResolve === 'manual' && checkoutResults.leftUnresolvedConflicts) {\n const componentsWithConflicts =\n checkoutResults.components?.filter(\n (c) => c.filesStatus && Object.values(c.filesStatus).some((status) => status === 'manual')\n ) || [];\n\n const conflictedComponentIds = componentsWithConflicts.map((c) => c.id.toString());\n\n this.logger.console(chalk.red('❌ Merge conflicts detected during checkout'));\n this.logger.console(chalk.yellow('The following components have conflicts:'));\n conflictedComponentIds.forEach((id) => {\n this.logger.console(chalk.yellow(` - ${id}`));\n });\n this.logger.console(chalk.blue('\\nTo resolve these conflicts, please run:'));\n this.logger.console(chalk.bold(' bit checkout head'));\n this.logger.console(chalk.gray('\\nThis will allow you to manually resolve the conflicts.'));\n\n throw new Error(\n 'Cannot complete CI merge due to unresolved conflicts. Please resolve conflicts manually and try again.'\n );\n }\n\n const { status } = await this.verifyWorkspaceStatusInternal(strict);\n\n const hasSoftTaggedComponents = status.softTaggedComponents.length > 0;\n\n this.logger.console('📦 Component Operations');\n this.logger.console(chalk.blue('Tagging components'));\n const finalReleaseType = await this.determineReleaseType(releaseType, explicitVersionBump);\n const tagResults = await this.snapping.tag({\n all: true,\n message,\n build,\n failFast: true,\n persist: hasSoftTaggedComponents,\n releaseType: finalReleaseType,\n preReleaseId,\n incrementBy,\n versionsFile,\n });\n\n if (tagResults) {\n const tagOutput = tagResultOutput(tagResults);\n this.logger.console(tagOutput);\n } else {\n this.logger.console(chalk.yellow('No components to tag'));\n }\n\n const hasTaggedComponents = tagResults?.taggedComponents && tagResults.taggedComponents.length > 0;\n\n if (hasTaggedComponents) {\n this.logger.console(chalk.blue('Exporting components'));\n const exportResult = await this.exporter.export();\n\n if (exportResult.componentsIds.length > 0) {\n this.logger.console(chalk.green(`Exported ${exportResult.componentsIds.length} component(s)`));\n } else {\n this.logger.console(chalk.yellow('Nothing to export'));\n }\n\n if (noBitmapCommit) {\n this.logger.console(\n chalk.yellow(\n 'Skipping bitmap commit (--no-bitmap-commit flag). The new versions are in scope; no git commit will be created on the default branch.'\n )\n );\n this.logger.console(\n chalk.gray(\n 'Developers auto-sync their local .bitmap on the next bit command after `git pull` when `bitmapAutoSync: true` is set in workspace.jsonc.'\n )\n );\n } else {\n await this.commitAndPushBitmapChanges({ verbose, skipPush, defaultBranch });\n }\n } else {\n this.logger.console(chalk.yellow('No components were tagged, skipping export and git operations'));\n }\n\n this.logger.console(chalk.green('Merged PR'));\n\n // Enhanced lane cleanup logic\n await this.performLaneCleanup(currentLane, laneName, initialCommitSha);\n\n return { code: 0, data: '' };\n }\n\n /**\n * Stage every changed file (post-tag/export the bitmap, lockfiles, and any files\n * touched by `bit checkout head` may differ), commit with the configured message,\n * rebase against origin, and push — unless `skipPush` was passed.\n */\n private async commitAndPushBitmapChanges({\n verbose,\n skipPush,\n defaultBranch,\n }: {\n verbose?: boolean;\n skipPush?: boolean;\n defaultBranch: string;\n }) {\n this.logger.console('🔄 Git Operations');\n await git.addConfig('user.email', 'bit-ci[bot]@bit.cloud');\n await git.addConfig('user.name', 'Bit CI');\n\n const statusBeforeCommit = await git.status();\n this.logger.console(chalk.blue(`Git status before commit: ${statusBeforeCommit.files.length} files`));\n statusBeforeCommit.files.forEach((file) => {\n this.logger.console(chalk.gray(` ${file.working_dir}${file.index} ${file.path}`));\n });\n\n if (verbose && statusBeforeCommit.files.length > 0) {\n try {\n const diff = await git.diff();\n if (diff) {\n this.logger.console(chalk.blue('Git diff before commit:'));\n this.logger.console(diff);\n }\n } catch (error) {\n this.logger.console(chalk.yellow(`Failed to show git diff: ${error}`));\n }\n }\n\n // Stage everything: `bit checkout head` earlier in the flow may modify files\n // beyond .bitmap and pnpm-lock.yaml, so a narrow `git add` would miss them.\n await git.add(['.']);\n const commitMessage = await this.getCustomCommitMessage();\n await git.commit(commitMessage);\n\n const statusAfterCommit = await git.status();\n this.logger.console(chalk.blue(`Git status after commit: ${statusAfterCommit.files.length} files`));\n statusAfterCommit.files.forEach((file) => {\n this.logger.console(chalk.gray(` ${file.working_dir}${file.index} ${file.path}`));\n });\n\n await git.pull('origin', defaultBranch, { '--rebase': 'true' });\n if (skipPush) {\n this.logger.console(chalk.yellow('Skipping git push (--skip-push flag)'));\n return;\n }\n await git.push('origin', defaultBranch);\n }\n\n /**\n * Compare lane Version extensions with main Version extensions for each component.\n * Any config differences (e.g. env-set, deps-set) are saved to .bitmap so they survive\n * the switch from lane to main and get included in the subsequent tag.\n */\n private async restoreLaneConfigChanges(laneComponents: LaneComponent[]) {\n const scope = this.workspace.scope.legacyScope;\n const repo = scope.objects;\n let hasChanges = false;\n\n const activeComponents = laneComponents.filter((c) => !c.isDeleted);\n await Promise.all(\n activeComponents.map(async (laneComp) => {\n const laneVersion = (await repo.load(laneComp.head)) as Version;\n if (!laneVersion) {\n this.logger.console(chalk.yellow(`Warning: could not load Version object for ${laneComp.id.toString()}`));\n return;\n }\n\n const laneConfig = laneVersion.extensions.toConfigObject();\n if (!laneConfig || Object.keys(laneConfig).length === 0) return;\n\n // Get main Version for comparison\n let mainConfig: Record<string, any> = {};\n const modelComp = await scope.getModelComponentIfExist(laneComp.id.changeVersion(undefined));\n const mainHead = modelComp?.getHead();\n if (mainHead) {\n const mainVersion = (await repo.load(mainHead)) as Version;\n mainConfig = mainVersion?.extensions.toConfigObject() ?? {};\n }\n\n for (const [aspectId, config] of Object.entries(laneConfig)) {\n if (!isEqual(config, mainConfig[aspectId])) {\n const updated = this.workspace.bitMap.addComponentConfig(\n laneComp.id,\n aspectId,\n config as Record<string, any>\n );\n if (updated) hasChanges = true;\n }\n }\n })\n );\n\n if (hasChanges) {\n await this.workspace.bitMap.write('restore lane config');\n await this.workspace.clearCache();\n this.logger.console(chalk.blue('Restored config changes from lane'));\n }\n }\n\n /**\n * Performs lane cleanup by attempting to detect and delete the source lane\n * after a successful merge, even when running on the main branch\n */\n private async performLaneCleanup(currentLane: any, explicitLaneName?: string, initialCommitSha?: string) {\n this.logger.console('🗑️ Lane Cleanup');\n\n // If we already have a current lane, use it\n if (currentLane) {\n this.logger.console(chalk.blue(`Found current lane: ${currentLane.name}`));\n const laneId = currentLane.id();\n await this.archiveLane(laneId.toString());\n return;\n }\n\n // If no current lane but explicit lane name provided, try to delete it\n if (explicitLaneName) {\n this.logger.console(chalk.blue(`Using explicitly provided lane name: ${explicitLaneName}`));\n try {\n const laneId = await this.lanes.parseLaneId(explicitLaneName);\n await this.archiveLane(laneId.toString());\n return;\n } catch (e: any) {\n this.logger.console(chalk.yellow(`Failed to parse lane name '${explicitLaneName}': ${e.message}`));\n }\n }\n\n // Try to auto-detect source branch/lane name using the dedicated detector\n const sourceBranchDetector = new SourceBranchDetector(this.logger);\n const sourceBranchName = await sourceBranchDetector.getSourceBranchName(initialCommitSha);\n if (!sourceBranchName) {\n this.logger.console(chalk.yellow('No current lane and unable to detect source branch - skipping lane cleanup'));\n return;\n }\n try {\n const laneIdStr = this.convertBranchToLaneId(sourceBranchName);\n\n this.logger.console(\n chalk.blue(`Attempting to delete lane based on source branch: ${sourceBranchName} -> ${laneIdStr}`)\n );\n\n const laneId = await this.lanes.parseLaneId(laneIdStr);\n await this.archiveLane(laneId.toString());\n } catch (e: any) {\n this.logger.console(\n chalk.yellow(`Error during lane cleanup for source branch '${sourceBranchName}': ${e.message}`)\n );\n }\n }\n\n /**\n * Export with retry on lane hash-mismatch, caused by a concurrent `bit ci pr` run pushing the\n * same lane id between our pre-export delete and the hub's merge (the export takes 1-2 minutes,\n * plenty of time to race). Used by the default (temp-lane) flow. On mismatch we delete the\n * remote lane and retry — the temp-lane flow recreates the lane on every run anyway, so there's\n * no lane history to preserve. (The `--keep-lane` flow instead adopts the remote lane and\n * rebases onto it; see `exportWithAdoptOnConflict`.)\n */\n private async exportWithRetryOnLaneHashMismatch(laneIdStr: string, maxAttempts = 3) {\n const isHashMismatchErr = (err: any) => (err?.message || err?.toString() || '').includes(LANE_HASH_MISMATCH_MARKER);\n\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n try {\n return await this.exporter.export();\n } catch (e: any) {\n if (!isHashMismatchErr(e) || attempt === maxAttempts) throw e;\n this.logger.console(\n chalk.yellow(\n `Export attempt ${attempt}/${maxAttempts} failed with lane hash mismatch on \"${laneIdStr}\" (likely a concurrent CI push). Deleting remote lane and retrying.`\n )\n );\n try {\n await this.archiveLane(laneIdStr, true);\n } catch (archiveErr: any) {\n // Preserve the original export error - rethrowing the archive error would hide the real\n // reason the push was rejected.\n this.logger.console(\n chalk.yellow(\n `Failed to delete remote lane \"${laneIdStr}\" while recovering from hash mismatch: ${archiveErr?.message || archiveErr}. Rethrowing the original export error.`\n )\n );\n if (e && typeof e === 'object' && (e as any).cause == null) {\n (e as any).cause = archiveErr;\n }\n throw e;\n }\n }\n }\n throw new Error(`exportWithRetryOnLaneHashMismatch: exhausted ${maxAttempts} attempts for lane ${laneIdStr}`);\n }\n\n /**\n * Archives (deletes) a lane with proper error handling and logging.\n * @param throwOnError - if true, throws on failure (use for critical operations like pre-export cleanup)\n */\n private async archiveLane(laneId: string, throwOnError = false): Promise<'deleted' | 'not-found' | 'error'> {\n try {\n this.logger.console(chalk.blue(`Archiving lane ${laneId}`));\n // force means to remove the lane even if it was not merged. in this case, we don't care much because main already has the changes.\n const archiveLane = await this.lanes.removeLanes([laneId], { remote: true, force: true });\n if (archiveLane.length) {\n this.logger.console(chalk.green(`Lane '${laneId}' archived successfully`));\n return 'deleted';\n }\n this.logger.console(chalk.yellow(`Failed to archive lane '${laneId}' - no lanes were removed`));\n return 'not-found';\n } catch (e: any) {\n if (e.message?.includes('was not found') || e.toString().includes('was not found')) {\n this.logger.console(chalk.yellow(`Lane '${laneId}' was not found on the remote`));\n return 'not-found';\n }\n this.logger.console(chalk.red(`Error archiving lane '${laneId}': ${e.message}`));\n if (throwOnError) {\n throw new Error(`Failed to delete remote lane '${laneId}': ${e.message}`);\n }\n return 'error';\n // Don't throw the error - lane cleanup is not critical to the merge process\n }\n }\n\n /**\n * Auto-detect version bump from commit messages if no explicit version bump was provided\n */\n private async determineReleaseType(releaseType: ReleaseType, explicitVersionBump?: boolean): Promise<ReleaseType> {\n if (explicitVersionBump) {\n this.logger.console(chalk.blue(`Using explicit version bump: ${releaseType}`));\n return releaseType;\n }\n // Only auto-detect if user didn't specify any version flags\n const lastCommit = await this.getGitCommitMessage();\n if (!lastCommit) {\n this.logger.console(chalk.blue('No commit message found, using default patch'));\n return releaseType;\n }\n const detectedReleaseType = this.parseVersionBumpFromCommit(lastCommit);\n if (detectedReleaseType) {\n this.logger.console(chalk.green(`Auto-detected version bump: ${detectedReleaseType}`));\n return detectedReleaseType;\n }\n this.logger.console(chalk.blue('No specific version bump detected, using default patch'));\n return releaseType;\n }\n}\n\nfunction reportToString(result: string | { data: string }): string {\n return typeof result === 'string' ? result : result.data;\n}\n\nCiAspect.addRuntime(CiMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,UAAA;EAAA,MAAAT,IAAA,G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ACpB;IACA,MAAMuF,mBAAmB,GAAG,IAAI,CAACzS,0BAA0B,CAACwS,UAAU,CAAC;IACvE,IAAIC,mBAAmB,EAAE;MACvB,IAAI,CAAC5V,MAAM,CAACyC,OAAO,CAACC,gBAAK,CAAC2B,KAAK,CAAC,+BAA+BuR,mBAAmB,EAAE,CAAC,CAAC;MACtF,OAAOA,mBAAmB;IAC5B;IACA,IAAI,CAAC5V,MAAM,CAACyC,OAAO,CAACC,gBAAK,CAACY,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACzF,OAAO+M,WAAW;EACpB;AACF;AAACwF,OAAA,CAAAvW,MAAA,GAAAA,MAAA;AAAAlB,eAAA,CAl9CYkB,MAAM,aACAwW,kBAAW;AAAA1X,eAAA,CADjBkB,MAAM,kBAGU,CACzByW,gBAAS,EACTC,4BAAe,EACfC,sBAAY,EACZC,wBAAa,EACbC,sBAAY,EACZC,oBAAW,EACXC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,0BAAc,CACf;AAAApY,eAAA,CAdUkB,MAAM,WAgBG,EAAE;AAo8CxB,SAAS2S,cAAcA,CAACjQ,MAAiC,EAAU;EACjE,OAAO,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAAC3G,IAAI;AAC1D;AAEAiF,cAAQ,CAACmW,UAAU,CAACnX,MAAM,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.git_ci@1.0.
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.git_ci@1.0.386/dist/ci.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/ci",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.386",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/git/ci",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.git",
|
|
8
8
|
"name": "ci",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.386"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
"semver": "7.7.1",
|
|
16
16
|
"simple-git": "^3.28.0",
|
|
17
17
|
"@teambit/harmony": "0.4.7",
|
|
18
|
-
"@teambit/cli": "0.0.1328",
|
|
19
|
-
"@teambit/logger": "0.0.1421",
|
|
20
18
|
"@teambit/component-id": "1.2.4",
|
|
21
|
-
"@teambit/component.modules.merge-helper": "0.0.61",
|
|
22
|
-
"@teambit/component.snap-distance": "0.0.119",
|
|
23
19
|
"@teambit/lane-id": "0.0.312",
|
|
24
|
-
"@teambit/legacy.consumer-component": "0.0.119",
|
|
25
20
|
"@teambit/toolbox.string.random": "0.0.14",
|
|
26
21
|
"@teambit/bit-error": "0.0.404",
|
|
27
|
-
"@teambit/
|
|
28
|
-
"@teambit/
|
|
29
|
-
"@teambit/
|
|
30
|
-
"@teambit/
|
|
31
|
-
"@teambit/
|
|
32
|
-
"@teambit/
|
|
33
|
-
"@teambit/
|
|
34
|
-
"@teambit/
|
|
35
|
-
"@teambit/
|
|
36
|
-
"@teambit/
|
|
37
|
-
"@teambit/
|
|
22
|
+
"@teambit/cli": "0.0.1329",
|
|
23
|
+
"@teambit/logger": "0.0.1422",
|
|
24
|
+
"@teambit/workspace": "1.0.1002",
|
|
25
|
+
"@teambit/builder": "1.0.1002",
|
|
26
|
+
"@teambit/checkout": "1.0.1003",
|
|
27
|
+
"@teambit/component.modules.merge-helper": "0.0.62",
|
|
28
|
+
"@teambit/component.snap-distance": "0.0.120",
|
|
29
|
+
"@teambit/config-merger": "0.0.869",
|
|
30
|
+
"@teambit/dependency-resolver": "1.0.1002",
|
|
31
|
+
"@teambit/export": "1.0.1002",
|
|
32
|
+
"@teambit/importer": "1.0.1002",
|
|
33
|
+
"@teambit/lanes": "1.0.1020",
|
|
34
|
+
"@teambit/legacy.consumer-component": "0.0.120",
|
|
35
|
+
"@teambit/objects": "0.0.509",
|
|
36
|
+
"@teambit/snapping": "1.0.1002",
|
|
37
|
+
"@teambit/status": "1.0.1024"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/lodash": "4.14.165",
|