@tablation/crew 0.19.2 → 0.19.4
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/dist/cli.js +15 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2706,7 +2706,9 @@ function pushTag(cwd, remote, tag) {
|
|
|
2706
2706
|
git(cwd, ["push", remote, tag]);
|
|
2707
2707
|
}
|
|
2708
2708
|
function fetchRemote(cwd, remote = "origin") {
|
|
2709
|
-
|
|
2709
|
+
if (gitOk(cwd, ["fetch", "--prune", "--quiet", remote]) === null) return false;
|
|
2710
|
+
gitOk(cwd, ["fetch", "--quiet", remote, "refs/tags/*:refs/tags/*"]);
|
|
2711
|
+
return true;
|
|
2710
2712
|
}
|
|
2711
2713
|
function remoteConfigured(cwd, remote = "origin") {
|
|
2712
2714
|
return gitOk(cwd, ["remote", "get-url", remote]) !== null;
|
|
@@ -6561,6 +6563,7 @@ ${section}`;
|
|
|
6561
6563
|
}
|
|
6562
6564
|
return [...lines.slice(0, anchor), section, ...lines.slice(anchor)].join("\n");
|
|
6563
6565
|
}
|
|
6566
|
+
var RELEASE_COMMIT_SUBJECT = /^Release \S+$/;
|
|
6564
6567
|
function decideRelease(cwd, tickets, contract, opts = {}) {
|
|
6565
6568
|
const pattern = opts.tagPattern ?? "v*";
|
|
6566
6569
|
const base = opts.base ?? "main";
|
|
@@ -6570,6 +6573,7 @@ function decideRelease(cwd, tickets, contract, opts = {}) {
|
|
|
6570
6573
|
const head = resolve2(cwd, "HEAD") ?? "";
|
|
6571
6574
|
const merges = block ? [] : planMerge(cwd, tickets, contract, lastReleased, opts.branchFor ?? ((t) => branchForIssue(cwd, t.issue_id)), base);
|
|
6572
6575
|
const unreleasedCommits = lastReleased ? countCommits(cwd, `${lastReleased}..HEAD`) : 0;
|
|
6576
|
+
const unreleasedWork = lastReleased ? (gitOk(cwd, ["log", "--format=%s", `${lastReleased}..HEAD`]) ?? "").split("\n").filter((l) => l && !RELEASE_COMMIT_SUBJECT.test(l)).length : 0;
|
|
6573
6577
|
return {
|
|
6574
6578
|
block,
|
|
6575
6579
|
merges,
|
|
@@ -6577,7 +6581,7 @@ function decideRelease(cwd, tickets, contract, opts = {}) {
|
|
|
6577
6581
|
lastTag,
|
|
6578
6582
|
lastReleased,
|
|
6579
6583
|
unreleasedCommits,
|
|
6580
|
-
upToDate: lastReleased === head,
|
|
6584
|
+
upToDate: lastReleased === head || lastReleased !== null && unreleasedWork === 0,
|
|
6581
6585
|
unseeded: lastTag === null
|
|
6582
6586
|
};
|
|
6583
6587
|
}
|
|
@@ -7489,7 +7493,8 @@ async function mergeAndRelease(o, decision, fresh, releaseBranch) {
|
|
|
7489
7493
|
o.emit.emit(`tagged ${tag}`);
|
|
7490
7494
|
}
|
|
7491
7495
|
}
|
|
7492
|
-
|
|
7496
|
+
const tagIsCiTrigger = o.repo.release.mode === "ci_manual" || o.repo.release.mode === "ci_auto";
|
|
7497
|
+
if (tag && (tagIsCiTrigger || remoteConfigured(o.cwd, o.repo.branch.remote))) {
|
|
7493
7498
|
if (o.dryRun) {
|
|
7494
7499
|
o.emit.emit(`would push tag ${tag} to ${o.repo.branch.remote}`);
|
|
7495
7500
|
} else {
|
|
@@ -7497,8 +7502,12 @@ async function mergeAndRelease(o, decision, fresh, releaseBranch) {
|
|
|
7497
7502
|
pushTag(o.cwd, o.repo.branch.remote, tag);
|
|
7498
7503
|
o.emit.emit(`pushed tag ${tag} to ${o.repo.branch.remote}`);
|
|
7499
7504
|
} catch (e) {
|
|
7500
|
-
|
|
7501
|
-
|
|
7505
|
+
const msg = `failed to push tag ${tag} to ${o.repo.branch.remote} \u2014 ${e.message}`;
|
|
7506
|
+
if (tagIsCiTrigger) {
|
|
7507
|
+
o.emit.error(msg);
|
|
7508
|
+
return { merged, conflicts, unbuildable, version, tag, deployed, integrated, decision, stopped: "tag push failed" };
|
|
7509
|
+
}
|
|
7510
|
+
o.emit.warn(`${msg}; other ships will not see this release marker`);
|
|
7502
7511
|
}
|
|
7503
7512
|
}
|
|
7504
7513
|
}
|
|
@@ -10042,6 +10051,7 @@ async function runOnePass(o) {
|
|
|
10042
10051
|
const breaker = o.spawnBreaker ?? new SpawnBreaker();
|
|
10043
10052
|
const ctx = { route: o.route, ship: o.ship, state: o.state, emit };
|
|
10044
10053
|
const decision = await decide(ctx);
|
|
10054
|
+
o.state.attention(o.route.route).persist(decision.attention);
|
|
10045
10055
|
if (decision.sweep.length) {
|
|
10046
10056
|
const tracker = new Tracker(o.route, o.ship);
|
|
10047
10057
|
const seat = o.route.resolved?.seats.qa ?? o.route.resolved?.seats.dev ?? "";
|
package/package.json
CHANGED