@teambit/ci 1.0.533 → 1.0.535
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 +12 -1
- package/dist/ci.docs.mdx +12 -1
- package/dist/ci.main.runtime.d.ts +0 -5
- package/dist/ci.main.runtime.js +56 -49
- package/dist/ci.main.runtime.js.map +1 -1
- package/dist/lane-archive-guard.d.ts +118 -0
- package/dist/lane-archive-guard.js +314 -0
- package/dist/lane-archive-guard.js.map +1 -0
- package/dist/lane-archive-guard.spec.d.ts +1 -0
- package/dist/lane-archive-guard.spec.js +439 -0
- package/dist/lane-archive-guard.spec.js.map +1 -0
- package/dist/lane-cleanup.d.ts +28 -0
- package/dist/lane-cleanup.js +124 -0
- package/dist/lane-cleanup.js.map +1 -0
- package/dist/lane-cleanup.spec.d.ts +1 -0
- package/dist/lane-cleanup.spec.js +167 -0
- package/dist/lane-cleanup.spec.js.map +1 -0
- package/dist/{preview-1787772816768.js → preview-1787784888682.js} +1 -1
- package/package.json +21 -20
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decides whether `bit ci merge` may archive the lane it just released.
|
|
3
|
+
*
|
|
4
|
+
* A lane is hosted on one scope, but its components can belong to many. Each scope's repository
|
|
5
|
+
* releases only its own slice (the components in its `.bitmap`), so "this repository merged its
|
|
6
|
+
* pull request" is not "the lane is fully released". Archiving after the first slice strands the
|
|
7
|
+
* other slices on a lane nobody can read any more, and every other repository's `bit ci sync`
|
|
8
|
+
* then closes its mirror pull request as if the lane had been deleted.
|
|
9
|
+
*
|
|
10
|
+
* The rule: archive only when every component outside this release — another scope's, or a hidden
|
|
11
|
+
* dependent of this scope that no `.bitmap` lists — is released: either this very
|
|
12
|
+
* run tagged and exported it (the one-repository, many-scopes shape of `bit ci merge`), or it is
|
|
13
|
+
* already on its own scope's main. "On main" is read two ways,
|
|
14
|
+
* because a release reaches main two ways: the lane head is in main's history (a `bit lane merge`),
|
|
15
|
+
* or main's head carries the same files as the lane head (`bit ci merge` checks the branch content
|
|
16
|
+
* out and tags it, so the lane snaps never enter main's ancestry). The last repository to release
|
|
17
|
+
* archives the lane. When a state cannot be determined, the lane stays open — an open lane costs
|
|
18
|
+
* a manual `bit lane remove`, an archived one costs the work on it.
|
|
19
|
+
*/
|
|
20
|
+
import type { ComponentID } from '@teambit/component-id';
|
|
21
|
+
import type { LaneId } from '@teambit/lane-id';
|
|
22
|
+
import type { ModelComponent, Repository, Version } from '@teambit/objects';
|
|
23
|
+
export type ForeignLaneComponent = {
|
|
24
|
+
/** the component id, without a version */
|
|
25
|
+
id: string;
|
|
26
|
+
/** the scope the component belongs to (never this repository's `defaultScope`) */
|
|
27
|
+
scope: string;
|
|
28
|
+
/**
|
|
29
|
+
* `true` when this run tagged and exported the component from this very lane head, or the lane head is already on the
|
|
30
|
+
* component's main — in its history, or as the content of its head — or, for a component the lane
|
|
31
|
+
* deletes, when its main is already removed;
|
|
32
|
+
* `false` when it is not (including a component that has no main yet);
|
|
33
|
+
* `undefined` when the state could not be read.
|
|
34
|
+
*/
|
|
35
|
+
released: boolean | undefined;
|
|
36
|
+
};
|
|
37
|
+
export type LaneArchiveDecision = {
|
|
38
|
+
archive: boolean;
|
|
39
|
+
/** what to tell the user; empty when nothing beyond the archive itself is worth saying */
|
|
40
|
+
summary: string;
|
|
41
|
+
/** the lane the decision was made on (see `laneFingerprint`); absent when the lane is gone */
|
|
42
|
+
fingerprint?: string;
|
|
43
|
+
};
|
|
44
|
+
/** What reading the lane and its foreign components' main history needs from the workspace. */
|
|
45
|
+
/** One versioned entry on a lane. `isDeleted` marks a component the lane deletes on merge. */
|
|
46
|
+
export type LaneEntry = {
|
|
47
|
+
id: ComponentID;
|
|
48
|
+
head: string;
|
|
49
|
+
isDeleted?: boolean;
|
|
50
|
+
hidden?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A lane as read from its hosting scope for the archive decision: the listed components — deleted
|
|
54
|
+
* ones included, since a deletion is lane work the owning scope's release applies — and the hidden
|
|
55
|
+
* `updateDependents` cascade entries.
|
|
56
|
+
*/
|
|
57
|
+
export type LaneSnapshot = {
|
|
58
|
+
components: LaneEntry[];
|
|
59
|
+
updateDependents: LaneEntry[];
|
|
60
|
+
/** the lane's readme component and its head, when one is set — lane state a writer can change too */
|
|
61
|
+
readme?: string;
|
|
62
|
+
};
|
|
63
|
+
export type LaneArchiveDeps = {
|
|
64
|
+
/** the remote lane, from its hosting scope; rejects with "was not found" when the lane is gone */
|
|
65
|
+
/** the lane as its hosting scope holds it, deletions and hidden entries included; `undefined` only when the scope has no such lane */
|
|
66
|
+
readLane(laneId: LaneId): Promise<LaneSnapshot | undefined>;
|
|
67
|
+
/** fetch the main history of these components from their own scopes; tolerate a missing main */
|
|
68
|
+
importMainObjects(ids: ComponentID[]): Promise<void>;
|
|
69
|
+
getModelComponent(id: ComponentID): Promise<ModelComponent | undefined>;
|
|
70
|
+
/** fetch these raw objects (lane heads) from the lane's hosting scope, if missing locally */
|
|
71
|
+
importObjectsByHashes(scope: string, hashes: string[]): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* the lane head this run tagged and exported the component from, if this run released it; a lane
|
|
74
|
+
* entry counts as released here only while it still sits at that head
|
|
75
|
+
*/
|
|
76
|
+
releasedHeadByThisRun(id: ComponentID): string | undefined;
|
|
77
|
+
objects: Repository;
|
|
78
|
+
warn(message: string): void;
|
|
79
|
+
};
|
|
80
|
+
export declare function decideLaneArchive(laneId: string, defaultScope: string, foreign: ForeignLaneComponent[]): LaneArchiveDecision;
|
|
81
|
+
export declare function sameReleasedState(lane: Version, main: Version, laneComponentIds: string[], mainHeadOf: ReadonlyMap<string, string | undefined>): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Every versioned entry on the lane: the listed components and the hidden `updateDependents`
|
|
84
|
+
* cascade entries. The hidden entries are lane state too — they carry snaps, they can be foreign,
|
|
85
|
+
* and a release must account for them — even though no `.bitmap` ever lists them.
|
|
86
|
+
*/
|
|
87
|
+
export declare function allLaneEntries(lane: LaneSnapshot): LaneEntry[];
|
|
88
|
+
/**
|
|
89
|
+
* The lane's `id@head` set — each entry with its bucket (visible or hidden) and deletion mark — and its
|
|
90
|
+
* readme: what an archive decision is made on, and what must not move before it acts.
|
|
91
|
+
*/
|
|
92
|
+
export declare function laneFingerprint(lane: LaneSnapshot): string;
|
|
93
|
+
/**
|
|
94
|
+
* The remote lane, or `undefined` when its hosting scope no longer has it — a positive answer from
|
|
95
|
+
* the dependency (bit's own "no such lane"), never inferred from an error's text. Throws on any
|
|
96
|
+
* other failure to read it, and a lane that cannot be read is never archived.
|
|
97
|
+
*/
|
|
98
|
+
export declare function readRemoteLane(laneId: LaneId, deps: LaneArchiveDeps): Promise<LaneSnapshot | undefined>;
|
|
99
|
+
/**
|
|
100
|
+
* For each component on the remote lane outside this release — another scope's, or a hidden
|
|
101
|
+
* dependent of this scope: is it released? Returns
|
|
102
|
+
* `undefined` when the lane no longer exists on its hosting scope. Throws when the lane cannot be
|
|
103
|
+
* read for any other reason.
|
|
104
|
+
*/
|
|
105
|
+
export declare function foreignLaneComponentsReleaseState(laneId: LaneId, lane: LaneSnapshot, defaultScope: string, deps: LaneArchiveDeps): Promise<ForeignLaneComponent[]>;
|
|
106
|
+
/**
|
|
107
|
+
* The archive decision for a lane the merge just released. A lane that is already gone archives
|
|
108
|
+
* "as before" (the caller's archive reports not-found the way it always has); a lane that cannot
|
|
109
|
+
* be read stays open.
|
|
110
|
+
*/
|
|
111
|
+
export declare function laneArchiveDecision(laneId: LaneId, defaultScope: string, deps: LaneArchiveDeps): Promise<LaneArchiveDecision>;
|
|
112
|
+
/**
|
|
113
|
+
* The lane moved between the decision and the archive: another writer exported to it. The
|
|
114
|
+
* decision is stale; archiving now could remove work nobody has looked at.
|
|
115
|
+
*/
|
|
116
|
+
export declare function laneMovedSummary(laneId: string): string;
|
|
117
|
+
/** The lane could not be re-read right before the archive; without a current state, archiving is unsafe. */
|
|
118
|
+
export declare function laneUnreadableBeforeArchiveSummary(laneId: string, error: string): string;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allLaneEntries = allLaneEntries;
|
|
7
|
+
exports.decideLaneArchive = decideLaneArchive;
|
|
8
|
+
exports.foreignLaneComponentsReleaseState = foreignLaneComponentsReleaseState;
|
|
9
|
+
exports.laneArchiveDecision = laneArchiveDecision;
|
|
10
|
+
exports.laneFingerprint = laneFingerprint;
|
|
11
|
+
exports.laneMovedSummary = laneMovedSummary;
|
|
12
|
+
exports.laneUnreadableBeforeArchiveSummary = laneUnreadableBeforeArchiveSummary;
|
|
13
|
+
exports.readRemoteLane = readRemoteLane;
|
|
14
|
+
exports.sameReleasedState = sameReleasedState;
|
|
15
|
+
function _objects() {
|
|
16
|
+
const data = require("@teambit/objects");
|
|
17
|
+
_objects = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
function _component() {
|
|
23
|
+
const data = require("@teambit/component.snap-distance");
|
|
24
|
+
_component = function () {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
32
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
33
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
34
|
+
* Decides whether `bit ci merge` may archive the lane it just released.
|
|
35
|
+
*
|
|
36
|
+
* A lane is hosted on one scope, but its components can belong to many. Each scope's repository
|
|
37
|
+
* releases only its own slice (the components in its `.bitmap`), so "this repository merged its
|
|
38
|
+
* pull request" is not "the lane is fully released". Archiving after the first slice strands the
|
|
39
|
+
* other slices on a lane nobody can read any more, and every other repository's `bit ci sync`
|
|
40
|
+
* then closes its mirror pull request as if the lane had been deleted.
|
|
41
|
+
*
|
|
42
|
+
* The rule: archive only when every component outside this release — another scope's, or a hidden
|
|
43
|
+
* dependent of this scope that no `.bitmap` lists — is released: either this very
|
|
44
|
+
* run tagged and exported it (the one-repository, many-scopes shape of `bit ci merge`), or it is
|
|
45
|
+
* already on its own scope's main. "On main" is read two ways,
|
|
46
|
+
* because a release reaches main two ways: the lane head is in main's history (a `bit lane merge`),
|
|
47
|
+
* or main's head carries the same files as the lane head (`bit ci merge` checks the branch content
|
|
48
|
+
* out and tags it, so the lane snaps never enter main's ancestry). The last repository to release
|
|
49
|
+
* archives the lane. When a state cannot be determined, the lane stays open — an open lane costs
|
|
50
|
+
* a manual `bit lane remove`, an archived one costs the work on it.
|
|
51
|
+
*/
|
|
52
|
+
/** What reading the lane and its foreign components' main history needs from the workspace. */
|
|
53
|
+
/** One versioned entry on a lane. `isDeleted` marks a component the lane deletes on merge. */
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A lane as read from its hosting scope for the archive decision: the listed components — deleted
|
|
57
|
+
* ones included, since a deletion is lane work the owning scope's release applies — and the hidden
|
|
58
|
+
* `updateDependents` cascade entries.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/** How many component ids a message names before it summarizes the rest. */
|
|
62
|
+
const MAX_LISTED = 5;
|
|
63
|
+
function listIds(ids) {
|
|
64
|
+
const shown = ids.slice(0, MAX_LISTED).join(', ');
|
|
65
|
+
const rest = ids.length - MAX_LISTED;
|
|
66
|
+
return rest > 0 ? `${shown} and ${rest} more` : shown;
|
|
67
|
+
}
|
|
68
|
+
function scopesOf(components) {
|
|
69
|
+
return [...new Set(components.map(c => c.scope))].sort().join(', ');
|
|
70
|
+
}
|
|
71
|
+
function manualArchiveHint(laneId) {
|
|
72
|
+
return `To archive it by hand once every slice is released: bit lane remove --remote ${laneId}`;
|
|
73
|
+
}
|
|
74
|
+
function decideLaneArchive(laneId, defaultScope, foreign) {
|
|
75
|
+
if (!foreign.length) return {
|
|
76
|
+
archive: true,
|
|
77
|
+
summary: ''
|
|
78
|
+
};
|
|
79
|
+
const pending = foreign.filter(c => c.released === false);
|
|
80
|
+
const unknown = foreign.filter(c => c.released === undefined);
|
|
81
|
+
if (!pending.length && !unknown.length) {
|
|
82
|
+
return {
|
|
83
|
+
archive: true,
|
|
84
|
+
summary: `All ${foreign.length} component(s) outside this release (scope(s) ${scopesOf(foreign)}) ` + `are already on their main; the lane is fully released.`
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const lines = [`Lane ${laneId} left open.`];
|
|
88
|
+
if (pending.length) {
|
|
89
|
+
lines.push(`${pending.length} component(s) from scope(s) ${scopesOf(pending)} are not on their main yet: ` + `${listIds(pending.map(c => c.id))}.`);
|
|
90
|
+
}
|
|
91
|
+
if (unknown.length) {
|
|
92
|
+
lines.push(`The state of ${unknown.length} component(s) from scope(s) ${scopesOf(unknown)} could not be read: ` + `${listIds(unknown.map(c => c.id))}.`);
|
|
93
|
+
}
|
|
94
|
+
lines.push(`This repository releases the ${defaultScope} slice only. The repository of each remaining scope ` + `releases its own slice, and the last release archives the lane.`);
|
|
95
|
+
if ([...pending, ...unknown].some(c => c.scope === defaultScope)) {
|
|
96
|
+
lines.push(`A hidden dependent of ${defaultScope} is released only by a run that tags a component it depends on.`);
|
|
97
|
+
}
|
|
98
|
+
lines.push(manualArchiveHint(laneId));
|
|
99
|
+
return {
|
|
100
|
+
archive: false,
|
|
101
|
+
summary: lines.join('\n')
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Is `main` the released form of `lane`? `bit ci merge` checks the branch out and tags, so the
|
|
107
|
+
* release carries the lane head's sources and declared dependencies, but not its lineage. The
|
|
108
|
+
* comparison covers what the release transfers and nothing the release itself rewrites:
|
|
109
|
+
* - source files (path and content hash) and the main file;
|
|
110
|
+
* - package dependencies (dependencies, dev, peer) with their ranges;
|
|
111
|
+
* - component dependencies (dependencies, dev, peer) by id and version — a dependency that is itself
|
|
112
|
+
* on the lane is re-versioned by its release, so main must reference that component's main head;
|
|
113
|
+
* - the binding prefix, the overrides and the package.json changes the component declares;
|
|
114
|
+
* - every extension's `config` and version, with the same rule for an extension that is itself a
|
|
115
|
+
* component on the lane; not `data`, which the release recomputes (builder, dependencies).
|
|
116
|
+
* Anything else the lane changed (a dependency bump, an env change) leaves `main` different and the
|
|
117
|
+
* component pending — a false "pending" costs a manual archive, a false "released" costs the work.
|
|
118
|
+
*/
|
|
119
|
+
/**
|
|
120
|
+
* The extension's identity without a version: a component id (`teambit.envs/envs`) by scope and name,
|
|
121
|
+
* a legacy package-named extension (`@scope/pkg`) by its name.
|
|
122
|
+
*/
|
|
123
|
+
function extensionKey(ext) {
|
|
124
|
+
return ext.extensionId ? ext.extensionId.toStringWithoutVersion() : ext.stringId;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** JSON with object keys in sorted order at every depth, so equal objects serialize equally. */
|
|
128
|
+
function stableStringify(value) {
|
|
129
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`;
|
|
130
|
+
if (value && typeof value === 'object') {
|
|
131
|
+
const entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));
|
|
132
|
+
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(',')}}`;
|
|
133
|
+
}
|
|
134
|
+
return JSON.stringify(value) ?? 'undefined';
|
|
135
|
+
}
|
|
136
|
+
function sameReleasedState(lane, main, laneComponentIds, mainHeadOf) {
|
|
137
|
+
const onLane = new Set(laneComponentIds);
|
|
138
|
+
// A component that is itself on the lane is re-versioned by its release. On the lane side its
|
|
139
|
+
// version is the lane snap; on the main side the released state references its main head — any
|
|
140
|
+
// other version is a stale main, not a release. Both sides normalize to one token when they hold
|
|
141
|
+
// the expected version, so only that pairing compares equal.
|
|
142
|
+
const versionToken = (id, ver, side) => {
|
|
143
|
+
if (!onLane.has(id)) return ver ?? '';
|
|
144
|
+
if (side === 'lane') return '<lane>';
|
|
145
|
+
return ver !== undefined && ver === mainHeadOf.get(id) ? '<lane>' : `stale:${ver}`;
|
|
146
|
+
};
|
|
147
|
+
const files = v => v.files.map(f => `${f.relativePath}:${f.file.toString()}`).sort().join('\n');
|
|
148
|
+
const packages = v => stableStringify([v.packageDependencies, v.devPackageDependencies, v.peerPackageDependencies]);
|
|
149
|
+
const components = (v, side) => [v.dependencies, v.devDependencies, v.peerDependencies].map(deps => deps.get().map(dep => {
|
|
150
|
+
const id = dep.id.toStringWithoutVersion();
|
|
151
|
+
return `${id}@${versionToken(id, dep.id.version, side)}`;
|
|
152
|
+
}).sort().join(',')).join('|');
|
|
153
|
+
const configs = (v, side) => stableStringify(v.extensions.map(ext => {
|
|
154
|
+
const id = extensionKey(ext);
|
|
155
|
+
const ver = ext.extensionId?.version ?? ext.stringId.split('@')[1];
|
|
156
|
+
return [id, versionToken(id, ver, side), ext.config ?? {}];
|
|
157
|
+
}).sort(([a], [b]) => a.localeCompare(b)));
|
|
158
|
+
const rest = v => stableStringify([v.bindingPrefix, v.overrides, v.packageJsonChangedProps]);
|
|
159
|
+
return lane.mainFile === main.mainFile && rest(lane) === rest(main) && files(lane) === files(main) && packages(lane) === packages(main) && components(lane, 'lane') === components(main, 'main') && configs(lane, 'lane') === configs(main, 'main');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Is the lane head already on the component's main? Either in main's history, or released onto
|
|
164
|
+
* main's head. Throws when an object it needs cannot be loaded.
|
|
165
|
+
*/
|
|
166
|
+
async function laneHeadIsOnMain(modelComponent, laneHead, mainHead, laneComponentIds, mainHeadOf, objects) {
|
|
167
|
+
if (await (0, _component().hasVersionByRef)(modelComponent, laneHead, objects, mainHead)) return true;
|
|
168
|
+
const laneVersion = await objects.load(laneHead, true);
|
|
169
|
+
const mainVersion = await objects.load(mainHead, true);
|
|
170
|
+
return sameReleasedState(laneVersion, mainVersion, laneComponentIds, mainHeadOf);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Every versioned entry on the lane: the listed components and the hidden `updateDependents`
|
|
175
|
+
* cascade entries. The hidden entries are lane state too — they carry snaps, they can be foreign,
|
|
176
|
+
* and a release must account for them — even though no `.bitmap` ever lists them.
|
|
177
|
+
*/
|
|
178
|
+
function allLaneEntries(lane) {
|
|
179
|
+
return [...lane.components, ...lane.updateDependents.map(comp => _objectSpread(_objectSpread({}, comp), {}, {
|
|
180
|
+
hidden: true
|
|
181
|
+
}))];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The lane's `id@head` set — each entry with its bucket (visible or hidden) and deletion mark — and its
|
|
186
|
+
* readme: what an archive decision is made on, and what must not move before it acts.
|
|
187
|
+
*/
|
|
188
|
+
function laneFingerprint(lane) {
|
|
189
|
+
const entries = allLaneEntries(lane).map(comp => `${comp.id.toStringWithoutVersion()}@${comp.head}${comp.isDeleted ? ' (deleted)' : ''}${comp.hidden ? ' (hidden)' : ''}`).sort();
|
|
190
|
+
return [...entries, `readme:${lane.readme ?? ''}`].join('\n');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The remote lane, or `undefined` when its hosting scope no longer has it — a positive answer from
|
|
195
|
+
* the dependency (bit's own "no such lane"), never inferred from an error's text. Throws on any
|
|
196
|
+
* other failure to read it, and a lane that cannot be read is never archived.
|
|
197
|
+
*/
|
|
198
|
+
async function readRemoteLane(laneId, deps) {
|
|
199
|
+
return deps.readLane(laneId);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* For each component on the remote lane outside this release — another scope's, or a hidden
|
|
204
|
+
* dependent of this scope: is it released? Returns
|
|
205
|
+
* `undefined` when the lane no longer exists on its hosting scope. Throws when the lane cannot be
|
|
206
|
+
* read for any other reason.
|
|
207
|
+
*/
|
|
208
|
+
async function foreignLaneComponentsReleaseState(laneId, lane, defaultScope, deps) {
|
|
209
|
+
const entries = allLaneEntries(lane);
|
|
210
|
+
// What this release cannot vouch for: every component of another scope, and the hidden cascade
|
|
211
|
+
// entries of this scope — no `.bitmap` lists them, and the tag reaches one only when a component
|
|
212
|
+
// it depends on is tagged in the same run.
|
|
213
|
+
const foreign = entries.filter(comp => comp.id.scope !== defaultScope || comp.hidden);
|
|
214
|
+
if (!foreign.length) return [];
|
|
215
|
+
const laneComponentIds = entries.map(comp => comp.id.toStringWithoutVersion());
|
|
216
|
+
const entry = (comp, released) => ({
|
|
217
|
+
id: comp.id.toStringWithoutVersion(),
|
|
218
|
+
scope: comp.id.scope,
|
|
219
|
+
released
|
|
220
|
+
});
|
|
221
|
+
// A component this run tagged and exported is released by definition — as long as the lane still
|
|
222
|
+
// sits at the head this run tagged from; a head that moved since is another writer's work. Being
|
|
223
|
+
// in `.bitmap` is not enough: the tag covers changed components only, and a mirror writes the
|
|
224
|
+
// defaultScope slice only.
|
|
225
|
+
const releasedByThisRun = comp => deps.releasedHeadByThisRun(comp.id.changeVersion(undefined)) === comp.head;
|
|
226
|
+
const releasedHere = foreign.filter(releasedByThisRun);
|
|
227
|
+
const others = foreign.filter(comp => !releasedByThisRun(comp));
|
|
228
|
+
if (!others.length) return releasedHere.map(comp => entry(comp, true));
|
|
229
|
+
|
|
230
|
+
// Each other component's main history comes from its own scope, and its lane head from the
|
|
231
|
+
// lane's hosting scope. A component that has no main yet (created on the lane) is simply absent
|
|
232
|
+
// afterwards, which reads as "not released".
|
|
233
|
+
let objectsImported = true;
|
|
234
|
+
try {
|
|
235
|
+
// every lane component's main is needed: the released state of one references the heads of others
|
|
236
|
+
await deps.importMainObjects(entries.map(comp => comp.id.changeVersion(undefined)));
|
|
237
|
+
await deps.importObjectsByHashes(laneId.scope, others.map(comp => comp.head));
|
|
238
|
+
} catch (e) {
|
|
239
|
+
deps.warn(`Could not fetch the history of the lane's foreign components: ${e.message}`);
|
|
240
|
+
objectsImported = false;
|
|
241
|
+
}
|
|
242
|
+
const mainHeadOf = new Map();
|
|
243
|
+
if (objectsImported) {
|
|
244
|
+
await Promise.all(entries.map(async comp => {
|
|
245
|
+
const id = comp.id.toStringWithoutVersion();
|
|
246
|
+
try {
|
|
247
|
+
const model = await deps.getModelComponent(comp.id.changeVersion(undefined));
|
|
248
|
+
mainHeadOf.set(id, model?.getHeadAsTagIfExist() ?? model?.getHead()?.toString());
|
|
249
|
+
} catch {
|
|
250
|
+
mainHeadOf.set(id, undefined); // unknown head: a reference to it can never read as released
|
|
251
|
+
}
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
const states = await Promise.all(others.map(async comp => {
|
|
255
|
+
if (!objectsImported) return entry(comp, undefined);
|
|
256
|
+
try {
|
|
257
|
+
const modelComponent = await deps.getModelComponent(comp.id.changeVersion(undefined));
|
|
258
|
+
const mainHead = modelComponent?.getHead();
|
|
259
|
+
if (!modelComponent || !mainHead) return entry(comp, false);
|
|
260
|
+
if (comp.isDeleted) {
|
|
261
|
+
// the lane deletes this component; released once its own main head carries the deletion.
|
|
262
|
+
// Read main's head Version itself — ModelComponent.isRemoved() may answer for a lane head.
|
|
263
|
+
const mainVersion = await deps.objects.load(mainHead, true);
|
|
264
|
+
return entry(comp, mainVersion.isRemoved());
|
|
265
|
+
}
|
|
266
|
+
return entry(comp, await laneHeadIsOnMain(modelComponent, _objects().Ref.from(comp.head), mainHead, laneComponentIds, mainHeadOf, deps.objects));
|
|
267
|
+
} catch (e) {
|
|
268
|
+
deps.warn(`Could not read the history of ${comp.id.toStringWithoutVersion()}: ${e.message}`);
|
|
269
|
+
return entry(comp, undefined);
|
|
270
|
+
}
|
|
271
|
+
}));
|
|
272
|
+
return [...releasedHere.map(comp => entry(comp, true)), ...states];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The archive decision for a lane the merge just released. A lane that is already gone archives
|
|
277
|
+
* "as before" (the caller's archive reports not-found the way it always has); a lane that cannot
|
|
278
|
+
* be read stays open.
|
|
279
|
+
*/
|
|
280
|
+
async function laneArchiveDecision(laneId, defaultScope, deps) {
|
|
281
|
+
let lane;
|
|
282
|
+
let foreign;
|
|
283
|
+
try {
|
|
284
|
+
lane = await readRemoteLane(laneId, deps);
|
|
285
|
+
foreign = lane && (await foreignLaneComponentsReleaseState(laneId, lane, defaultScope, deps));
|
|
286
|
+
} catch (e) {
|
|
287
|
+
return {
|
|
288
|
+
archive: false,
|
|
289
|
+
summary: `Could not read lane ${laneId.toString()} to check for components outside this release: ${e.message}\n` + `Leaving the lane open. ${manualArchiveHint(laneId.toString())}`
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
if (!lane || !foreign) return {
|
|
293
|
+
archive: true,
|
|
294
|
+
summary: ''
|
|
295
|
+
};
|
|
296
|
+
return _objectSpread(_objectSpread({}, decideLaneArchive(laneId.toString(), defaultScope, foreign)), {}, {
|
|
297
|
+
fingerprint: laneFingerprint(lane)
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The lane moved between the decision and the archive: another writer exported to it. The
|
|
303
|
+
* decision is stale; archiving now could remove work nobody has looked at.
|
|
304
|
+
*/
|
|
305
|
+
function laneMovedSummary(laneId) {
|
|
306
|
+
return `Lane ${laneId} changed while the release was checking it, so it is left open; ` + `the next release evaluates the new state. ${manualArchiveHint(laneId)}`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** The lane could not be re-read right before the archive; without a current state, archiving is unsafe. */
|
|
310
|
+
function laneUnreadableBeforeArchiveSummary(laneId, error) {
|
|
311
|
+
return `Could not re-read lane ${laneId} before archiving it: ${error}\n` + `Leaving the lane open. ${manualArchiveHint(laneId)}`;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
//# sourceMappingURL=lane-archive-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_objects","data","require","_component","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MAX_LISTED","listIds","ids","shown","slice","join","rest","scopesOf","components","Set","map","c","scope","sort","manualArchiveHint","laneId","decideLaneArchive","defaultScope","foreign","archive","summary","pending","released","unknown","undefined","lines","id","some","extensionKey","ext","extensionId","toStringWithoutVersion","stringId","stableStringify","Array","isArray","entries","a","b","localeCompare","k","v","JSON","stringify","sameReleasedState","lane","main","laneComponentIds","mainHeadOf","onLane","versionToken","ver","side","has","get","files","f","relativePath","file","toString","packages","packageDependencies","devPackageDependencies","peerPackageDependencies","dependencies","devDependencies","peerDependencies","deps","dep","version","configs","extensions","split","config","bindingPrefix","overrides","packageJsonChangedProps","mainFile","laneHeadIsOnMain","modelComponent","laneHead","mainHead","objects","hasVersionByRef","laneVersion","load","mainVersion","allLaneEntries","updateDependents","comp","hidden","laneFingerprint","head","isDeleted","readme","readRemoteLane","readLane","foreignLaneComponentsReleaseState","entry","releasedByThisRun","releasedHeadByThisRun","changeVersion","releasedHere","others","objectsImported","importMainObjects","importObjectsByHashes","warn","message","Map","Promise","all","model","getModelComponent","set","getHeadAsTagIfExist","getHead","states","isRemoved","Ref","from","laneArchiveDecision","fingerprint","laneMovedSummary","laneUnreadableBeforeArchiveSummary","error"],"sources":["lane-archive-guard.ts"],"sourcesContent":["/**\n * Decides whether `bit ci merge` may archive the lane it just released.\n *\n * A lane is hosted on one scope, but its components can belong to many. Each scope's repository\n * releases only its own slice (the components in its `.bitmap`), so \"this repository merged its\n * pull request\" is not \"the lane is fully released\". Archiving after the first slice strands the\n * other slices on a lane nobody can read any more, and every other repository's `bit ci sync`\n * then closes its mirror pull request as if the lane had been deleted.\n *\n * The rule: archive only when every component outside this release — another scope's, or a hidden\n * dependent of this scope that no `.bitmap` lists — is released: either this very\n * run tagged and exported it (the one-repository, many-scopes shape of `bit ci merge`), or it is\n * already on its own scope's main. \"On main\" is read two ways,\n * because a release reaches main two ways: the lane head is in main's history (a `bit lane merge`),\n * or main's head carries the same files as the lane head (`bit ci merge` checks the branch content\n * out and tags it, so the lane snaps never enter main's ancestry). The last repository to release\n * archives the lane. When a state cannot be determined, the lane stays open — an open lane costs\n * a manual `bit lane remove`, an archived one costs the work on it.\n */\nimport type { ComponentID } from '@teambit/component-id';\nimport type { LaneId } from '@teambit/lane-id';\nimport type { ModelComponent, Repository, Version } from '@teambit/objects';\nimport { Ref } from '@teambit/objects';\nimport { hasVersionByRef } from '@teambit/component.snap-distance';\n\nexport type ForeignLaneComponent = {\n /** the component id, without a version */\n id: string;\n /** the scope the component belongs to (never this repository's `defaultScope`) */\n scope: string;\n /**\n * `true` when this run tagged and exported the component from this very lane head, or the lane head is already on the\n * component's main — in its history, or as the content of its head — or, for a component the lane\n * deletes, when its main is already removed;\n * `false` when it is not (including a component that has no main yet);\n * `undefined` when the state could not be read.\n */\n released: boolean | undefined;\n};\n\nexport type LaneArchiveDecision = {\n archive: boolean;\n /** what to tell the user; empty when nothing beyond the archive itself is worth saying */\n summary: string;\n /** the lane the decision was made on (see `laneFingerprint`); absent when the lane is gone */\n fingerprint?: string;\n};\n\n/** What reading the lane and its foreign components' main history needs from the workspace. */\n/** One versioned entry on a lane. `isDeleted` marks a component the lane deletes on merge. */\nexport type LaneEntry = { id: ComponentID; head: string; isDeleted?: boolean; hidden?: boolean };\n\n/**\n * A lane as read from its hosting scope for the archive decision: the listed components — deleted\n * ones included, since a deletion is lane work the owning scope's release applies — and the hidden\n * `updateDependents` cascade entries.\n */\nexport type LaneSnapshot = {\n components: LaneEntry[];\n updateDependents: LaneEntry[];\n /** the lane's readme component and its head, when one is set — lane state a writer can change too */\n readme?: string;\n};\n\nexport type LaneArchiveDeps = {\n /** the remote lane, from its hosting scope; rejects with \"was not found\" when the lane is gone */\n /** the lane as its hosting scope holds it, deletions and hidden entries included; `undefined` only when the scope has no such lane */\n readLane(laneId: LaneId): Promise<LaneSnapshot | undefined>;\n /** fetch the main history of these components from their own scopes; tolerate a missing main */\n importMainObjects(ids: ComponentID[]): Promise<void>;\n getModelComponent(id: ComponentID): Promise<ModelComponent | undefined>;\n /** fetch these raw objects (lane heads) from the lane's hosting scope, if missing locally */\n importObjectsByHashes(scope: string, hashes: string[]): Promise<void>;\n /**\n * the lane head this run tagged and exported the component from, if this run released it; a lane\n * entry counts as released here only while it still sits at that head\n */\n releasedHeadByThisRun(id: ComponentID): string | undefined;\n objects: Repository;\n warn(message: string): void;\n};\n\n/** How many component ids a message names before it summarizes the rest. */\nconst MAX_LISTED = 5;\n\nfunction listIds(ids: string[]): string {\n const shown = ids.slice(0, MAX_LISTED).join(', ');\n const rest = ids.length - MAX_LISTED;\n return rest > 0 ? `${shown} and ${rest} more` : shown;\n}\n\nfunction scopesOf(components: ForeignLaneComponent[]): string {\n return [...new Set(components.map((c) => c.scope))].sort().join(', ');\n}\n\nfunction manualArchiveHint(laneId: string): string {\n return `To archive it by hand once every slice is released: bit lane remove --remote ${laneId}`;\n}\n\nexport function decideLaneArchive(\n laneId: string,\n defaultScope: string,\n foreign: ForeignLaneComponent[]\n): LaneArchiveDecision {\n if (!foreign.length) return { archive: true, summary: '' };\n\n const pending = foreign.filter((c) => c.released === false);\n const unknown = foreign.filter((c) => c.released === undefined);\n\n if (!pending.length && !unknown.length) {\n return {\n archive: true,\n summary:\n `All ${foreign.length} component(s) outside this release (scope(s) ${scopesOf(foreign)}) ` +\n `are already on their main; the lane is fully released.`,\n };\n }\n\n const lines = [`Lane ${laneId} left open.`];\n if (pending.length) {\n lines.push(\n `${pending.length} component(s) from scope(s) ${scopesOf(pending)} are not on their main yet: ` +\n `${listIds(pending.map((c) => c.id))}.`\n );\n }\n if (unknown.length) {\n lines.push(\n `The state of ${unknown.length} component(s) from scope(s) ${scopesOf(unknown)} could not be read: ` +\n `${listIds(unknown.map((c) => c.id))}.`\n );\n }\n lines.push(\n `This repository releases the ${defaultScope} slice only. The repository of each remaining scope ` +\n `releases its own slice, and the last release archives the lane.`\n );\n if ([...pending, ...unknown].some((c) => c.scope === defaultScope)) {\n lines.push(`A hidden dependent of ${defaultScope} is released only by a run that tags a component it depends on.`);\n }\n lines.push(manualArchiveHint(laneId));\n return { archive: false, summary: lines.join('\\n') };\n}\n\n/**\n * Is `main` the released form of `lane`? `bit ci merge` checks the branch out and tags, so the\n * release carries the lane head's sources and declared dependencies, but not its lineage. The\n * comparison covers what the release transfers and nothing the release itself rewrites:\n * - source files (path and content hash) and the main file;\n * - package dependencies (dependencies, dev, peer) with their ranges;\n * - component dependencies (dependencies, dev, peer) by id and version — a dependency that is itself\n * on the lane is re-versioned by its release, so main must reference that component's main head;\n * - the binding prefix, the overrides and the package.json changes the component declares;\n * - every extension's `config` and version, with the same rule for an extension that is itself a\n * component on the lane; not `data`, which the release recomputes (builder, dependencies).\n * Anything else the lane changed (a dependency bump, an env change) leaves `main` different and the\n * component pending — a false \"pending\" costs a manual archive, a false \"released\" costs the work.\n */\n/**\n * The extension's identity without a version: a component id (`teambit.envs/envs`) by scope and name,\n * a legacy package-named extension (`@scope/pkg`) by its name.\n */\nfunction extensionKey(ext: Version['extensions'][number]): string {\n return ext.extensionId ? ext.extensionId.toStringWithoutVersion() : ext.stringId;\n}\n\n/** JSON with object keys in sorted order at every depth, so equal objects serialize equally. */\nfunction stableStringify(value: unknown): string {\n if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`;\n if (value && typeof value === 'object') {\n const entries = Object.entries(value as Record<string, unknown>).sort(([a], [b]) => a.localeCompare(b));\n return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(',')}}`;\n }\n return JSON.stringify(value) ?? 'undefined';\n}\n\nexport function sameReleasedState(\n lane: Version,\n main: Version,\n laneComponentIds: string[],\n mainHeadOf: ReadonlyMap<string, string | undefined>\n): boolean {\n const onLane = new Set(laneComponentIds);\n // A component that is itself on the lane is re-versioned by its release. On the lane side its\n // version is the lane snap; on the main side the released state references its main head — any\n // other version is a stale main, not a release. Both sides normalize to one token when they hold\n // the expected version, so only that pairing compares equal.\n const versionToken = (id: string, ver: string | undefined, side: 'lane' | 'main') => {\n if (!onLane.has(id)) return ver ?? '';\n if (side === 'lane') return '<lane>';\n return ver !== undefined && ver === mainHeadOf.get(id) ? '<lane>' : `stale:${ver}`;\n };\n const files = (v: Version) =>\n v.files\n .map((f) => `${f.relativePath}:${f.file.toString()}`)\n .sort()\n .join('\\n');\n const packages = (v: Version) =>\n stableStringify([v.packageDependencies, v.devPackageDependencies, v.peerPackageDependencies]);\n const components = (v: Version, side: 'lane' | 'main') =>\n [v.dependencies, v.devDependencies, v.peerDependencies]\n .map((deps) =>\n deps\n .get()\n .map((dep) => {\n const id = dep.id.toStringWithoutVersion();\n return `${id}@${versionToken(id, dep.id.version, side)}`;\n })\n .sort()\n .join(',')\n )\n .join('|');\n const configs = (v: Version, side: 'lane' | 'main') =>\n stableStringify(\n v.extensions\n .map((ext) => {\n const id = extensionKey(ext);\n const ver = ext.extensionId?.version ?? ext.stringId.split('@')[1];\n return [id, versionToken(id, ver, side), ext.config ?? {}] as const;\n })\n .sort(([a], [b]) => a.localeCompare(b))\n );\n const rest = (v: Version) => stableStringify([v.bindingPrefix, v.overrides, v.packageJsonChangedProps]);\n return (\n lane.mainFile === main.mainFile &&\n rest(lane) === rest(main) &&\n files(lane) === files(main) &&\n packages(lane) === packages(main) &&\n components(lane, 'lane') === components(main, 'main') &&\n configs(lane, 'lane') === configs(main, 'main')\n );\n}\n\n/**\n * Is the lane head already on the component's main? Either in main's history, or released onto\n * main's head. Throws when an object it needs cannot be loaded.\n */\nasync function laneHeadIsOnMain(\n modelComponent: ModelComponent,\n laneHead: Ref,\n mainHead: Ref,\n laneComponentIds: string[],\n mainHeadOf: ReadonlyMap<string, string | undefined>,\n objects: Repository\n): Promise<boolean> {\n if (await hasVersionByRef(modelComponent, laneHead, objects, mainHead)) return true;\n const laneVersion = (await objects.load(laneHead, true)) as Version;\n const mainVersion = (await objects.load(mainHead, true)) as Version;\n return sameReleasedState(laneVersion, mainVersion, laneComponentIds, mainHeadOf);\n}\n\n/**\n * Every versioned entry on the lane: the listed components and the hidden `updateDependents`\n * cascade entries. The hidden entries are lane state too — they carry snaps, they can be foreign,\n * and a release must account for them — even though no `.bitmap` ever lists them.\n */\nexport function allLaneEntries(lane: LaneSnapshot): LaneEntry[] {\n return [...lane.components, ...lane.updateDependents.map((comp) => ({ ...comp, hidden: true }))];\n}\n\n/**\n * The lane's `id@head` set — each entry with its bucket (visible or hidden) and deletion mark — and its\n * readme: what an archive decision is made on, and what must not move before it acts.\n */\nexport function laneFingerprint(lane: LaneSnapshot): string {\n const entries = allLaneEntries(lane)\n .map(\n (comp) =>\n `${comp.id.toStringWithoutVersion()}@${comp.head}${comp.isDeleted ? ' (deleted)' : ''}${comp.hidden ? ' (hidden)' : ''}`\n )\n .sort();\n return [...entries, `readme:${lane.readme ?? ''}`].join('\\n');\n}\n\n/**\n * The remote lane, or `undefined` when its hosting scope no longer has it — a positive answer from\n * the dependency (bit's own \"no such lane\"), never inferred from an error's text. Throws on any\n * other failure to read it, and a lane that cannot be read is never archived.\n */\nexport async function readRemoteLane(laneId: LaneId, deps: LaneArchiveDeps): Promise<LaneSnapshot | undefined> {\n return deps.readLane(laneId);\n}\n\n/**\n * For each component on the remote lane outside this release — another scope's, or a hidden\n * dependent of this scope: is it released? Returns\n * `undefined` when the lane no longer exists on its hosting scope. Throws when the lane cannot be\n * read for any other reason.\n */\nexport async function foreignLaneComponentsReleaseState(\n laneId: LaneId,\n lane: LaneSnapshot,\n defaultScope: string,\n deps: LaneArchiveDeps\n): Promise<ForeignLaneComponent[]> {\n const entries = allLaneEntries(lane);\n // What this release cannot vouch for: every component of another scope, and the hidden cascade\n // entries of this scope — no `.bitmap` lists them, and the tag reaches one only when a component\n // it depends on is tagged in the same run.\n const foreign = entries.filter((comp) => comp.id.scope !== defaultScope || comp.hidden);\n if (!foreign.length) return [];\n const laneComponentIds = entries.map((comp) => comp.id.toStringWithoutVersion());\n\n const entry = (comp: (typeof foreign)[number], released: boolean | undefined): ForeignLaneComponent => ({\n id: comp.id.toStringWithoutVersion(),\n scope: comp.id.scope as string,\n released,\n });\n // A component this run tagged and exported is released by definition — as long as the lane still\n // sits at the head this run tagged from; a head that moved since is another writer's work. Being\n // in `.bitmap` is not enough: the tag covers changed components only, and a mirror writes the\n // defaultScope slice only.\n const releasedByThisRun = (comp: LaneEntry) =>\n deps.releasedHeadByThisRun(comp.id.changeVersion(undefined)) === comp.head;\n const releasedHere = foreign.filter(releasedByThisRun);\n const others = foreign.filter((comp) => !releasedByThisRun(comp));\n if (!others.length) return releasedHere.map((comp) => entry(comp, true));\n\n // Each other component's main history comes from its own scope, and its lane head from the\n // lane's hosting scope. A component that has no main yet (created on the lane) is simply absent\n // afterwards, which reads as \"not released\".\n let objectsImported = true;\n try {\n // every lane component's main is needed: the released state of one references the heads of others\n await deps.importMainObjects(entries.map((comp) => comp.id.changeVersion(undefined)));\n await deps.importObjectsByHashes(\n laneId.scope,\n others.map((comp) => comp.head)\n );\n } catch (e: any) {\n deps.warn(`Could not fetch the history of the lane's foreign components: ${e.message}`);\n objectsImported = false;\n }\n\n const mainHeadOf = new Map<string, string | undefined>();\n if (objectsImported) {\n await Promise.all(\n entries.map(async (comp) => {\n const id = comp.id.toStringWithoutVersion();\n try {\n const model = await deps.getModelComponent(comp.id.changeVersion(undefined));\n mainHeadOf.set(id, model?.getHeadAsTagIfExist() ?? model?.getHead()?.toString());\n } catch {\n mainHeadOf.set(id, undefined); // unknown head: a reference to it can never read as released\n }\n })\n );\n }\n\n const states = await Promise.all(\n others.map(async (comp): Promise<ForeignLaneComponent> => {\n if (!objectsImported) return entry(comp, undefined);\n try {\n const modelComponent = await deps.getModelComponent(comp.id.changeVersion(undefined));\n const mainHead = modelComponent?.getHead();\n if (!modelComponent || !mainHead) return entry(comp, false);\n if (comp.isDeleted) {\n // the lane deletes this component; released once its own main head carries the deletion.\n // Read main's head Version itself — ModelComponent.isRemoved() may answer for a lane head.\n const mainVersion = (await deps.objects.load(mainHead, true)) as Version;\n return entry(comp, mainVersion.isRemoved());\n }\n return entry(\n comp,\n await laneHeadIsOnMain(\n modelComponent,\n Ref.from(comp.head),\n mainHead,\n laneComponentIds,\n mainHeadOf,\n deps.objects\n )\n );\n } catch (e: any) {\n deps.warn(`Could not read the history of ${comp.id.toStringWithoutVersion()}: ${e.message}`);\n return entry(comp, undefined);\n }\n })\n );\n return [...releasedHere.map((comp) => entry(comp, true)), ...states];\n}\n\n/**\n * The archive decision for a lane the merge just released. A lane that is already gone archives\n * \"as before\" (the caller's archive reports not-found the way it always has); a lane that cannot\n * be read stays open.\n */\nexport async function laneArchiveDecision(\n laneId: LaneId,\n defaultScope: string,\n deps: LaneArchiveDeps\n): Promise<LaneArchiveDecision> {\n let lane: LaneSnapshot | undefined;\n let foreign: ForeignLaneComponent[] | undefined;\n try {\n lane = await readRemoteLane(laneId, deps);\n foreign = lane && (await foreignLaneComponentsReleaseState(laneId, lane, defaultScope, deps));\n } catch (e: any) {\n return {\n archive: false,\n summary:\n `Could not read lane ${laneId.toString()} to check for components outside this release: ${e.message}\\n` +\n `Leaving the lane open. ${manualArchiveHint(laneId.toString())}`,\n };\n }\n if (!lane || !foreign) return { archive: true, summary: '' };\n return { ...decideLaneArchive(laneId.toString(), defaultScope, foreign), fingerprint: laneFingerprint(lane) };\n}\n\n/**\n * The lane moved between the decision and the archive: another writer exported to it. The\n * decision is stale; archiving now could remove work nobody has looked at.\n */\nexport function laneMovedSummary(laneId: string): string {\n return (\n `Lane ${laneId} changed while the release was checking it, so it is left open; ` +\n `the next release evaluates the new state. ${manualArchiveHint(laneId)}`\n );\n}\n\n/** The lane could not be re-read right before the archive; without a current state, archiving is unsafe. */\nexport function laneUnreadableBeforeArchiveSummary(laneId: string, error: string): string {\n return (\n `Could not re-read lane ${laneId} before archiving it: ${error}\\n` +\n `Leaving the lane open. ${manualArchiveHint(laneId)}`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE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