@teambit/ci 1.0.648 → 1.0.649
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.
- package/ci.docs.mdx +6 -1
- package/dist/ci.docs.mdx +6 -1
- package/dist/{preview-1792708253611.js → preview-1792765139384.js} +1 -1
- package/dist/sync/lane-sync-executor.d.ts +1 -1
- package/dist/sync/lane-sync-executor.js.map +1 -1
- package/dist/sync/sync-orchestrator.d.ts +7 -1
- package/dist/sync/sync-orchestrator.js +47 -21
- package/dist/sync/sync-orchestrator.js.map +1 -1
- package/dist/sync/sync-state.d.ts +2 -0
- package/dist/sync/sync-state.js +6 -0
- package/dist/sync/sync-state.js.map +1 -1
- package/package.json +13 -13
- package/sync/lane-sync-executor.ts +1 -1
- package/sync/sync-orchestrator.ts +35 -22
- package/sync/sync-state.ts +5 -0
|
@@ -63,13 +63,19 @@ export declare class SyncOrchestrator {
|
|
|
63
63
|
*/
|
|
64
64
|
private laneNotSyncableReason;
|
|
65
65
|
/**
|
|
66
|
-
* The
|
|
66
|
+
* The lanes to reconcile on an `--all` run (sorted by name), plus one HALTED line per enumeration
|
|
67
67
|
* failure. The list is the union of the remote's lanes AND the lane-mapped branches on `origin` —
|
|
68
68
|
* a lane deleted on bit.cloud is gone from the first source, and only the branch side can make
|
|
69
69
|
* `close-pr` fire for it. An enumeration failure is reported rather than thrown, so the half that
|
|
70
70
|
* did enumerate is still reconciled while the run exits non-zero.
|
|
71
71
|
*/
|
|
72
72
|
private listLanesToSync;
|
|
73
|
+
/**
|
|
74
|
+
* The lane a lane-mapped branch mirrors. A branch name carries no scope, so a lane that another scope
|
|
75
|
+
* hosts is found only through the lane pointer in the branch's `.bitmap`. A pointer to a lane of
|
|
76
|
+
* another name comes from a branch cut from that lane's branch, and must not redirect this one.
|
|
77
|
+
*/
|
|
78
|
+
private branchLaneTarget;
|
|
73
79
|
/**
|
|
74
80
|
* Join the per-target summary lines, and turn any halt into a non-zero exit — the executors never
|
|
75
81
|
* throw, so this is the single place "needs a human" becomes visible to CI. `BitError` rather than
|
|
@@ -82,6 +82,13 @@ function _gitOps() {
|
|
|
82
82
|
};
|
|
83
83
|
return data;
|
|
84
84
|
}
|
|
85
|
+
function _syncState() {
|
|
86
|
+
const data = require("./sync-state");
|
|
87
|
+
_syncState = function () {
|
|
88
|
+
return data;
|
|
89
|
+
};
|
|
90
|
+
return data;
|
|
91
|
+
}
|
|
85
92
|
function _initScaffold() {
|
|
86
93
|
const data = require("./init-scaffold");
|
|
87
94
|
_initScaffold = function () {
|
|
@@ -212,12 +219,8 @@ class SyncOrchestrator {
|
|
|
212
219
|
if (!laneName) return `branch ${branch} does not map to a valid lane name; nothing to do`;
|
|
213
220
|
const skipReason = this.laneNotSyncableReason(laneName, cfg, mainLaneName, defaultBranch);
|
|
214
221
|
if (skipReason) return `${skipReason} (branch ${branch})`;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return this.summarizeSync([await laneSync.syncLane({
|
|
218
|
-
hostScope: defaultScope,
|
|
219
|
-
name: laneName
|
|
220
|
-
}, {
|
|
222
|
+
const target = await this.branchLaneTarget(laneSync, branch, laneName);
|
|
223
|
+
return this.summarizeSync([await laneSync.syncLane(target, {
|
|
221
224
|
dryRun: opts.dryRun
|
|
222
225
|
})]);
|
|
223
226
|
}
|
|
@@ -239,17 +242,14 @@ class SyncOrchestrator {
|
|
|
239
242
|
const {
|
|
240
243
|
lanes: lanesToSync,
|
|
241
244
|
errors
|
|
242
|
-
} = await this.listLanesToSync(cfg, mainLaneName, defaultBranch);
|
|
245
|
+
} = await this.listLanesToSync(cfg, mainLaneName, defaultBranch, laneSync);
|
|
243
246
|
lines.push(...errors);
|
|
244
|
-
this.deps.logger.console((0, _cli().formatTitle)(`Reconciling ${lanesToSync.length} mapped lane(s) of ${defaultScope}` + `${lanesToSync.length ? `: ${lanesToSync.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
this.deps.logger.console((0, _cli().formatTitle)(`Reconciling ${lanesToSync.length} mapped lane(s) of ${defaultScope}` + `${lanesToSync.length ? `: ${lanesToSync.map(({
|
|
248
|
+
name
|
|
249
|
+
}) => name).join(', ')}` : ''}`));
|
|
250
|
+
for (const target of lanesToSync) {
|
|
248
251
|
// oxlint-disable-next-line no-await-in-loop
|
|
249
|
-
lines.push(await laneSync.syncLane({
|
|
250
|
-
hostScope: defaultScope,
|
|
251
|
-
name: laneName
|
|
252
|
-
}, {
|
|
252
|
+
lines.push(await laneSync.syncLane(target, {
|
|
253
253
|
dryRun: opts.dryRun
|
|
254
254
|
}));
|
|
255
255
|
}
|
|
@@ -402,13 +402,13 @@ class SyncOrchestrator {
|
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
/**
|
|
405
|
-
* The
|
|
405
|
+
* The lanes to reconcile on an `--all` run (sorted by name), plus one HALTED line per enumeration
|
|
406
406
|
* failure. The list is the union of the remote's lanes AND the lane-mapped branches on `origin` —
|
|
407
407
|
* a lane deleted on bit.cloud is gone from the first source, and only the branch side can make
|
|
408
408
|
* `close-pr` fire for it. An enumeration failure is reported rather than thrown, so the half that
|
|
409
409
|
* did enumerate is still reconciled while the run exits non-zero.
|
|
410
410
|
*/
|
|
411
|
-
async listLanesToSync(cfg, mainLaneName, defaultBranch) {
|
|
411
|
+
async listLanesToSync(cfg, mainLaneName, defaultBranch, laneSync) {
|
|
412
412
|
if (!cfg.lanes.length) {
|
|
413
413
|
this.deps.logger.console((0, _cli().formatWarningSummary)('sync.lanes is empty — lane mirroring is disabled, reconciling the main scope only'));
|
|
414
414
|
return {
|
|
@@ -417,7 +417,8 @@ class SyncOrchestrator {
|
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
419
|
const errors = [];
|
|
420
|
-
const
|
|
420
|
+
const targets = new Map();
|
|
421
|
+
const add = target => targets.set(`${target.hostScope}/${target.name}`, target);
|
|
421
422
|
const remote = this.deps.workspace.defaultScope;
|
|
422
423
|
try {
|
|
423
424
|
const lanes = await this.deps.lanes.getLanes({
|
|
@@ -425,7 +426,10 @@ class SyncOrchestrator {
|
|
|
425
426
|
});
|
|
426
427
|
lanes.forEach(lane => {
|
|
427
428
|
const name = lane.id?.name ?? lane.name;
|
|
428
|
-
if (name)
|
|
429
|
+
if (name) add({
|
|
430
|
+
hostScope: remote,
|
|
431
|
+
name
|
|
432
|
+
});
|
|
429
433
|
});
|
|
430
434
|
} catch (e) {
|
|
431
435
|
const msg = e?.toString() ?? '';
|
|
@@ -447,18 +451,40 @@ class SyncOrchestrator {
|
|
|
447
451
|
this.deps.logger.debug(`bit ci sync: branch "${branch}" does not map to a name any lane could have ` + `(mapped to "${(0, _syncConfig().branchToLaneName)(branch, cfg) ?? '<not lane-mapped>'}") — skipping it`);
|
|
448
452
|
continue;
|
|
449
453
|
}
|
|
450
|
-
|
|
454
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
455
|
+
add(await this.branchLaneTarget(laneSync, branch, laneName));
|
|
451
456
|
}
|
|
452
457
|
} catch (e) {
|
|
453
458
|
errors.push(`${_laneSyncExecutor().HALT_SUMMARY_PREFIX} lanes -> could not list the branches of "origin", so a lane deleted on ` + `bit.cloud may have kept an orphan branch and an open PR: ${e?.message || e}`);
|
|
454
459
|
}
|
|
455
|
-
const lanes = [...
|
|
460
|
+
const lanes = [...targets.values()].filter(({
|
|
461
|
+
name
|
|
462
|
+
}) => name !== mainLaneName).filter(({
|
|
463
|
+
name
|
|
464
|
+
}) => (0, _syncConfig().shouldSyncLane)(name, cfg)).sort((a, b) => a.name.localeCompare(b.name));
|
|
456
465
|
return {
|
|
457
466
|
lanes,
|
|
458
467
|
errors
|
|
459
468
|
};
|
|
460
469
|
}
|
|
461
470
|
|
|
471
|
+
/**
|
|
472
|
+
* The lane a lane-mapped branch mirrors. A branch name carries no scope, so a lane that another scope
|
|
473
|
+
* hosts is found only through the lane pointer in the branch's `.bitmap`. A pointer to a lane of
|
|
474
|
+
* another name comes from a branch cut from that lane's branch, and must not redirect this one.
|
|
475
|
+
*/
|
|
476
|
+
async branchLaneTarget(laneSync, branch, laneName) {
|
|
477
|
+
const defaultScope = this.deps.workspace.defaultScope;
|
|
478
|
+
// a failed fetch must not throw here: syncLane fetches again and turns the failure into a halt
|
|
479
|
+
await laneSync.fetchOnce().catch(() => undefined);
|
|
480
|
+
const pointer = await (0, _syncState().readBranchLanePointer)(branch, defaultScope);
|
|
481
|
+
const target = pointer ? (0, _syncConfig().parseLaneTarget)(pointer, defaultScope) : undefined;
|
|
482
|
+
return target?.name === laneName ? target : {
|
|
483
|
+
hostScope: defaultScope,
|
|
484
|
+
name: laneName
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
462
488
|
/**
|
|
463
489
|
* Join the per-target summary lines, and turn any halt into a non-zero exit — the executors never
|
|
464
490
|
* throw, so this is the single place "needs a human" becomes visible to CI. `BitError` rather than
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_fs","_interopRequireDefault","path","_interopRequireWildcard","_bitError","_ci","_git","_syncConfig","_laneSyncExecutor","_mainSyncExecutor","_gitHostProvider","_gitOps","_initScaffold","_agentsMd","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","assertCleanForDryRun","dirtyFiles","named","slice","join","BitError","SyncOrchestrator","constructor","deps","sync","opts","init","lane","branch","all","main","dryRun","syncInit","narrower","undefined","selectors","selector","Boolean","winner","cfg","resolveSyncConfig","config","defaultScope","workspace","defaultBranch","ci","getDefaultBranchName","mainLaneName","lanes","getDefaultLaneId","name","statusAtStart","git","status","catch","files","map","file","isNonContentPath","logger","consoleWarning","remoteUrl","remote","provider","gitHost","reason","noGitHostReason","selectGitHostProvider","listGitHostProviders","trim","debug","laneSync","LaneSyncExecutor","mainSync","MainSyncExecutor","checkout","summarizeSync","syncMain","mainSyncBranch","laneName","syncableLaneNameForBranch","skipReason","laneNotSyncableReason","syncLane","hostScope","target","parseLaneTarget","explicitTarget","lines","lanesToSync","errors","listLanesToSync","console","formatTitle","origin","detectedBranch","detectDefaultBranchName","chooseInitDefaultBranch","currentBranchOr","repoRoot","gitRepoRoot","scaffoldRoot","realPath","p","fs","existsSync","realpathSync","wsDir","relative","split","sep","fileOutcomes","scaffoldWorkflowFiles","startsWith","displayPath","abs","fromCwd","process","cwd","isAbsolute","configAdded","ensureSyncConfigBlock","ownerRepo","deriveOwnerRepo","agentsOutcome","scaffoldAgentsMd","scope","repo","host","owner","UNKNOWN_REPO","repoHasCommits","raw","then","out","handled","outcome","relativePath","toStage","ignored","isIgnored","changed","renderInitReport","scopeId","originUrl","defaultBranchGuessed","repoRootFromCwd","inGitRepo","configDisplayPath","fallback","current","isValidGitBranchName","wsConfig","getWorkspaceConfig","existing","extension","CiAspect","id","setExtension","mergeIntoExisting","ignoreVersion","write","reasonForChange","laneNameToBranch","shouldSyncLane","JSON","stringify","formatWarningSummary","names","Set","getLanes","add","msg","toString","includes","HALT_SUMMARY_PREFIX","listRemoteBranches","branchToLaneName","message","sort","summary","halted","line","refusals","REFUSED_SUMMARY_PREFIX","exports"],"sources":["sync-orchestrator.ts"],"sourcesContent":["import { formatTitle, formatWarningSummary } from '@teambit/cli';\nimport fs from 'fs';\nimport * as path from 'path';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport type { LanesMain } from '@teambit/lanes';\nimport type { CheckoutMain } from '@teambit/checkout';\nimport { CiAspect } from '../ci.aspect';\nimport type { CiMain, CiWorkspaceConfig } from '../ci.main.runtime';\nimport { git } from '../git';\nimport type { CiSyncConfig } from './sync-config';\nimport {\n branchToLaneName,\n isValidGitBranchName,\n laneNameToBranch,\n parseLaneTarget,\n resolveSyncConfig,\n shouldSyncLane,\n syncableLaneNameForBranch,\n} from './sync-config';\nimport { HALT_SUMMARY_PREFIX, REFUSED_SUMMARY_PREFIX, LaneSyncExecutor } from './lane-sync-executor';\nimport { MainSyncExecutor } from './main-sync-executor';\nimport { selectGitHostProvider } from './git-host-provider';\nimport { gitRepoRoot, isNonContentPath, listRemoteBranches } from './git-ops';\nimport { chooseInitDefaultBranch, deriveOwnerRepo, renderInitReport, scaffoldWorkflowFiles } from './init-scaffold';\nimport { UNKNOWN_REPO, scaffoldAgentsMd } from './agents-md';\n\n/**\n * Refuse a `--dry-run` whose plan would be computed by force-checking-out branches over uncommitted\n * work: the main-scope drift is a diff, so the tree IS written before the dry-run return. A dry run\n * promises to write nothing, so it may not discard either — with a clean tree the write-then-restore\n * loses nothing.\n */\nexport function assertCleanForDryRun(dirtyFiles: string[]): void {\n if (!dirtyFiles.length) return;\n const named = `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`;\n throw new BitError(\n `bit ci sync --dry-run refuses to run: the working tree has ${dirtyFiles.length} uncommitted change(s), ` +\n `and computing the plan force-checkouts branches and removes untracked files, which would discard ` +\n `them. Commit or stash them first: ${named}`\n );\n}\n\n/** Everything the sync orchestration needs from `CiMain`, passed explicitly. */\nexport type SyncOrchestratorDeps = {\n ci: CiMain;\n workspace: Workspace;\n logger: Logger;\n lanes: LanesMain;\n checkout: CheckoutMain;\n config: CiWorkspaceConfig;\n};\n\n/**\n * Routing and aggregation for `bit ci sync`: decides which targets a run visits and how their\n * summaries combine. What reconciling a target means lives in the two executors, both stateless and\n * idempotent, so the trigger only ever decides when the reconciler runs.\n */\nexport class SyncOrchestrator {\n constructor(private deps: SyncOrchestratorDeps) {}\n\n /**\n * `bit ci sync` — reconcile Bit lanes and the main scope with git branches and pull requests.\n * Returns the per-target summary lines; throws the joined summary after the loop when any target\n * halted or was refused, so CI exits non-zero while every other target was still attempted. A skip\n * is neither — it reports itself and leaves the run green.\n */\n async sync(\n opts: { lane?: string; branch?: string; all?: boolean; main?: boolean; dryRun?: boolean; init?: boolean } = {}\n ): Promise<string> {\n if (opts.init) {\n if (opts.lane || opts.branch || opts.all || opts.main || opts.dryRun) {\n throw new BitError(\n 'bit ci sync --init cannot be combined with a lane argument, --branch, --all, --main or ' +\n '--dry-run: it only scaffolds onboarding files (workflows + workspace.jsonc config) and exits ' +\n '— it never reconciles'\n );\n }\n return this.syncInit();\n }\n\n // Refuse contradictory flag combinations rather than silently letting one target win.\n const narrower = opts.lane\n ? `a lane argument (\"${opts.lane}\")`\n : (opts.branch && `--branch (\"${opts.branch}\")`) || (opts.main && '--main') || undefined;\n if (opts.all && narrower) {\n throw new BitError(\n `--all cannot be combined with ${narrower}: --all reconciles every mapped lane plus the main ` +\n `scope, and is what runs when no target is given`\n );\n }\n\n // A lane argument, `--branch` and `--main` each select the single target; any two contradict.\n const selectors = [\n opts.lane && `a lane argument (\"${opts.lane}\")`,\n opts.branch && `--branch (\"${opts.branch}\")`,\n opts.main && '--main',\n ].filter((selector): selector is string => Boolean(selector));\n if (selectors.length > 1) {\n const winner = opts.main ? '--main' : `--branch (\"${opts.branch}\")`;\n throw new BitError(\n `${selectors[0]} cannot be combined with ${selectors.slice(1).join(' or with ')}: each selects ` +\n `the single target this run reconciles, and only ${winner} would have run — the rest would be ` +\n `silently dropped, leaving a run that reports success while a target you named was never visited`\n );\n }\n\n const cfg = resolveSyncConfig(this.deps.config.sync);\n const defaultScope = this.deps.workspace.defaultScope;\n const defaultBranch = await this.deps.ci.getDefaultBranchName();\n const mainLaneName = this.deps.lanes.getDefaultLaneId().name;\n\n // The executors force-checkout branches and remove untracked files; warn up front, naming the\n // files at stake, before an interactive run discards anything.\n const statusAtStart = await git.status().catch(() => undefined);\n const dirtyFiles = (statusAtStart?.files ?? []).map((file) => file.path).filter((file) => !isNonContentPath(file));\n if (opts.dryRun) assertCleanForDryRun(dirtyFiles);\n if (dirtyFiles.length) {\n this.deps.logger.consoleWarning(\n `the working tree has ${dirtyFiles.length} uncommitted change(s). \"bit ci sync\" force-checkouts branches ` +\n `and removes untracked files (except .bit/ and node_modules/), so these will be discarded: ` +\n `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`\n );\n }\n\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const { provider: gitHost, reason: noGitHostReason } = selectGitHostProvider(\n this.deps.ci.listGitHostProviders(),\n typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined\n );\n if (gitHost) this.deps.logger.debug(`bit ci sync: using the \"${gitHost.name}\" git host provider`);\n // Warn once, up front — the executors' per-action lines can only say PRs were skipped, not why.\n else if (noGitHostReason) this.deps.logger.consoleWarning(noGitHostReason);\n\n const laneSync = new LaneSyncExecutor({\n lanes: this.deps.lanes,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultScope,\n });\n const mainSync = new MainSyncExecutor({\n checkout: this.deps.checkout,\n lanes: this.deps.lanes,\n workspace: this.deps.workspace,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultBranch,\n defaultScope,\n });\n\n if (opts.main) {\n return this.summarizeSync([await mainSync.syncMain({ dryRun: opts.dryRun })]);\n }\n\n if (opts.branch) {\n const branch = opts.branch;\n // Under the default `branchPrefix: ''` these two would resolve to the bogus lanes \"main\" /\n // \"bit-sync/main\"; both are reconciled by the main-scope path, never as lanes.\n if (branch === defaultBranch) {\n return `branch ${branch} is the default branch — reconcile it with \"bit ci sync --main\"; nothing to do`;\n }\n if (branch === cfg.mainSyncBranch) {\n return `branch ${branch} is the main sync branch maintained by this command; nothing to do`;\n }\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) return `branch ${branch} does not map to a valid lane name; nothing to do`;\n const skipReason = this.laneNotSyncableReason(laneName, cfg, mainLaneName, defaultBranch);\n if (skipReason) return `${skipReason} (branch ${branch})`;\n // A branch name carries no scope, so this path can only resolve the lane against `defaultScope`;\n // resolving a foreign-hosted lane to the wrong scope is safe (no-op, never a deletion).\n return this.summarizeSync([\n await laneSync.syncLane({ hostScope: defaultScope, name: laneName }, { dryRun: opts.dryRun }),\n ]);\n }\n\n if (opts.lane) {\n // Every guard below is asked about the NAME: \"main\" is not a lane whichever scope hosts it, and\n // the `lanes` patterns match lane names, not lane ids.\n const target = parseLaneTarget(opts.lane, defaultScope);\n const skipReason = this.laneNotSyncableReason(target.name, cfg, mainLaneName, defaultBranch);\n if (skipReason) return skipReason;\n return this.summarizeSync([await laneSync.syncLane(target, { dryRun: opts.dryRun, explicitTarget: true })]);\n }\n\n // `--all` (also the no-arguments default): every mapped lane, then the main scope. Sequential on\n // purpose — the lanes share one workspace and one git checkout.\n const lines: string[] = [];\n const { lanes: lanesToSync, errors } = await this.listLanesToSync(cfg, mainLaneName, defaultBranch);\n lines.push(...errors);\n this.deps.logger.console(\n formatTitle(\n `Reconciling ${lanesToSync.length} mapped lane(s) of ${defaultScope}` +\n `${lanesToSync.length ? `: ${lanesToSync.join(', ')}` : ''}`\n )\n );\n for (const laneName of lanesToSync) {\n // Every enumerated target is hosted on `defaultScope` by construction; foreign-hosted lanes are\n // explicit-target only.\n // oxlint-disable-next-line no-await-in-loop\n lines.push(await laneSync.syncLane({ hostScope: defaultScope, name: laneName }, { dryRun: opts.dryRun }));\n }\n lines.push(await mainSync.syncMain({ dryRun: opts.dryRun }));\n return this.summarizeSync(lines);\n }\n\n /**\n * `bit ci sync --init` — one-command onboarding: scaffolds the two workflow files, adds the sync\n * config block to workspace.jsonc if missing, puts the sync rules for coding agents into AGENTS.md,\n * and returns the report of the steps left. Safe to re-run: existing files are skipped, an existing\n * config block or AGENTS.md sync section is left alone; it never reconciles.\n */\n private async syncInit(): Promise<string> {\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const origin = typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined;\n // The remote knows the default branch. When it can't answer (no origin, a repository not pushed\n // yet, a server out of reach), guess: the checked-out branch when it's main or master, else main.\n // A feature branch is never the guess: it would go into the workflows' branch filters.\n const detectedBranch = await this.deps.ci.detectDefaultBranchName();\n const defaultBranch = chooseInitDefaultBranch(detectedBranch, await this.currentBranchOr(''));\n\n // Workflows belong to the repository, not the workspace: GitHub only discovers them at\n // `<repo-root>/.github/workflows`, and a bit workspace may be a subdirectory.\n const repoRoot = await gitRepoRoot();\n const scaffoldRoot = repoRoot ?? this.deps.workspace.path;\n if (!repoRoot) {\n this.deps.logger.consoleWarning(\n `could not resolve the git repository root (\"git rev-parse --show-toplevel\" failed — is this a git ` +\n `repository?). Writing the workflow files under the workspace instead: ${scaffoldRoot}. If that is ` +\n `not the repository root, GitHub will not discover them — move .github/workflows there by hand.`\n );\n }\n\n // A workspace below the repository root: the actions must chdir into it (`ws-dir`).\n // Real paths: git reports the root with symlinks resolved (macOS `/tmp` is `/private/tmp`).\n const realPath = (p: string) => (fs.existsSync(p) ? fs.realpathSync(p) : p);\n const wsDir = path.relative(realPath(scaffoldRoot), realPath(this.deps.workspace.path)).split(path.sep).join('/');\n const fileOutcomes = scaffoldWorkflowFiles(\n scaffoldRoot,\n defaultBranch,\n wsDir && !wsDir.startsWith('..') ? wsDir : undefined\n );\n // Report the path relative to where the user is standing (`../../.github/...` from a nested\n // workspace), not to the workspace, so it is right to paste. Absolute only across drives.\n const displayPath = (abs: string) => {\n const fromCwd = path.relative(process.cwd(), abs);\n return fromCwd && !path.isAbsolute(fromCwd) ? fromCwd : abs;\n };\n const configAdded = await this.ensureSyncConfigBlock();\n // AGENTS.md belongs to the workspace, where agents run bit commands.\n const ownerRepo = deriveOwnerRepo(origin);\n const agentsOutcome = scaffoldAgentsMd(this.deps.workspace.path, {\n scope: this.deps.workspace.defaultScope ?? '<owner>.<scope>',\n repo: ownerRepo\n ? `${ownerRepo.host === 'github.com' ? '' : `${ownerRepo.host}/`}${ownerRepo.owner}/${ownerRepo.repo}`\n : UNKNOWN_REPO,\n defaultBranch,\n });\n // No commit yet: the first commit must take the whole workspace, not only the files --init wrote.\n const repoHasCommits = await git\n .raw(['rev-parse', '--verify', '--quiet', 'HEAD'])\n .then((out) => out.trim().length > 0)\n .catch(() => false);\n\n // What step 1 must stage: of the files --init handles, those git shows as new or changed. One that\n // .gitignore matches is listed apart, because `git add` refuses an ignored path named on the command line.\n const handled = [\n ...fileOutcomes.map((outcome) => path.join(scaffoldRoot, outcome.relativePath)),\n path.join(this.deps.workspace.path, 'workspace.jsonc'),\n path.join(this.deps.workspace.path, agentsOutcome.relativePath),\n ];\n const toStage: string[] = [];\n const ignored: string[] = [];\n if (repoRoot) {\n for (const abs of handled) {\n // Ignored first: `git status` hides an ignored file, so it would look unchanged. `check-ignore`\n // skips tracked files and prints the path only when it is ignored (it exits 1 otherwise). It\n // needs no commit, and the first commit's `git add -A` skips an ignored file too.\n // oxlint-disable-next-line no-await-in-loop\n const isIgnored = await git\n .raw(['check-ignore', '--', abs])\n .then((out) => out.trim().length > 0)\n .catch(() => false);\n if (isIgnored) {\n ignored.push(displayPath(abs));\n continue;\n }\n // the first commit stages everything with `git add -A`\n if (!repoHasCommits) continue;\n // oxlint-disable-next-line no-await-in-loop\n const changed = await git\n .raw(['status', '--porcelain', '--untracked-files=all', '--', abs])\n .then((out) => out.trim().length > 0)\n .catch(() => true);\n if (changed) toStage.push(displayPath(abs));\n }\n }\n\n // Returned, not logged: the command prints what `report()` returns.\n return renderInitReport({\n scopeId: this.deps.workspace.defaultScope,\n ownerRepo,\n originUrl: origin,\n defaultBranch,\n defaultBranchGuessed: !detectedBranch,\n // the workflows live at the repository root, which may be above the workspace\n repoRootFromCwd: path.relative(process.cwd(), scaffoldRoot) || '.',\n repoHasCommits,\n inGitRepo: Boolean(repoRoot),\n files: [\n ...fileOutcomes.map((outcome) => ({\n ...outcome,\n displayPath: displayPath(path.join(scaffoldRoot, outcome.relativePath)),\n })),\n { ...agentsOutcome, displayPath: displayPath(path.join(this.deps.workspace.path, agentsOutcome.relativePath)) },\n ],\n configDisplayPath: displayPath(path.join(this.deps.workspace.path, 'workspace.jsonc')),\n configAdded,\n ...(repoRoot ? { toStage, ignored } : {}),\n });\n }\n\n /** The checked-out branch when it is a usable name (not detached, not option-like), else `fallback`. */\n private async currentBranchOr(fallback: string): Promise<string> {\n const current = await git\n .raw(['branch', '--show-current'])\n .then((out) => out.trim())\n .catch(() => '');\n return current && isValidGitBranchName(current) ? current : fallback;\n }\n\n /**\n * Add `\"sync\": {}` under `\"teambit.git/ci\"` in workspace.jsonc if that key isn't there yet; returns\n * whether it wrote. The comment-preserving `WorkspaceConfig` API merges into existing\n * `teambit.git/ci` config rather than clobbering it.\n */\n private async ensureSyncConfigBlock(): Promise<boolean> {\n const wsConfig = this.deps.workspace.getWorkspaceConfig();\n const existing = wsConfig.extension(CiAspect.id, true) as CiWorkspaceConfig | undefined;\n if (existing?.sync) return false;\n wsConfig.setExtension(CiAspect.id, { sync: {} }, { mergeIntoExisting: true, ignoreVersion: true });\n await wsConfig.write({ reasonForChange: 'bit ci sync --init: add the sync config block' });\n return true;\n }\n\n /**\n * Why this lane name must not be handed to the lane executor, or undefined when it's syncable. The\n * mapped branch is checked too — the lane path must never write the two branches the main-scope\n * path owns.\n */\n private laneNotSyncableReason(\n laneName: string,\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): string | undefined {\n if (laneName === mainLaneName) {\n return `\"${mainLaneName}\" is not a lane — reconcile the main scope with \"bit ci sync --main\"; nothing to do`;\n }\n const branch = laneNameToBranch(laneName, cfg);\n if (branch === defaultBranch) {\n return (\n `lane ${laneName} maps to the default branch ${branch} — reconcile it with \"bit ci sync --main\"; ` +\n `nothing to do`\n );\n }\n if (branch === cfg.mainSyncBranch) {\n return `lane ${laneName} maps to ${branch}, the main sync branch maintained by this command; nothing to do`;\n }\n if (!shouldSyncLane(laneName, cfg)) {\n return `lane ${laneName} is not matched by the sync config (lanes: ${JSON.stringify(cfg.lanes)}); nothing to do`;\n }\n return undefined;\n }\n\n /**\n * The lane names to reconcile on an `--all` run (sorted), plus one HALTED line per enumeration\n * failure. The list is the union of the remote's lanes AND the lane-mapped branches on `origin` —\n * a lane deleted on bit.cloud is gone from the first source, and only the branch side can make\n * `close-pr` fire for it. An enumeration failure is reported rather than thrown, so the half that\n * did enumerate is still reconciled while the run exits non-zero.\n */\n private async listLanesToSync(\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): Promise<{ lanes: string[]; errors: string[] }> {\n if (!cfg.lanes.length) {\n this.deps.logger.console(\n formatWarningSummary('sync.lanes is empty — lane mirroring is disabled, reconciling the main scope only')\n );\n return { lanes: [], errors: [] };\n }\n const errors: string[] = [];\n const names = new Set<string>();\n const remote = this.deps.workspace.defaultScope;\n\n try {\n const lanes = await this.deps.lanes.getLanes({ remote });\n lanes.forEach((lane) => {\n const name = lane.id?.name ?? lane.name;\n if (name) names.add(name);\n });\n } catch (e: any) {\n const msg = e?.toString() ?? '';\n // A scope with no lanes at all: the remote answers \"not found\" rather than an empty list.\n if (msg.includes('was not found') || msg.includes('not found')) {\n this.deps.logger.console(\n formatWarningSummary(`No lanes found on ${remote} — reconciling lane-mapped branches and the main scope only`)\n );\n } else {\n errors.push(`${HALT_SUMMARY_PREFIX} lanes -> could not list the lanes of ${remote}: ${msg}`);\n }\n }\n\n try {\n for (const branch of await listRemoteBranches()) {\n // Reconciled by the main-scope path, never as lanes — under the default `branchPrefix: ''`\n // they would otherwise resolve to the bogus lanes \"main\" / \"bit-sync/main\".\n if (branch === defaultBranch || branch === cfg.mainSyncBranch) continue;\n // Ordinary developer branches are skipped at debug level, never as a summary line.\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) {\n this.deps.logger.debug(\n `bit ci sync: branch \"${branch}\" does not map to a name any lane could have ` +\n `(mapped to \"${branchToLaneName(branch, cfg) ?? '<not lane-mapped>'}\") — skipping it`\n );\n continue;\n }\n names.add(laneName);\n }\n } catch (e: any) {\n errors.push(\n `${HALT_SUMMARY_PREFIX} lanes -> could not list the branches of \"origin\", so a lane deleted on ` +\n `bit.cloud may have kept an orphan branch and an open PR: ${e?.message || e}`\n );\n }\n\n const lanes = [...names]\n .filter((name) => name !== mainLaneName)\n .filter((name) => shouldSyncLane(name, cfg))\n .sort();\n return { lanes, errors };\n }\n\n /**\n * Join the per-target summary lines, and turn any halt into a non-zero exit — the executors never\n * throw, so this is the single place \"needs a human\" becomes visible to CI. `BitError` rather than\n * `Error`: bit reports a plain `Error` as an internal failure (stack trace, Sentry FATAL).\n */\n private summarizeSync(lines: string[]): string {\n const summary = lines.join('\\n');\n const halted = lines.filter((line) => line.startsWith(HALT_SUMMARY_PREFIX));\n if (halted.length) {\n throw new BitError(`bit ci sync could not reconcile ${halted.length} target(s):\\n${summary}`);\n }\n // A refusal is not a halt: the repository is healthy, the reconciler simply will not do what was\n // asked — exit non-zero saying that, rather than reporting a sync conflict.\n const refusals = lines.filter((line) => line.startsWith(REFUSED_SUMMARY_PREFIX));\n if (refusals.length) {\n throw new BitError(refusals.map((line) => line.slice(REFUSED_SUMMARY_PREFIX.length).trim()).join('\\n'));\n }\n return summary;\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAK,uBAAA,CAAAJ,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,SAAA,YAAAA,CA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E,IAAIM,MAAM,CAACrL,MAAM,EAAE;MACjB,MAAM,KAAIoB,oBAAQ,EAAC,mCAAmCiK,MAAM,CAACrL,MAAM,gBAAgBoL,OAAO,EAAE,CAAC;IAC/F;IACA;IACA;IACA,MAAMG,QAAQ,GAAG/F,KAAK,CAAC9F,MAAM,CAAE4L,IAAI,IAAKA,IAAI,CAACrE,UAAU,CAACuE,0CAAsB,CAAC,CAAC;IAChF,IAAID,QAAQ,CAACvL,MAAM,EAAE;MACnB,MAAM,KAAIoB,oBAAQ,EAACmK,QAAQ,CAAC/H,GAAG,CAAE8H,IAAI,IAAKA,IAAI,CAACpK,KAAK,CAACsK,0CAAsB,CAACxL,MAAM,CAAC,CAACqE,IAAI,CAAC,CAAC,CAAC,CAAClD,IAAI,CAAC,IAAI,CAAC,CAAC;IACzG;IACA,OAAOiK,OAAO;EAChB;AACF;AAACK,OAAA,CAAApK,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_fs","_interopRequireDefault","path","_interopRequireWildcard","_bitError","_ci","_git","_syncConfig","_laneSyncExecutor","_mainSyncExecutor","_gitHostProvider","_gitOps","_syncState","_initScaffold","_agentsMd","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","assertCleanForDryRun","dirtyFiles","named","slice","join","BitError","SyncOrchestrator","constructor","deps","sync","opts","init","lane","branch","all","main","dryRun","syncInit","narrower","undefined","selectors","selector","Boolean","winner","cfg","resolveSyncConfig","config","defaultScope","workspace","defaultBranch","ci","getDefaultBranchName","mainLaneName","lanes","getDefaultLaneId","name","statusAtStart","git","status","catch","files","map","file","isNonContentPath","logger","consoleWarning","remoteUrl","remote","provider","gitHost","reason","noGitHostReason","selectGitHostProvider","listGitHostProviders","trim","debug","laneSync","LaneSyncExecutor","mainSync","MainSyncExecutor","checkout","summarizeSync","syncMain","mainSyncBranch","laneName","syncableLaneNameForBranch","skipReason","laneNotSyncableReason","target","branchLaneTarget","syncLane","parseLaneTarget","explicitTarget","lines","lanesToSync","errors","listLanesToSync","console","formatTitle","origin","detectedBranch","detectDefaultBranchName","chooseInitDefaultBranch","currentBranchOr","repoRoot","gitRepoRoot","scaffoldRoot","realPath","p","fs","existsSync","realpathSync","wsDir","relative","split","sep","fileOutcomes","scaffoldWorkflowFiles","startsWith","displayPath","abs","fromCwd","process","cwd","isAbsolute","configAdded","ensureSyncConfigBlock","ownerRepo","deriveOwnerRepo","agentsOutcome","scaffoldAgentsMd","scope","repo","host","owner","UNKNOWN_REPO","repoHasCommits","raw","then","out","handled","outcome","relativePath","toStage","ignored","isIgnored","changed","renderInitReport","scopeId","originUrl","defaultBranchGuessed","repoRootFromCwd","inGitRepo","configDisplayPath","fallback","current","isValidGitBranchName","wsConfig","getWorkspaceConfig","existing","extension","CiAspect","id","setExtension","mergeIntoExisting","ignoreVersion","write","reasonForChange","laneNameToBranch","shouldSyncLane","JSON","stringify","formatWarningSummary","targets","Map","add","hostScope","getLanes","msg","toString","includes","HALT_SUMMARY_PREFIX","listRemoteBranches","branchToLaneName","message","values","sort","a","b","localeCompare","fetchOnce","pointer","readBranchLanePointer","summary","halted","line","refusals","REFUSED_SUMMARY_PREFIX","exports"],"sources":["sync-orchestrator.ts"],"sourcesContent":["import { formatTitle, formatWarningSummary } from '@teambit/cli';\nimport fs from 'fs';\nimport * as path from 'path';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport type { LanesMain } from '@teambit/lanes';\nimport type { CheckoutMain } from '@teambit/checkout';\nimport { CiAspect } from '../ci.aspect';\nimport type { CiMain, CiWorkspaceConfig } from '../ci.main.runtime';\nimport { git } from '../git';\nimport type { CiSyncConfig, LaneTarget } from './sync-config';\nimport {\n branchToLaneName,\n isValidGitBranchName,\n laneNameToBranch,\n parseLaneTarget,\n resolveSyncConfig,\n shouldSyncLane,\n syncableLaneNameForBranch,\n} from './sync-config';\nimport { HALT_SUMMARY_PREFIX, REFUSED_SUMMARY_PREFIX, LaneSyncExecutor } from './lane-sync-executor';\nimport { MainSyncExecutor } from './main-sync-executor';\nimport { selectGitHostProvider } from './git-host-provider';\nimport { gitRepoRoot, isNonContentPath, listRemoteBranches } from './git-ops';\nimport { readBranchLanePointer } from './sync-state';\nimport { chooseInitDefaultBranch, deriveOwnerRepo, renderInitReport, scaffoldWorkflowFiles } from './init-scaffold';\nimport { UNKNOWN_REPO, scaffoldAgentsMd } from './agents-md';\n\n/**\n * Refuse a `--dry-run` whose plan would be computed by force-checking-out branches over uncommitted\n * work: the main-scope drift is a diff, so the tree IS written before the dry-run return. A dry run\n * promises to write nothing, so it may not discard either — with a clean tree the write-then-restore\n * loses nothing.\n */\nexport function assertCleanForDryRun(dirtyFiles: string[]): void {\n if (!dirtyFiles.length) return;\n const named = `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`;\n throw new BitError(\n `bit ci sync --dry-run refuses to run: the working tree has ${dirtyFiles.length} uncommitted change(s), ` +\n `and computing the plan force-checkouts branches and removes untracked files, which would discard ` +\n `them. Commit or stash them first: ${named}`\n );\n}\n\n/** Everything the sync orchestration needs from `CiMain`, passed explicitly. */\nexport type SyncOrchestratorDeps = {\n ci: CiMain;\n workspace: Workspace;\n logger: Logger;\n lanes: LanesMain;\n checkout: CheckoutMain;\n config: CiWorkspaceConfig;\n};\n\n/**\n * Routing and aggregation for `bit ci sync`: decides which targets a run visits and how their\n * summaries combine. What reconciling a target means lives in the two executors, both stateless and\n * idempotent, so the trigger only ever decides when the reconciler runs.\n */\nexport class SyncOrchestrator {\n constructor(private deps: SyncOrchestratorDeps) {}\n\n /**\n * `bit ci sync` — reconcile Bit lanes and the main scope with git branches and pull requests.\n * Returns the per-target summary lines; throws the joined summary after the loop when any target\n * halted or was refused, so CI exits non-zero while every other target was still attempted. A skip\n * is neither — it reports itself and leaves the run green.\n */\n async sync(\n opts: { lane?: string; branch?: string; all?: boolean; main?: boolean; dryRun?: boolean; init?: boolean } = {}\n ): Promise<string> {\n if (opts.init) {\n if (opts.lane || opts.branch || opts.all || opts.main || opts.dryRun) {\n throw new BitError(\n 'bit ci sync --init cannot be combined with a lane argument, --branch, --all, --main or ' +\n '--dry-run: it only scaffolds onboarding files (workflows + workspace.jsonc config) and exits ' +\n '— it never reconciles'\n );\n }\n return this.syncInit();\n }\n\n // Refuse contradictory flag combinations rather than silently letting one target win.\n const narrower = opts.lane\n ? `a lane argument (\"${opts.lane}\")`\n : (opts.branch && `--branch (\"${opts.branch}\")`) || (opts.main && '--main') || undefined;\n if (opts.all && narrower) {\n throw new BitError(\n `--all cannot be combined with ${narrower}: --all reconciles every mapped lane plus the main ` +\n `scope, and is what runs when no target is given`\n );\n }\n\n // A lane argument, `--branch` and `--main` each select the single target; any two contradict.\n const selectors = [\n opts.lane && `a lane argument (\"${opts.lane}\")`,\n opts.branch && `--branch (\"${opts.branch}\")`,\n opts.main && '--main',\n ].filter((selector): selector is string => Boolean(selector));\n if (selectors.length > 1) {\n const winner = opts.main ? '--main' : `--branch (\"${opts.branch}\")`;\n throw new BitError(\n `${selectors[0]} cannot be combined with ${selectors.slice(1).join(' or with ')}: each selects ` +\n `the single target this run reconciles, and only ${winner} would have run — the rest would be ` +\n `silently dropped, leaving a run that reports success while a target you named was never visited`\n );\n }\n\n const cfg = resolveSyncConfig(this.deps.config.sync);\n const defaultScope = this.deps.workspace.defaultScope;\n const defaultBranch = await this.deps.ci.getDefaultBranchName();\n const mainLaneName = this.deps.lanes.getDefaultLaneId().name;\n\n // The executors force-checkout branches and remove untracked files; warn up front, naming the\n // files at stake, before an interactive run discards anything.\n const statusAtStart = await git.status().catch(() => undefined);\n const dirtyFiles = (statusAtStart?.files ?? []).map((file) => file.path).filter((file) => !isNonContentPath(file));\n if (opts.dryRun) assertCleanForDryRun(dirtyFiles);\n if (dirtyFiles.length) {\n this.deps.logger.consoleWarning(\n `the working tree has ${dirtyFiles.length} uncommitted change(s). \"bit ci sync\" force-checkouts branches ` +\n `and removes untracked files (except .bit/ and node_modules/), so these will be discarded: ` +\n `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`\n );\n }\n\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const { provider: gitHost, reason: noGitHostReason } = selectGitHostProvider(\n this.deps.ci.listGitHostProviders(),\n typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined\n );\n if (gitHost) this.deps.logger.debug(`bit ci sync: using the \"${gitHost.name}\" git host provider`);\n // Warn once, up front — the executors' per-action lines can only say PRs were skipped, not why.\n else if (noGitHostReason) this.deps.logger.consoleWarning(noGitHostReason);\n\n const laneSync = new LaneSyncExecutor({\n lanes: this.deps.lanes,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultScope,\n });\n const mainSync = new MainSyncExecutor({\n checkout: this.deps.checkout,\n lanes: this.deps.lanes,\n workspace: this.deps.workspace,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultBranch,\n defaultScope,\n });\n\n if (opts.main) {\n return this.summarizeSync([await mainSync.syncMain({ dryRun: opts.dryRun })]);\n }\n\n if (opts.branch) {\n const branch = opts.branch;\n // Under the default `branchPrefix: ''` these two would resolve to the bogus lanes \"main\" /\n // \"bit-sync/main\"; both are reconciled by the main-scope path, never as lanes.\n if (branch === defaultBranch) {\n return `branch ${branch} is the default branch — reconcile it with \"bit ci sync --main\"; nothing to do`;\n }\n if (branch === cfg.mainSyncBranch) {\n return `branch ${branch} is the main sync branch maintained by this command; nothing to do`;\n }\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) return `branch ${branch} does not map to a valid lane name; nothing to do`;\n const skipReason = this.laneNotSyncableReason(laneName, cfg, mainLaneName, defaultBranch);\n if (skipReason) return `${skipReason} (branch ${branch})`;\n const target = await this.branchLaneTarget(laneSync, branch, laneName);\n return this.summarizeSync([await laneSync.syncLane(target, { dryRun: opts.dryRun })]);\n }\n\n if (opts.lane) {\n // Every guard below is asked about the NAME: \"main\" is not a lane whichever scope hosts it, and\n // the `lanes` patterns match lane names, not lane ids.\n const target = parseLaneTarget(opts.lane, defaultScope);\n const skipReason = this.laneNotSyncableReason(target.name, cfg, mainLaneName, defaultBranch);\n if (skipReason) return skipReason;\n return this.summarizeSync([await laneSync.syncLane(target, { dryRun: opts.dryRun, explicitTarget: true })]);\n }\n\n // `--all` (also the no-arguments default): every mapped lane, then the main scope. Sequential on\n // purpose — the lanes share one workspace and one git checkout.\n const lines: string[] = [];\n const { lanes: lanesToSync, errors } = await this.listLanesToSync(cfg, mainLaneName, defaultBranch, laneSync);\n lines.push(...errors);\n this.deps.logger.console(\n formatTitle(\n `Reconciling ${lanesToSync.length} mapped lane(s) of ${defaultScope}` +\n `${lanesToSync.length ? `: ${lanesToSync.map(({ name }) => name).join(', ')}` : ''}`\n )\n );\n for (const target of lanesToSync) {\n // oxlint-disable-next-line no-await-in-loop\n lines.push(await laneSync.syncLane(target, { dryRun: opts.dryRun }));\n }\n lines.push(await mainSync.syncMain({ dryRun: opts.dryRun }));\n return this.summarizeSync(lines);\n }\n\n /**\n * `bit ci sync --init` — one-command onboarding: scaffolds the two workflow files, adds the sync\n * config block to workspace.jsonc if missing, puts the sync rules for coding agents into AGENTS.md,\n * and returns the report of the steps left. Safe to re-run: existing files are skipped, an existing\n * config block or AGENTS.md sync section is left alone; it never reconciles.\n */\n private async syncInit(): Promise<string> {\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const origin = typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined;\n // The remote knows the default branch. When it can't answer (no origin, a repository not pushed\n // yet, a server out of reach), guess: the checked-out branch when it's main or master, else main.\n // A feature branch is never the guess: it would go into the workflows' branch filters.\n const detectedBranch = await this.deps.ci.detectDefaultBranchName();\n const defaultBranch = chooseInitDefaultBranch(detectedBranch, await this.currentBranchOr(''));\n\n // Workflows belong to the repository, not the workspace: GitHub only discovers them at\n // `<repo-root>/.github/workflows`, and a bit workspace may be a subdirectory.\n const repoRoot = await gitRepoRoot();\n const scaffoldRoot = repoRoot ?? this.deps.workspace.path;\n if (!repoRoot) {\n this.deps.logger.consoleWarning(\n `could not resolve the git repository root (\"git rev-parse --show-toplevel\" failed — is this a git ` +\n `repository?). Writing the workflow files under the workspace instead: ${scaffoldRoot}. If that is ` +\n `not the repository root, GitHub will not discover them — move .github/workflows there by hand.`\n );\n }\n\n // A workspace below the repository root: the actions must chdir into it (`ws-dir`).\n // Real paths: git reports the root with symlinks resolved (macOS `/tmp` is `/private/tmp`).\n const realPath = (p: string) => (fs.existsSync(p) ? fs.realpathSync(p) : p);\n const wsDir = path.relative(realPath(scaffoldRoot), realPath(this.deps.workspace.path)).split(path.sep).join('/');\n const fileOutcomes = scaffoldWorkflowFiles(\n scaffoldRoot,\n defaultBranch,\n wsDir && !wsDir.startsWith('..') ? wsDir : undefined\n );\n // Report the path relative to where the user is standing (`../../.github/...` from a nested\n // workspace), not to the workspace, so it is right to paste. Absolute only across drives.\n const displayPath = (abs: string) => {\n const fromCwd = path.relative(process.cwd(), abs);\n return fromCwd && !path.isAbsolute(fromCwd) ? fromCwd : abs;\n };\n const configAdded = await this.ensureSyncConfigBlock();\n // AGENTS.md belongs to the workspace, where agents run bit commands.\n const ownerRepo = deriveOwnerRepo(origin);\n const agentsOutcome = scaffoldAgentsMd(this.deps.workspace.path, {\n scope: this.deps.workspace.defaultScope ?? '<owner>.<scope>',\n repo: ownerRepo\n ? `${ownerRepo.host === 'github.com' ? '' : `${ownerRepo.host}/`}${ownerRepo.owner}/${ownerRepo.repo}`\n : UNKNOWN_REPO,\n defaultBranch,\n });\n // No commit yet: the first commit must take the whole workspace, not only the files --init wrote.\n const repoHasCommits = await git\n .raw(['rev-parse', '--verify', '--quiet', 'HEAD'])\n .then((out) => out.trim().length > 0)\n .catch(() => false);\n\n // What step 1 must stage: of the files --init handles, those git shows as new or changed. One that\n // .gitignore matches is listed apart, because `git add` refuses an ignored path named on the command line.\n const handled = [\n ...fileOutcomes.map((outcome) => path.join(scaffoldRoot, outcome.relativePath)),\n path.join(this.deps.workspace.path, 'workspace.jsonc'),\n path.join(this.deps.workspace.path, agentsOutcome.relativePath),\n ];\n const toStage: string[] = [];\n const ignored: string[] = [];\n if (repoRoot) {\n for (const abs of handled) {\n // Ignored first: `git status` hides an ignored file, so it would look unchanged. `check-ignore`\n // skips tracked files and prints the path only when it is ignored (it exits 1 otherwise). It\n // needs no commit, and the first commit's `git add -A` skips an ignored file too.\n // oxlint-disable-next-line no-await-in-loop\n const isIgnored = await git\n .raw(['check-ignore', '--', abs])\n .then((out) => out.trim().length > 0)\n .catch(() => false);\n if (isIgnored) {\n ignored.push(displayPath(abs));\n continue;\n }\n // the first commit stages everything with `git add -A`\n if (!repoHasCommits) continue;\n // oxlint-disable-next-line no-await-in-loop\n const changed = await git\n .raw(['status', '--porcelain', '--untracked-files=all', '--', abs])\n .then((out) => out.trim().length > 0)\n .catch(() => true);\n if (changed) toStage.push(displayPath(abs));\n }\n }\n\n // Returned, not logged: the command prints what `report()` returns.\n return renderInitReport({\n scopeId: this.deps.workspace.defaultScope,\n ownerRepo,\n originUrl: origin,\n defaultBranch,\n defaultBranchGuessed: !detectedBranch,\n // the workflows live at the repository root, which may be above the workspace\n repoRootFromCwd: path.relative(process.cwd(), scaffoldRoot) || '.',\n repoHasCommits,\n inGitRepo: Boolean(repoRoot),\n files: [\n ...fileOutcomes.map((outcome) => ({\n ...outcome,\n displayPath: displayPath(path.join(scaffoldRoot, outcome.relativePath)),\n })),\n { ...agentsOutcome, displayPath: displayPath(path.join(this.deps.workspace.path, agentsOutcome.relativePath)) },\n ],\n configDisplayPath: displayPath(path.join(this.deps.workspace.path, 'workspace.jsonc')),\n configAdded,\n ...(repoRoot ? { toStage, ignored } : {}),\n });\n }\n\n /** The checked-out branch when it is a usable name (not detached, not option-like), else `fallback`. */\n private async currentBranchOr(fallback: string): Promise<string> {\n const current = await git\n .raw(['branch', '--show-current'])\n .then((out) => out.trim())\n .catch(() => '');\n return current && isValidGitBranchName(current) ? current : fallback;\n }\n\n /**\n * Add `\"sync\": {}` under `\"teambit.git/ci\"` in workspace.jsonc if that key isn't there yet; returns\n * whether it wrote. The comment-preserving `WorkspaceConfig` API merges into existing\n * `teambit.git/ci` config rather than clobbering it.\n */\n private async ensureSyncConfigBlock(): Promise<boolean> {\n const wsConfig = this.deps.workspace.getWorkspaceConfig();\n const existing = wsConfig.extension(CiAspect.id, true) as CiWorkspaceConfig | undefined;\n if (existing?.sync) return false;\n wsConfig.setExtension(CiAspect.id, { sync: {} }, { mergeIntoExisting: true, ignoreVersion: true });\n await wsConfig.write({ reasonForChange: 'bit ci sync --init: add the sync config block' });\n return true;\n }\n\n /**\n * Why this lane name must not be handed to the lane executor, or undefined when it's syncable. The\n * mapped branch is checked too — the lane path must never write the two branches the main-scope\n * path owns.\n */\n private laneNotSyncableReason(\n laneName: string,\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): string | undefined {\n if (laneName === mainLaneName) {\n return `\"${mainLaneName}\" is not a lane — reconcile the main scope with \"bit ci sync --main\"; nothing to do`;\n }\n const branch = laneNameToBranch(laneName, cfg);\n if (branch === defaultBranch) {\n return (\n `lane ${laneName} maps to the default branch ${branch} — reconcile it with \"bit ci sync --main\"; ` +\n `nothing to do`\n );\n }\n if (branch === cfg.mainSyncBranch) {\n return `lane ${laneName} maps to ${branch}, the main sync branch maintained by this command; nothing to do`;\n }\n if (!shouldSyncLane(laneName, cfg)) {\n return `lane ${laneName} is not matched by the sync config (lanes: ${JSON.stringify(cfg.lanes)}); nothing to do`;\n }\n return undefined;\n }\n\n /**\n * The lanes to reconcile on an `--all` run (sorted by name), plus one HALTED line per enumeration\n * failure. The list is the union of the remote's lanes AND the lane-mapped branches on `origin` —\n * a lane deleted on bit.cloud is gone from the first source, and only the branch side can make\n * `close-pr` fire for it. An enumeration failure is reported rather than thrown, so the half that\n * did enumerate is still reconciled while the run exits non-zero.\n */\n private async listLanesToSync(\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string,\n laneSync: LaneSyncExecutor\n ): Promise<{ lanes: LaneTarget[]; errors: string[] }> {\n if (!cfg.lanes.length) {\n this.deps.logger.console(\n formatWarningSummary('sync.lanes is empty — lane mirroring is disabled, reconciling the main scope only')\n );\n return { lanes: [], errors: [] };\n }\n const errors: string[] = [];\n const targets = new Map<string, LaneTarget>();\n const add = (target: LaneTarget) => targets.set(`${target.hostScope}/${target.name}`, target);\n const remote = this.deps.workspace.defaultScope;\n\n try {\n const lanes = await this.deps.lanes.getLanes({ remote });\n lanes.forEach((lane) => {\n const name = lane.id?.name ?? lane.name;\n if (name) add({ hostScope: remote, name });\n });\n } catch (e: any) {\n const msg = e?.toString() ?? '';\n // A scope with no lanes at all: the remote answers \"not found\" rather than an empty list.\n if (msg.includes('was not found') || msg.includes('not found')) {\n this.deps.logger.console(\n formatWarningSummary(`No lanes found on ${remote} — reconciling lane-mapped branches and the main scope only`)\n );\n } else {\n errors.push(`${HALT_SUMMARY_PREFIX} lanes -> could not list the lanes of ${remote}: ${msg}`);\n }\n }\n\n try {\n for (const branch of await listRemoteBranches()) {\n // Reconciled by the main-scope path, never as lanes — under the default `branchPrefix: ''`\n // they would otherwise resolve to the bogus lanes \"main\" / \"bit-sync/main\".\n if (branch === defaultBranch || branch === cfg.mainSyncBranch) continue;\n // Ordinary developer branches are skipped at debug level, never as a summary line.\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) {\n this.deps.logger.debug(\n `bit ci sync: branch \"${branch}\" does not map to a name any lane could have ` +\n `(mapped to \"${branchToLaneName(branch, cfg) ?? '<not lane-mapped>'}\") — skipping it`\n );\n continue;\n }\n // oxlint-disable-next-line no-await-in-loop\n add(await this.branchLaneTarget(laneSync, branch, laneName));\n }\n } catch (e: any) {\n errors.push(\n `${HALT_SUMMARY_PREFIX} lanes -> could not list the branches of \"origin\", so a lane deleted on ` +\n `bit.cloud may have kept an orphan branch and an open PR: ${e?.message || e}`\n );\n }\n\n const lanes = [...targets.values()]\n .filter(({ name }) => name !== mainLaneName)\n .filter(({ name }) => shouldSyncLane(name, cfg))\n .sort((a, b) => a.name.localeCompare(b.name));\n return { lanes, errors };\n }\n\n /**\n * The lane a lane-mapped branch mirrors. A branch name carries no scope, so a lane that another scope\n * hosts is found only through the lane pointer in the branch's `.bitmap`. A pointer to a lane of\n * another name comes from a branch cut from that lane's branch, and must not redirect this one.\n */\n private async branchLaneTarget(laneSync: LaneSyncExecutor, branch: string, laneName: string): Promise<LaneTarget> {\n const defaultScope = this.deps.workspace.defaultScope;\n // a failed fetch must not throw here: syncLane fetches again and turns the failure into a halt\n await laneSync.fetchOnce().catch(() => undefined);\n const pointer = await readBranchLanePointer(branch, defaultScope);\n const target = pointer ? parseLaneTarget(pointer, defaultScope) : undefined;\n return target?.name === laneName ? target : { hostScope: defaultScope, name: laneName };\n }\n\n /**\n * Join the per-target summary lines, and turn any halt into a non-zero exit — the executors never\n * throw, so this is the single place \"needs a human\" becomes visible to CI. `BitError` rather than\n * `Error`: bit reports a plain `Error` as an internal failure (stack trace, Sentry FATAL).\n */\n private summarizeSync(lines: string[]): string {\n const summary = lines.join('\\n');\n const halted = lines.filter((line) => line.startsWith(HALT_SUMMARY_PREFIX));\n if (halted.length) {\n throw new BitError(`bit ci sync could not reconcile ${halted.length} target(s):\\n${summary}`);\n }\n // A refusal is not a halt: the repository is healthy, the reconciler simply will not do what was\n // asked — exit non-zero saying that, rather than reporting a sync conflict.\n const refusals = lines.filter((line) => line.startsWith(REFUSED_SUMMARY_PREFIX));\n if (refusals.length) {\n throw new B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kCAAqB,EAAC/J,MAAM,EAAEc,YAAY,CAAC;IACjE,MAAMyC,MAAM,GAAGuG,OAAO,GAAG,IAAApG,6BAAe,EAACoG,OAAO,EAAEhJ,YAAY,CAAC,GAAGR,SAAS;IAC3E,OAAOiD,MAAM,EAAEjC,IAAI,KAAK6B,QAAQ,GAAGI,MAAM,GAAG;MAAEwF,SAAS,EAAEjI,YAAY;MAAEQ,IAAI,EAAE6B;IAAS,CAAC;EACzF;;EAEA;AACF;AACA;AACA;AACA;EACUH,aAAaA,CAACY,KAAe,EAAU;IAC7C,MAAMoG,OAAO,GAAGpG,KAAK,CAACrE,IAAI,CAAC,IAAI,CAAC;IAChC,MAAM0K,MAAM,GAAGrG,KAAK,CAAC9F,MAAM,CAAEoM,IAAI,IAAKA,IAAI,CAAC7E,UAAU,CAAC+D,uCAAmB,CAAC,CAAC;IAC3E,IAAIa,MAAM,CAAC7L,MAAM,EAAE;MACjB,MAAM,KAAIoB,oBAAQ,EAAC,mCAAmCyK,MAAM,CAAC7L,MAAM,gBAAgB4L,OAAO,EAAE,CAAC;IAC/F;IACA;IACA;IACA,MAAMG,QAAQ,GAAGvG,KAAK,CAAC9F,MAAM,CAAEoM,IAAI,IAAKA,IAAI,CAAC7E,UAAU,CAAC+E,0CAAsB,CAAC,CAAC;IAChF,IAAID,QAAQ,CAAC/L,MAAM,EAAE;MACnB,MAAM,KAAIoB,oBAAQ,EAAC2K,QAAQ,CAACvI,GAAG,CAAEsI,IAAI,IAAKA,IAAI,CAAC5K,KAAK,CAAC8K,0CAAsB,CAAChM,MAAM,CAAC,CAACqE,IAAI,CAAC,CAAC,CAAC,CAAClD,IAAI,CAAC,IAAI,CAAC,CAAC;IACzG;IACA,OAAOyK,OAAO;EAChB;AACF;AAACK,OAAA,CAAA5K,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -141,6 +141,8 @@ export declare function statusReportsUnsyncedWork(status: {
|
|
|
141
141
|
* output is reachable — simple-git's `raw` resolves with it on some non-zero exits.
|
|
142
142
|
*/
|
|
143
143
|
export declare function parseDevCommitCount(raw: string): boolean;
|
|
144
|
+
/** The lane id in `origin/<branch>`'s `.bitmap`, if it has an exported one. Assumes `git fetch origin` already ran. */
|
|
145
|
+
export declare function readBranchLanePointer(branch: string, defaultScope: string): Promise<string | undefined>;
|
|
144
146
|
/**
|
|
145
147
|
* Read a remote branch's sync state from its committed `.bitmap`. Assumes `git fetch origin` already ran.
|
|
146
148
|
* `--first-parent` is a correctness requirement: `git log` orders across all parents, so a `.bitmap`
|
package/dist/sync/sync-state.js
CHANGED
|
@@ -14,6 +14,7 @@ exports.isSyncAuthoredMessage = isSyncAuthoredMessage;
|
|
|
14
14
|
exports.oldestCommitIsNonSync = oldestCommitIsNonSync;
|
|
15
15
|
exports.parseBranchBitmap = parseBranchBitmap;
|
|
16
16
|
exports.parseDevCommitCount = parseDevCommitCount;
|
|
17
|
+
exports.readBranchLanePointer = readBranchLanePointer;
|
|
17
18
|
exports.readBranchSyncState = readBranchSyncState;
|
|
18
19
|
exports.statusReportsUnsyncedWork = statusReportsUnsyncedWork;
|
|
19
20
|
exports.touchesBeyondBitmap = touchesBeyondBitmap;
|
|
@@ -197,6 +198,11 @@ function parseDevCommitCount(raw) {
|
|
|
197
198
|
return Number.isNaN(count) ? true : count > 0;
|
|
198
199
|
}
|
|
199
200
|
|
|
201
|
+
/** The lane id in `origin/<branch>`'s `.bitmap`, if it has an exported one. Assumes `git fetch origin` already ran. */
|
|
202
|
+
async function readBranchLanePointer(branch, defaultScope) {
|
|
203
|
+
return parseBranchBitmap(await readFileAtRef(`origin/${branch}`, _legacy2().BIT_MAP), defaultScope)?.laneIdStr;
|
|
204
|
+
}
|
|
205
|
+
|
|
200
206
|
/**
|
|
201
207
|
* Read a remote branch's sync state from its committed `.bitmap`. Assumes `git fetch origin` already ran.
|
|
202
208
|
* `--first-parent` is a correctness requirement: `git log` orders across all parents, so a `.bitmap`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_legacy","data","require","_legacy2","_toolboxCrypto","_git","parseBranchBitmap","content","defaultScope","trim","undefined","bitMap","BitMap","loadFromContentWithoutLoadingFiles","Buffer","from","versions","components","forEach","componentMap","version","id","toStringWithoutVersion","laneId","isLaneExported","laneIdStr","scope","toString","fingerprintIdVersions","idAtVersion","sha1","sort","join","ABSENT_ON_BRANCH","exports","branchStateFingerprint","state","laneComponentIds","map","NO_CHANGES_TO_SNAP","LANE_HEAD_TRAILER","SYNC_COMMIT_MARKER","CONFLICT_LABEL","hasSyncMarker","message","includes","isSyncAuthoredMessage","RegExp","replace","test","COMMIT_MESSAGE_RECORD_SEPARATOR","oldestCommitIsNonSync","rawLog","messages","split","entry","filter","Boolean","oldest","isLedgerCommitMessage","ADOPTION_TRAILER","buildSyncCommitMessage","laneHead","opts","slice","adopted","statusReportsUnsyncedWork","status","divergence","newComponents","modifiedComponents","stagedComponents","locallySoftRemoved","pendingUpdateDependents","mergePendingComponents","componentsDuringMergeState","invalidComponents","importPendingComponents","some","length","parseDevCommitCount","raw","count","Number","parseInt","isNaN","readBranchSyncState","branch","defaultBranch","revision","tipSha","git","tipMessage","trimEnd","stateCommit","BIT_MAP","bitmap","readFileAtRef","range","stateCommitBundlesSources","sourcesTouchedSincePreviousState","hasDevCommits","previousStateCommit","base","names","touchesBeyondBitmap","rawNames","name","branchBitmapUnchangedSinceFork","branchBlob","baseBlob","Promise","all","branchSha","filePath"],"sources":["sync-state.ts"],"sourcesContent":["import { BitMap } from '@teambit/legacy.bit-map';\nimport { BIT_MAP } from '@teambit/legacy.constants';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { git } from '../git';\n\n/**\n * Sync state is derived from the `.bitmap` committed on a branch — the lane pointer (`_bit_lane`) and the\n * per-component versions — never from commit messages, which are forgeable and rewritten by squash/rebase.\n */\n\n/** What a branch's committed `.bitmap` says about the branch's bit state. */\nexport type BranchBitmapState = {\n /**\n * The scope-qualified lane id `.bitmap` points at (`<scope>/<name>`), or undefined when there is no\n * usable pointer — none at all (branch on main), or one bit marked not exported.\n */\n laneIdStr?: string;\n /** `<scope>/<name>` -> version (a snap hash, or a semver tag on main), exactly as `.bitmap` records it. */\n versions: Record<string, string>;\n};\n\n/**\n * Parse a `.bitmap` file's content — no workspace, no filesystem. Fail-safe: an unreadable file returns\n * undefined, and a pointer that parses but cannot attribute (unscoped id, `exported: false`) withholds\n * `laneIdStr`; either way no lane id licenses nothing, so a parse failure can never authorize a deletion.\n * An unexported pointer is ignored because its lane never existed on any remote and treating it as a\n * mirror would retire the branch.\n */\nexport function parseBranchBitmap(content: string | undefined, defaultScope: string): BranchBitmapState | undefined {\n if (!content || !content.trim()) return undefined;\n try {\n const bitMap = BitMap.loadFromContentWithoutLoadingFiles(Buffer.from(content, 'utf8'), '', '', defaultScope);\n const versions: Record<string, string> = {};\n bitMap.components.forEach((componentMap) => {\n const version = componentMap.id.version;\n // No version = never snapped/tagged; contributes nothing to the fingerprint.\n if (version) versions[componentMap.id.toStringWithoutVersion()] = version;\n });\n // An unscoped lane id cannot be attribution: every comparison target is scope-qualified.\n const laneId = bitMap.isLaneExported ? bitMap.laneId : undefined;\n const laneIdStr = laneId?.scope ? laneId.toString() : undefined;\n return { laneIdStr, versions };\n } catch {\n return undefined;\n }\n}\n\n/**\n * Fingerprint of `<component-id>@<version>` pairs: sorted (so listing/key order cannot perturb it), then\n * sha1'd (the value doubles as a single-token `Bit-Lane-Head` trailer).\n */\nexport function fingerprintIdVersions(idAtVersion: string[]): string {\n return sha1([...idAtVersion].sort().join('\\n'));\n}\n\n/**\n * Placeholder for a lane component the branch's `.bitmap` lacks. It must participate in the fingerprint,\n * or \"the lane grew a component\" would fingerprint identically to \"converged\".\n */\nexport const ABSENT_ON_BRANCH = '<absent>';\n\n/**\n * What the branch reflects, comparable to the lane's own fingerprint. Only the lane's components count:\n * the `.bitmap` also carries non-lane components at their main versions, and including those would make\n * an untouched pair read as diverged after any unrelated release.\n */\nexport function branchStateFingerprint(state: BranchBitmapState, laneComponentIds: string[]): string {\n return fingerprintIdVersions(laneComponentIds.map((id) => `${id}@${state.versions[id] ?? ABSENT_ON_BRANCH}`));\n}\n\n/**\n * `snapPrCommit`'s return value when there was nothing to snap — its only signal either way. Lives in\n * this leaf module so `ci.main.runtime.ts` and `lane-sync-executor.ts` share it without a cycle.\n */\nexport const NO_CHANGES_TO_SNAP = 'No changes detected, nothing to snap';\n\nexport const LANE_HEAD_TRAILER = 'Bit-Lane-Head';\n/**\n * Marks a commit as machine-generated. Duplicated in the `bit-git-sync` action repo's event router\n * (the loop guard) — changing one copy without the other makes the reconciler re-trigger itself.\n */\nexport const SYNC_COMMIT_MARKER = '[bit-sync]';\nexport const CONFLICT_LABEL = 'bit-sync-conflict';\n\n/**\n * Permissive substring probe for \"looks machine-generated\" — the loop guard. Must NOT decide anything\n * irreversible; see `isSyncAuthoredMessage`.\n */\nexport function hasSyncMarker(message: string): boolean {\n return message.includes(SYNC_COMMIT_MARKER);\n}\n\n/**\n * Strict probe for \"we wrote this commit\": the marker alone on its own line. This is an input to branch\n * DELETION only — the one decision no content probe can stand in for, because the lane it would compare\n * against is gone. It must never decide convergence: a squash-merge's body quotes the squashed ledger\n * messages verbatim, marker included, so a message can claim authorship the reconciler never had.\n * `\\r?` tolerates CRLF; a recognition failure errs toward keeping the branch.\n */\nexport function isSyncAuthoredMessage(message: string): boolean {\n return new RegExp(`^${SYNC_COMMIT_MARKER.replace(/[[\\]]/g, '\\\\$&')}\\\\r?$`, 'm').test(message);\n}\n\n/** The record separator `hasIndependentHistoryBelowStateCommit`'s `git log --format=%B%x1e` uses. */\nconst COMMIT_MESSAGE_RECORD_SEPARATOR = '\\x1e';\n\n/**\n * Whether the OLDEST record of a `git log --reverse --format=%B%x1e` run is NOT bit-authored — i.e. a\n * human created the branch before this reconciler touched it. Oldest only, not \"any\": ordinary lane\n * branches carry real dev commits between ledger commits too, and \"any\" would misclassify them all.\n */\nexport function oldestCommitIsNonSync(rawLog: string): boolean {\n const messages = rawLog\n .split(COMMIT_MESSAGE_RECORD_SEPARATOR)\n .map((entry) => entry.trim())\n .filter(Boolean);\n const oldest = messages[0];\n return oldest !== undefined && !isLedgerCommitMessage(oldest);\n}\n\n/**\n * Strict probe for \"this is one of our LEDGER commits\": the sync marker on its own line AND the\n * `Bit-Lane-Head` trailer — `buildSyncCommitMessage` always writes both. The deletion guard reads\n * this instead of `isSyncAuthoredMessage` so a human commit merely quoting `[bit-sync]` still counts\n * as independent history (a false \"human\" only ever keeps a branch).\n */\nexport function isLedgerCommitMessage(message: string): boolean {\n return isSyncAuthoredMessage(message) && new RegExp(`^${LANE_HEAD_TRAILER}: `, 'm').test(message);\n}\n\n/**\n * Marks `adopt-branch`'s ledger commit. Audit-only — the deletion guard reads the branch's ancestry\n * instead, since a trailer marks only the one commit it is on and later ledger commits carry none.\n */\nexport const ADOPTION_TRAILER = 'Bit-Adopted';\n\n/**\n * The sync commit's message. Every part is an annotation (audit trail + loop-guard marker); nothing reads\n * it as state — messages are forgeable and rewritten on squash-merge. State comes from `.bitmap`.\n */\nexport function buildSyncCommitMessage(laneIdStr: string, laneHead: string, opts: { adopted?: boolean } = {}): string {\n return [\n `chore(bit-sync): sync lane ${laneIdStr} @ ${laneHead.slice(0, 9)}`,\n '',\n `${LANE_HEAD_TRAILER}: ${laneHead}`,\n ...(opts.adopted ? [`${ADOPTION_TRAILER}: true`] : []),\n SYNC_COMMIT_MARKER,\n ].join('\\n');\n}\n\nexport type BranchSyncState = {\n /**\n * The newest first-parent commit that changed `.bitmap` — the reachability anchor for branch ownership\n * and the baseline for `hasDevCommits`. Undefined when `.bitmap` was never written on the branch.\n */\n stateCommit?: string;\n /**\n * The branch tip's `.bitmap`, parsed; undefined when absent/unparseable (treated as \"not ours\").\n * Reading at the tip equals reading at `stateCommit` — nothing after it changed the file.\n */\n bitmap?: BranchBitmapState;\n /** Whether the branch carries commits on top of its bit state — work bit has not seen. */\n hasDevCommits: boolean;\n /**\n * Whether the state commit also touched files besides `.bitmap`. SUSPECTED work only: those files\n * may already be inside the snap the `.bitmap` records, which git cannot tell — the executor's\n * read-only status probe is what distinguishes real work. True for ANY other path (`docs/`, CI\n * config, this reconciler's own source-bundling ledger commits): a spurious `true` re-probes, which\n * writes nothing, so it can repeat without consequence.\n */\n stateCommitBundlesSources: boolean;\n /** The branch tip's full commit message (subject + body), for the sync-marker loop-guard probe. */\n tipMessage: string;\n /**\n * The tip sha every field above was read from. The retirement path re-reads the branch and refuses to\n * delete anything else — the evidence licensed deleting THIS commit, not a later one.\n */\n tipSha?: string;\n};\n\n/**\n * The pure half of `hasUnsyncedWorkChanges` (ci.main.runtime.ts): whether a `bit status` result holds\n * anything a snap/export would push. The unloadable categories count as work: `invalidComponents` AND\n * `importPendingComponents` (`StatusMain` splits pending-import errors out of the invalid list) are\n * both UNKNOWN — their sources may hold the branch's edits — and this answer gates a \"converged,\n * write nothing\" exit, so not knowing must route to the snap (which fails loudly) rather than\n * converge. Incoming-change categories (outdated, pending updates from main) deliberately do NOT\n * count: they are the lane's or main's movement, which the planner routes, not branch work.\n */\nexport function statusReportsUnsyncedWork(status: {\n newComponents: unknown[];\n modifiedComponents: unknown[];\n stagedComponents: unknown[];\n locallySoftRemoved: unknown[];\n pendingUpdateDependents: unknown[];\n mergePendingComponents: unknown[];\n componentsDuringMergeState: unknown[];\n invalidComponents: unknown[];\n importPendingComponents: unknown[];\n}): boolean {\n const divergence = [\n status.newComponents,\n status.modifiedComponents,\n status.stagedComponents,\n status.locallySoftRemoved,\n status.pendingUpdateDependents,\n status.mergePendingComponents,\n status.componentsDuringMergeState,\n status.invalidComponents,\n status.importPendingComponents,\n ];\n return divergence.some((components) => components.length > 0);\n}\n\n/**\n * Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an\n * input to branch retirement, so not knowing must withhold a deletion rather than license one. Empty\n * output is reachable — simple-git's `raw` resolves with it on some non-zero exits.\n */\nexport function parseDevCommitCount(raw: string): boolean {\n const count = Number.parseInt(raw.trim(), 10);\n return Number.isNaN(count) ? true : count > 0;\n}\n\n/**\n * Read a remote branch's sync state from its committed `.bitmap`. Assumes `git fetch origin` already ran.\n * `--first-parent` is a correctness requirement: `git log` orders across all parents, so a `.bitmap`\n * change that arrived through a merge would otherwise be picked as this branch's own state commit.\n */\nexport async function readBranchSyncState(\n branch: string,\n defaultBranch: string,\n defaultScope: string\n): Promise<BranchSyncState> {\n const revision = `origin/${branch}`;\n const tipSha = (await git.raw(['rev-parse', revision])).trim() || undefined;\n const tipMessage = (await git.raw(['log', revision, '-n', '1', '--format=%B'])).trimEnd();\n const stateCommit =\n (await git.raw(['log', revision, '--first-parent', '-n', '1', '--format=%H', '--', BIT_MAP])).trim() || undefined;\n\n const bitmap = parseBranchBitmap(await readFileAtRef(revision, BIT_MAP), defaultScope);\n\n const range = stateCommit ? `${stateCommit}..${revision}` : `origin/${defaultBranch}..${revision}`;\n const count = await git.raw(['rev-list', range, '--count']);\n\n // Source edits can HIDE AT OR BELOW the state commit — bundled into it (the conflict-halt comment's\n // resolve-by-hand recipe), or in an earlier commit that a later `.bitmap`-only commit covers — and\n // `hasDevCommits` starts counting only after it, so they were invisible. Git file names alone cannot\n // tell whether those sources are already inside the snap the `.bitmap` records (a dev who snapped,\n // exported, and committed everything at once) or were never snapped at all — so this is SUSPECTED\n // work, computed over the whole range since the PREVIOUS state commit (the last point a `.bitmap`\n // write could have accounted for sources) and reported separately for the planner to probe.\n // Deliberately content-only, per this module's header: this reconciler's own ledger commits have the\n // same shape (import-lane and merge-diverged bundle already-exported sources) and its probe is a\n // read, so a spurious `true` costs one status check — while consulting the tip's MESSAGE here read a\n // squash-merge (whose body quotes the squashed ledger messages, marker included) as machine-authored\n // and silently dropped the bundled work.\n const stateCommitBundlesSources =\n !parseDevCommitCount(count) &&\n stateCommit !== undefined &&\n stateCommit === tipSha &&\n (await sourcesTouchedSincePreviousState(revision, defaultBranch));\n\n return {\n stateCommit,\n bitmap,\n hasDevCommits: parseDevCommitCount(count),\n stateCommitBundlesSources,\n tipMessage,\n tipSha,\n };\n}\n\n/**\n * Whether any file besides `.bitmap` changed between the PREVIOUS `.bitmap`-writing commit (or, on a\n * branch with only one, its fork point off the default branch) and the tip. A tree diff over the\n * whole range, not a per-commit walk: a source edit in one commit followed by a `.bitmap`-only commit\n * would be invisible to a single-commit check, and a later revert legitimately cancels out.\n * Unreadable answers `true`: this feeds `stateCommitBundlesSources`, where not knowing must plan the\n * probe, never declare convergence.\n */\nasync function sourcesTouchedSincePreviousState(revision: string, defaultBranch: string): Promise<boolean> {\n try {\n const previousStateCommit = (\n await git.raw(['log', revision, '--first-parent', '-n', '1', '--skip', '1', '--format=%H', '--', BIT_MAP])\n ).trim();\n const base = previousStateCommit || (await git.raw(['merge-base', `origin/${defaultBranch}`, revision])).trim();\n if (!base) return true;\n const names = await git.raw(['diff', '--name-only', `${base}..${revision}`]);\n // Empty is legitimate here (a range whose edits cancel out), unlike a single state commit's diff.\n return touchesBeyondBitmap(names);\n } catch {\n return true;\n }\n}\n\n/** The pure half of `commitTouchesBeyondBitmap`, split out so it is testable without a real git log. */\nexport function touchesBeyondBitmap(rawNames: string): boolean {\n return rawNames\n .split('\\n')\n .map((name) => name.trim())\n .filter(Boolean)\n .some((name) => name !== BIT_MAP);\n}\n\n/**\n * Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base\n * with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever\n * pointer it carries is INHERITED. Compared at the fork point, not the default branch's current tip,\n * which moves on and would false-block. False on any git error: unreadable must not license adoption.\n */\nexport async function branchBitmapUnchangedSinceFork(branch: string, defaultBranch: string): Promise<boolean> {\n try {\n const base = (await git.raw(['merge-base', `origin/${defaultBranch}`, `origin/${branch}`])).trim();\n if (!base) return false;\n const [branchBlob, baseBlob] = await Promise.all([\n git.raw(['rev-parse', `origin/${branch}:./${BIT_MAP}`]),\n git.raw(['rev-parse', `${base}:./${BIT_MAP}`]),\n ]);\n const branchSha = branchBlob.trim();\n return Boolean(branchSha) && branchSha === baseBlob.trim();\n } catch {\n return false;\n }\n}\n\n/**\n * A file's content at a git ref, or undefined when it isn't there. simple-git's `raw` can resolve with\n * empty output instead of rejecting on a missing path; `:./` keeps the path cwd-relative in case the\n * workspace is a subdirectory of the repo.\n */\nasync function readFileAtRef(revision: string, filePath: string): Promise<string | undefined> {\n try {\n return await git.raw(['show', `${revision}:./${filePath}`]);\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;;AAEA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,iBAAiBA,CAACC,OAA2B,EAAEC,YAAoB,EAAiC;EAClH,IAAI,CAACD,OAAO,IAAI,CAACA,OAAO,CAACE,IAAI,CAAC,CAAC,EAAE,OAAOC,SAAS;EACjD,IAAI;IACF,MAAMC,MAAM,GAAGC,gBAAM,CAACC,kCAAkC,CAACC,MAAM,CAACC,IAAI,CAACR,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAEC,YAAY,CAAC;IAC5G,MAAMQ,QAAgC,GAAG,CAAC,CAAC;I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UAAUO,aAAa,EAAE,EAAE,UAAUD,MAAM,EAAE,CAAC,CAAC,EAAE9E,IAAI,CAAC,CAAC;IAClG,IAAI,CAAC8F,IAAI,EAAE,OAAO,KAAK;IACvB,MAAM,CAACM,UAAU,EAAEC,QAAQ,CAAC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC,CAC/CrB,UAAG,CAACV,GAAG,CAAC,CAAC,WAAW,EAAE,UAAUM,MAAM,MAAMQ,kBAAO,EAAE,CAAC,CAAC,EACvDJ,UAAG,CAACV,GAAG,CAAC,CAAC,WAAW,EAAE,GAAGsB,IAAI,MAAMR,kBAAO,EAAE,CAAC,CAAC,CAC/C,CAAC;IACF,MAAMkB,SAAS,GAAGJ,UAAU,CAACpG,IAAI,CAAC,CAAC;IACnC,OAAOgD,OAAO,CAACwD,SAAS,CAAC,IAAIA,SAAS,KAAKH,QAAQ,CAACrG,IAAI,CAAC,CAAC;EAC5D,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAewF,aAAaA,CAACR,QAAgB,EAAEyB,QAAgB,EAA+B;EAC5F,IAAI;IACF,OAAO,MAAMvB,UAAG,CAACV,GAAG,CAAC,CAAC,MAAM,EAAE,GAAGQ,QAAQ,MAAMyB,QAAQ,EAAE,CAAC,CAAC;EAC7D,CAAC,CAAC,MAAM;IACN,OAAOxG,SAAS;EAClB;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_legacy","data","require","_legacy2","_toolboxCrypto","_git","parseBranchBitmap","content","defaultScope","trim","undefined","bitMap","BitMap","loadFromContentWithoutLoadingFiles","Buffer","from","versions","components","forEach","componentMap","version","id","toStringWithoutVersion","laneId","isLaneExported","laneIdStr","scope","toString","fingerprintIdVersions","idAtVersion","sha1","sort","join","ABSENT_ON_BRANCH","exports","branchStateFingerprint","state","laneComponentIds","map","NO_CHANGES_TO_SNAP","LANE_HEAD_TRAILER","SYNC_COMMIT_MARKER","CONFLICT_LABEL","hasSyncMarker","message","includes","isSyncAuthoredMessage","RegExp","replace","test","COMMIT_MESSAGE_RECORD_SEPARATOR","oldestCommitIsNonSync","rawLog","messages","split","entry","filter","Boolean","oldest","isLedgerCommitMessage","ADOPTION_TRAILER","buildSyncCommitMessage","laneHead","opts","slice","adopted","statusReportsUnsyncedWork","status","divergence","newComponents","modifiedComponents","stagedComponents","locallySoftRemoved","pendingUpdateDependents","mergePendingComponents","componentsDuringMergeState","invalidComponents","importPendingComponents","some","length","parseDevCommitCount","raw","count","Number","parseInt","isNaN","readBranchLanePointer","branch","readFileAtRef","BIT_MAP","readBranchSyncState","defaultBranch","revision","tipSha","git","tipMessage","trimEnd","stateCommit","bitmap","range","stateCommitBundlesSources","sourcesTouchedSincePreviousState","hasDevCommits","previousStateCommit","base","names","touchesBeyondBitmap","rawNames","name","branchBitmapUnchangedSinceFork","branchBlob","baseBlob","Promise","all","branchSha","filePath"],"sources":["sync-state.ts"],"sourcesContent":["import { BitMap } from '@teambit/legacy.bit-map';\nimport { BIT_MAP } from '@teambit/legacy.constants';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { git } from '../git';\n\n/**\n * Sync state is derived from the `.bitmap` committed on a branch — the lane pointer (`_bit_lane`) and the\n * per-component versions — never from commit messages, which are forgeable and rewritten by squash/rebase.\n */\n\n/** What a branch's committed `.bitmap` says about the branch's bit state. */\nexport type BranchBitmapState = {\n /**\n * The scope-qualified lane id `.bitmap` points at (`<scope>/<name>`), or undefined when there is no\n * usable pointer — none at all (branch on main), or one bit marked not exported.\n */\n laneIdStr?: string;\n /** `<scope>/<name>` -> version (a snap hash, or a semver tag on main), exactly as `.bitmap` records it. */\n versions: Record<string, string>;\n};\n\n/**\n * Parse a `.bitmap` file's content — no workspace, no filesystem. Fail-safe: an unreadable file returns\n * undefined, and a pointer that parses but cannot attribute (unscoped id, `exported: false`) withholds\n * `laneIdStr`; either way no lane id licenses nothing, so a parse failure can never authorize a deletion.\n * An unexported pointer is ignored because its lane never existed on any remote and treating it as a\n * mirror would retire the branch.\n */\nexport function parseBranchBitmap(content: string | undefined, defaultScope: string): BranchBitmapState | undefined {\n if (!content || !content.trim()) return undefined;\n try {\n const bitMap = BitMap.loadFromContentWithoutLoadingFiles(Buffer.from(content, 'utf8'), '', '', defaultScope);\n const versions: Record<string, string> = {};\n bitMap.components.forEach((componentMap) => {\n const version = componentMap.id.version;\n // No version = never snapped/tagged; contributes nothing to the fingerprint.\n if (version) versions[componentMap.id.toStringWithoutVersion()] = version;\n });\n // An unscoped lane id cannot be attribution: every comparison target is scope-qualified.\n const laneId = bitMap.isLaneExported ? bitMap.laneId : undefined;\n const laneIdStr = laneId?.scope ? laneId.toString() : undefined;\n return { laneIdStr, versions };\n } catch {\n return undefined;\n }\n}\n\n/**\n * Fingerprint of `<component-id>@<version>` pairs: sorted (so listing/key order cannot perturb it), then\n * sha1'd (the value doubles as a single-token `Bit-Lane-Head` trailer).\n */\nexport function fingerprintIdVersions(idAtVersion: string[]): string {\n return sha1([...idAtVersion].sort().join('\\n'));\n}\n\n/**\n * Placeholder for a lane component the branch's `.bitmap` lacks. It must participate in the fingerprint,\n * or \"the lane grew a component\" would fingerprint identically to \"converged\".\n */\nexport const ABSENT_ON_BRANCH = '<absent>';\n\n/**\n * What the branch reflects, comparable to the lane's own fingerprint. Only the lane's components count:\n * the `.bitmap` also carries non-lane components at their main versions, and including those would make\n * an untouched pair read as diverged after any unrelated release.\n */\nexport function branchStateFingerprint(state: BranchBitmapState, laneComponentIds: string[]): string {\n return fingerprintIdVersions(laneComponentIds.map((id) => `${id}@${state.versions[id] ?? ABSENT_ON_BRANCH}`));\n}\n\n/**\n * `snapPrCommit`'s return value when there was nothing to snap — its only signal either way. Lives in\n * this leaf module so `ci.main.runtime.ts` and `lane-sync-executor.ts` share it without a cycle.\n */\nexport const NO_CHANGES_TO_SNAP = 'No changes detected, nothing to snap';\n\nexport const LANE_HEAD_TRAILER = 'Bit-Lane-Head';\n/**\n * Marks a commit as machine-generated. Duplicated in the `bit-git-sync` action repo's event router\n * (the loop guard) — changing one copy without the other makes the reconciler re-trigger itself.\n */\nexport const SYNC_COMMIT_MARKER = '[bit-sync]';\nexport const CONFLICT_LABEL = 'bit-sync-conflict';\n\n/**\n * Permissive substring probe for \"looks machine-generated\" — the loop guard. Must NOT decide anything\n * irreversible; see `isSyncAuthoredMessage`.\n */\nexport function hasSyncMarker(message: string): boolean {\n return message.includes(SYNC_COMMIT_MARKER);\n}\n\n/**\n * Strict probe for \"we wrote this commit\": the marker alone on its own line. This is an input to branch\n * DELETION only — the one decision no content probe can stand in for, because the lane it would compare\n * against is gone. It must never decide convergence: a squash-merge's body quotes the squashed ledger\n * messages verbatim, marker included, so a message can claim authorship the reconciler never had.\n * `\\r?` tolerates CRLF; a recognition failure errs toward keeping the branch.\n */\nexport function isSyncAuthoredMessage(message: string): boolean {\n return new RegExp(`^${SYNC_COMMIT_MARKER.replace(/[[\\]]/g, '\\\\$&')}\\\\r?$`, 'm').test(message);\n}\n\n/** The record separator `hasIndependentHistoryBelowStateCommit`'s `git log --format=%B%x1e` uses. */\nconst COMMIT_MESSAGE_RECORD_SEPARATOR = '\\x1e';\n\n/**\n * Whether the OLDEST record of a `git log --reverse --format=%B%x1e` run is NOT bit-authored — i.e. a\n * human created the branch before this reconciler touched it. Oldest only, not \"any\": ordinary lane\n * branches carry real dev commits between ledger commits too, and \"any\" would misclassify them all.\n */\nexport function oldestCommitIsNonSync(rawLog: string): boolean {\n const messages = rawLog\n .split(COMMIT_MESSAGE_RECORD_SEPARATOR)\n .map((entry) => entry.trim())\n .filter(Boolean);\n const oldest = messages[0];\n return oldest !== undefined && !isLedgerCommitMessage(oldest);\n}\n\n/**\n * Strict probe for \"this is one of our LEDGER commits\": the sync marker on its own line AND the\n * `Bit-Lane-Head` trailer — `buildSyncCommitMessage` always writes both. The deletion guard reads\n * this instead of `isSyncAuthoredMessage` so a human commit merely quoting `[bit-sync]` still counts\n * as independent history (a false \"human\" only ever keeps a branch).\n */\nexport function isLedgerCommitMessage(message: string): boolean {\n return isSyncAuthoredMessage(message) && new RegExp(`^${LANE_HEAD_TRAILER}: `, 'm').test(message);\n}\n\n/**\n * Marks `adopt-branch`'s ledger commit. Audit-only — the deletion guard reads the branch's ancestry\n * instead, since a trailer marks only the one commit it is on and later ledger commits carry none.\n */\nexport const ADOPTION_TRAILER = 'Bit-Adopted';\n\n/**\n * The sync commit's message. Every part is an annotation (audit trail + loop-guard marker); nothing reads\n * it as state — messages are forgeable and rewritten on squash-merge. State comes from `.bitmap`.\n */\nexport function buildSyncCommitMessage(laneIdStr: string, laneHead: string, opts: { adopted?: boolean } = {}): string {\n return [\n `chore(bit-sync): sync lane ${laneIdStr} @ ${laneHead.slice(0, 9)}`,\n '',\n `${LANE_HEAD_TRAILER}: ${laneHead}`,\n ...(opts.adopted ? [`${ADOPTION_TRAILER}: true`] : []),\n SYNC_COMMIT_MARKER,\n ].join('\\n');\n}\n\nexport type BranchSyncState = {\n /**\n * The newest first-parent commit that changed `.bitmap` — the reachability anchor for branch ownership\n * and the baseline for `hasDevCommits`. Undefined when `.bitmap` was never written on the branch.\n */\n stateCommit?: string;\n /**\n * The branch tip's `.bitmap`, parsed; undefined when absent/unparseable (treated as \"not ours\").\n * Reading at the tip equals reading at `stateCommit` — nothing after it changed the file.\n */\n bitmap?: BranchBitmapState;\n /** Whether the branch carries commits on top of its bit state — work bit has not seen. */\n hasDevCommits: boolean;\n /**\n * Whether the state commit also touched files besides `.bitmap`. SUSPECTED work only: those files\n * may already be inside the snap the `.bitmap` records, which git cannot tell — the executor's\n * read-only status probe is what distinguishes real work. True for ANY other path (`docs/`, CI\n * config, this reconciler's own source-bundling ledger commits): a spurious `true` re-probes, which\n * writes nothing, so it can repeat without consequence.\n */\n stateCommitBundlesSources: boolean;\n /** The branch tip's full commit message (subject + body), for the sync-marker loop-guard probe. */\n tipMessage: string;\n /**\n * The tip sha every field above was read from. The retirement path re-reads the branch and refuses to\n * delete anything else — the evidence licensed deleting THIS commit, not a later one.\n */\n tipSha?: string;\n};\n\n/**\n * The pure half of `hasUnsyncedWorkChanges` (ci.main.runtime.ts): whether a `bit status` result holds\n * anything a snap/export would push. The unloadable categories count as work: `invalidComponents` AND\n * `importPendingComponents` (`StatusMain` splits pending-import errors out of the invalid list) are\n * both UNKNOWN — their sources may hold the branch's edits — and this answer gates a \"converged,\n * write nothing\" exit, so not knowing must route to the snap (which fails loudly) rather than\n * converge. Incoming-change categories (outdated, pending updates from main) deliberately do NOT\n * count: they are the lane's or main's movement, which the planner routes, not branch work.\n */\nexport function statusReportsUnsyncedWork(status: {\n newComponents: unknown[];\n modifiedComponents: unknown[];\n stagedComponents: unknown[];\n locallySoftRemoved: unknown[];\n pendingUpdateDependents: unknown[];\n mergePendingComponents: unknown[];\n componentsDuringMergeState: unknown[];\n invalidComponents: unknown[];\n importPendingComponents: unknown[];\n}): boolean {\n const divergence = [\n status.newComponents,\n status.modifiedComponents,\n status.stagedComponents,\n status.locallySoftRemoved,\n status.pendingUpdateDependents,\n status.mergePendingComponents,\n status.componentsDuringMergeState,\n status.invalidComponents,\n status.importPendingComponents,\n ];\n return divergence.some((components) => components.length > 0);\n}\n\n/**\n * Whether a `rev-list --count` output reports commits. An unreadable count answers `true`: `false` is an\n * input to branch retirement, so not knowing must withhold a deletion rather than license one. Empty\n * output is reachable — simple-git's `raw` resolves with it on some non-zero exits.\n */\nexport function parseDevCommitCount(raw: string): boolean {\n const count = Number.parseInt(raw.trim(), 10);\n return Number.isNaN(count) ? true : count > 0;\n}\n\n/** The lane id in `origin/<branch>`'s `.bitmap`, if it has an exported one. Assumes `git fetch origin` already ran. */\nexport async function readBranchLanePointer(branch: string, defaultScope: string): Promise<string | undefined> {\n return parseBranchBitmap(await readFileAtRef(`origin/${branch}`, BIT_MAP), defaultScope)?.laneIdStr;\n}\n\n/**\n * Read a remote branch's sync state from its committed `.bitmap`. Assumes `git fetch origin` already ran.\n * `--first-parent` is a correctness requirement: `git log` orders across all parents, so a `.bitmap`\n * change that arrived through a merge would otherwise be picked as this branch's own state commit.\n */\nexport async function readBranchSyncState(\n branch: string,\n defaultBranch: string,\n defaultScope: string\n): Promise<BranchSyncState> {\n const revision = `origin/${branch}`;\n const tipSha = (await git.raw(['rev-parse', revision])).trim() || undefined;\n const tipMessage = (await git.raw(['log', revision, '-n', '1', '--format=%B'])).trimEnd();\n const stateCommit =\n (await git.raw(['log', revision, '--first-parent', '-n', '1', '--format=%H', '--', BIT_MAP])).trim() || undefined;\n\n const bitmap = parseBranchBitmap(await readFileAtRef(revision, BIT_MAP), defaultScope);\n\n const range = stateCommit ? `${stateCommit}..${revision}` : `origin/${defaultBranch}..${revision}`;\n const count = await git.raw(['rev-list', range, '--count']);\n\n // Source edits can HIDE AT OR BELOW the state commit — bundled into it (the conflict-halt comment's\n // resolve-by-hand recipe), or in an earlier commit that a later `.bitmap`-only commit covers — and\n // `hasDevCommits` starts counting only after it, so they were invisible. Git file names alone cannot\n // tell whether those sources are already inside the snap the `.bitmap` records (a dev who snapped,\n // exported, and committed everything at once) or were never snapped at all — so this is SUSPECTED\n // work, computed over the whole range since the PREVIOUS state commit (the last point a `.bitmap`\n // write could have accounted for sources) and reported separately for the planner to probe.\n // Deliberately content-only, per this module's header: this reconciler's own ledger commits have the\n // same shape (import-lane and merge-diverged bundle already-exported sources) and its probe is a\n // read, so a spurious `true` costs one status check — while consulting the tip's MESSAGE here read a\n // squash-merge (whose body quotes the squashed ledger messages, marker included) as machine-authored\n // and silently dropped the bundled work.\n const stateCommitBundlesSources =\n !parseDevCommitCount(count) &&\n stateCommit !== undefined &&\n stateCommit === tipSha &&\n (await sourcesTouchedSincePreviousState(revision, defaultBranch));\n\n return {\n stateCommit,\n bitmap,\n hasDevCommits: parseDevCommitCount(count),\n stateCommitBundlesSources,\n tipMessage,\n tipSha,\n };\n}\n\n/**\n * Whether any file besides `.bitmap` changed between the PREVIOUS `.bitmap`-writing commit (or, on a\n * branch with only one, its fork point off the default branch) and the tip. A tree diff over the\n * whole range, not a per-commit walk: a source edit in one commit followed by a `.bitmap`-only commit\n * would be invisible to a single-commit check, and a later revert legitimately cancels out.\n * Unreadable answers `true`: this feeds `stateCommitBundlesSources`, where not knowing must plan the\n * probe, never declare convergence.\n */\nasync function sourcesTouchedSincePreviousState(revision: string, defaultBranch: string): Promise<boolean> {\n try {\n const previousStateCommit = (\n await git.raw(['log', revision, '--first-parent', '-n', '1', '--skip', '1', '--format=%H', '--', BIT_MAP])\n ).trim();\n const base = previousStateCommit || (await git.raw(['merge-base', `origin/${defaultBranch}`, revision])).trim();\n if (!base) return true;\n const names = await git.raw(['diff', '--name-only', `${base}..${revision}`]);\n // Empty is legitimate here (a range whose edits cancel out), unlike a single state commit's diff.\n return touchesBeyondBitmap(names);\n } catch {\n return true;\n }\n}\n\n/** The pure half of `commitTouchesBeyondBitmap`, split out so it is testable without a real git log. */\nexport function touchesBeyondBitmap(rawNames: string): boolean {\n return rawNames\n .split('\\n')\n .map((name) => name.trim())\n .filter(Boolean)\n .some((name) => name !== BIT_MAP);\n}\n\n/**\n * Whether `branch`'s committed `.bitmap` is byte-identical (by blob sha) to the one at its merge-base\n * with the default branch — i.e. the branch never asserted a `.bitmap` change of its own, so whatever\n * pointer it carries is INHERITED. Compared at the fork point, not the default branch's current tip,\n * which moves on and would false-block. False on any git error: unreadable must not license adoption.\n */\nexport async function branchBitmapUnchangedSinceFork(branch: string, defaultBranch: string): Promise<boolean> {\n try {\n const base = (await git.raw(['merge-base', `origin/${defaultBranch}`, `origin/${branch}`])).trim();\n if (!base) return false;\n const [branchBlob, baseBlob] = await Promise.all([\n git.raw(['rev-parse', `origin/${branch}:./${BIT_MAP}`]),\n git.raw(['rev-parse', `${base}:./${BIT_MAP}`]),\n ]);\n const branchSha = branchBlob.trim();\n return Boolean(branchSha) && branchSha === baseBlob.trim();\n } catch {\n return false;\n }\n}\n\n/**\n * A file's content at a git ref, or undefined when it isn't there. simple-git's `raw` can resolve with\n * empty output instead of rejecting on a missing path; `:./` keeps the path cwd-relative in case the\n * workspace is a subdirectory of the repo.\n */\nasync function readFileAtRef(revision: string, filePath: string): Promise<string | undefined> {\n try {\n return await git.raw(['show', `${revision}:./${filePath}`]);\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;;AAEA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,iBAAiBA,CAACC,OAA2B,EAAEC,YAAoB,EAAiC;EAClH,IAAI,CAACD,OAAO,IAAI,CAACA,OAAO,CAACE,IAAI,CAAC,CAAC,EAAE,OAAOC,SAAS;EACjD,IAAI;IACF,MAAMC,MAAM,GAAGC,gBAAM,CAACC,kCAAkC,CAACC,MAAM,CAACC,IAAI,CAACR,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAEC,YAAY,CAAC;IAC5G,MAAMQ,QAAgC,GAAG,CAAC,CAAC;IAC3CL,MAAM,CAACM,UAAU,CAACC,OAAO,CAAEC,YAAY,IAAK;MAC1C,MAAMC,OAAO,GAAGD,YAAY,CAACE,EAAE,CAACD,OAAO;MACvC;MACA,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,IAAI,GAAG,CAAC,MAAMV,UAAG,CAACb,GAAG,CAAC,CAAC,YAAY,EAAE,UAAUU,aAAa,EAAE,EAAE,UAAUJ,MAAM,EAAE,CAAC,CAAC,EAAE9E,IAAI,CAAC,CAAC;IAClG,IAAI,CAAC+F,IAAI,EAAE,OAAO,KAAK;IACvB,MAAM,CAACM,UAAU,EAAEC,QAAQ,CAAC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC,CAC/CnB,UAAG,CAACb,GAAG,CAAC,CAAC,WAAW,EAAE,UAAUM,MAAM,MAAME,kBAAO,EAAE,CAAC,CAAC,EACvDK,UAAG,CAACb,GAAG,CAAC,CAAC,WAAW,EAAE,GAAGuB,IAAI,MAAMf,kBAAO,EAAE,CAAC,CAAC,CAC/C,CAAC;IACF,MAAMyB,SAAS,GAAGJ,UAAU,CAACrG,IAAI,CAAC,CAAC;IACnC,OAAOgD,OAAO,CAACyD,SAAS,CAAC,IAAIA,SAAS,KAAKH,QAAQ,CAACtG,IAAI,CAAC,CAAC;EAC5D,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe+E,aAAaA,CAACI,QAAgB,EAAEuB,QAAgB,EAA+B;EAC5F,IAAI;IACF,OAAO,MAAMrB,UAAG,CAACb,GAAG,CAAC,CAAC,MAAM,EAAE,GAAGW,QAAQ,MAAMuB,QAAQ,EAAE,CAAC,CAAC;EAC7D,CAAC,CAAC,MAAM;IACN,OAAOzG,SAAS;EAClB;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/ci",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.649",
|
|
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.649"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -16,34 +16,34 @@
|
|
|
16
16
|
"simple-git": "^3.28.0",
|
|
17
17
|
"fs-extra": "10.0.0",
|
|
18
18
|
"@teambit/harmony": "0.4.12",
|
|
19
|
-
"@teambit/logger": "0.0.1500",
|
|
20
|
-
"@teambit/component-id": "1.2.5",
|
|
21
|
-
"@teambit/harmony.modules.concurrency": "0.0.51",
|
|
22
|
-
"@teambit/harmony.modules.runtimes": "0.0.4",
|
|
23
|
-
"@teambit/lane-id": "0.0.312",
|
|
24
|
-
"@teambit/toolbox.promise.map-pool": "0.0.24",
|
|
25
|
-
"@teambit/toolbox.string.random": "0.0.22",
|
|
26
|
-
"@teambit/bit-error": "0.0.404",
|
|
27
|
-
"@teambit/legacy.constants": "0.0.50",
|
|
28
|
-
"@teambit/toolbox.crypto.sha1": "0.0.24",
|
|
29
19
|
"@teambit/cli": "0.0.1420",
|
|
20
|
+
"@teambit/logger": "0.0.1500",
|
|
30
21
|
"@teambit/workspace": "1.0.1243",
|
|
31
22
|
"@teambit/builder": "1.0.1243",
|
|
32
23
|
"@teambit/checkout": "1.0.1248",
|
|
24
|
+
"@teambit/component-id": "1.2.5",
|
|
33
25
|
"@teambit/component.modules.merge-helper": "0.0.133",
|
|
34
26
|
"@teambit/component.snap-distance": "0.0.190",
|
|
35
27
|
"@teambit/config-merger": "0.0.1110",
|
|
36
28
|
"@teambit/dependency-resolver": "1.0.1230",
|
|
37
29
|
"@teambit/export": "1.0.1245",
|
|
30
|
+
"@teambit/harmony.modules.concurrency": "0.0.51",
|
|
31
|
+
"@teambit/harmony.modules.runtimes": "0.0.4",
|
|
38
32
|
"@teambit/importer": "1.0.1243",
|
|
33
|
+
"@teambit/lane-id": "0.0.312",
|
|
39
34
|
"@teambit/lanes": "1.0.1269",
|
|
40
35
|
"@teambit/legacy.consumer-component": "0.0.190",
|
|
41
36
|
"@teambit/legacy.scope-api": "0.0.244",
|
|
42
37
|
"@teambit/objects": "0.0.723",
|
|
43
38
|
"@teambit/snapping": "1.0.1246",
|
|
44
39
|
"@teambit/status": "1.0.1273",
|
|
40
|
+
"@teambit/toolbox.promise.map-pool": "0.0.24",
|
|
41
|
+
"@teambit/toolbox.string.random": "0.0.22",
|
|
42
|
+
"@teambit/bit-error": "0.0.404",
|
|
43
|
+
"@teambit/legacy.constants": "0.0.50",
|
|
45
44
|
"@teambit/legacy.scope": "0.0.189",
|
|
46
|
-
"@teambit/legacy.bit-map": "0.0.246"
|
|
45
|
+
"@teambit/legacy.bit-map": "0.0.246",
|
|
46
|
+
"@teambit/toolbox.crypto.sha1": "0.0.24"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/lodash": "4.14.165",
|