merge-steward 0.8.3 → 0.8.5
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 +5 -0
- package/dist/reconciler.js +2 -2
- package/dist/watch/format.js +8 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,11 @@ export async function runCli(argv, options) {
|
|
|
15
15
|
const runCommand = options?.runCommand ?? defaultRunCommand;
|
|
16
16
|
try {
|
|
17
17
|
const parsed = parseArgs(argv);
|
|
18
|
+
if (parsed.flags.get("version") === true || parsed.positionals[0] === "version") {
|
|
19
|
+
const { version } = await import("../package.json", { with: { type: "json" } }).then((m) => m.default);
|
|
20
|
+
writeOutput(stdout, `merge-steward ${version}\n`);
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
18
23
|
validateFlags(parsed);
|
|
19
24
|
const command = parsed.positionals[0] ?? "help";
|
|
20
25
|
if (hasHelpFlag(parsed) || command === "help") {
|
package/dist/reconciler.js
CHANGED
|
@@ -221,7 +221,7 @@ async function prepareEntry(ctx, entry, isHead, prevEntry) {
|
|
|
221
221
|
ctx.store.transition(entry.id, "validating", {
|
|
222
222
|
baseSha, ciRunId: runId, lastFailedBaseSha: null,
|
|
223
223
|
specBranch: specName, specSha, specBasedOn: isHead ? null : prevEntry.id,
|
|
224
|
-
}, `spec
|
|
224
|
+
}, `spec ready, CI ${runId.slice(0, 12)}`);
|
|
225
225
|
}
|
|
226
226
|
function describeMainBroken(failingChecks, pendingChecks) {
|
|
227
227
|
const parts = [];
|
|
@@ -247,7 +247,7 @@ async function checkValidation(ctx, entry, allActive, index) {
|
|
|
247
247
|
const sha = entry.specSha ?? entry.headSha;
|
|
248
248
|
const runId = await ctx.ci.triggerRun(branch, sha);
|
|
249
249
|
emit(ctx, entry, "ci_triggered", { ciRunId: runId });
|
|
250
|
-
ctx.store.transition(entry.id, "validating", { ciRunId: runId }, `CI triggered: ${runId}`);
|
|
250
|
+
ctx.store.transition(entry.id, "validating", { ciRunId: runId }, `CI triggered: ${runId.slice(0, 12)}`);
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
253
|
const status = await ctx.ci.getStatus(entry.ciRunId);
|
package/dist/watch/format.js
CHANGED
|
@@ -128,17 +128,23 @@ const STATUS_DISPLAY = {
|
|
|
128
128
|
function displayStatus(status) {
|
|
129
129
|
return STATUS_DISPLAY[status] ?? status;
|
|
130
130
|
}
|
|
131
|
+
/** Truncate hex strings longer than 12 chars (SHAs, run IDs) to 8 chars. */
|
|
132
|
+
function shortenHashes(text) {
|
|
133
|
+
return text.replace(/\b[0-9a-f]{13,}\b/g, (match) => match.slice(0, 8));
|
|
134
|
+
}
|
|
131
135
|
export function formatEventSummary(event) {
|
|
132
136
|
const from = event.fromStatus ? displayStatus(event.fromStatus) : null;
|
|
133
137
|
const to = displayStatus(event.toStatus);
|
|
134
138
|
const transition = from ? `${from} \u2192 ${to}` : to;
|
|
135
|
-
|
|
139
|
+
const detail = event.detail ? ` (${shortenHashes(event.detail)})` : "";
|
|
140
|
+
return `#${event.prNumber} ${transition}${detail}`;
|
|
136
141
|
}
|
|
137
142
|
export function formatEntryEvent(event) {
|
|
138
143
|
const from = event.fromStatus ? displayStatus(event.fromStatus) : null;
|
|
139
144
|
const to = displayStatus(event.toStatus);
|
|
140
145
|
const transition = from ? `${from} \u2192 ${to}` : to;
|
|
141
|
-
|
|
146
|
+
const detail = event.detail ? ` (${shortenHashes(event.detail)})` : "";
|
|
147
|
+
return `${transition}${detail}`;
|
|
142
148
|
}
|
|
143
149
|
export function formatDuration(ms) {
|
|
144
150
|
const seconds = Math.floor(ms / 1000);
|