@botbuddy/cli 1.93.0 → 1.93.1
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/CHANGELOG.md +4 -0
- package/daemon/bin/darwin-arm64/botbuddy-daemon +0 -0
- package/daemon/bin/linux-x64/botbuddy-daemon +0 -0
- package/daemon-release/darwin-arm64.json +4 -4
- package/daemon-release/linux-x64.json +4 -4
- package/daemon-release/manifest.json +5 -5
- package/package.json +1 -1
- package/src/push-status.mjs +20 -2
- package/src/push.mjs +2 -2
- package/src/run.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.93.1
|
|
4
|
+
|
|
5
|
+
- BOT-3362: the `bb push` receipt's `push` field gains `failed_hooks`, which names each lefthook job that refused the push, read from lefthook's summary. A push refused by a job that runs outside lane telemetry (for example `pr-docs`) is now `hooks_failed`, not `push_failed`. A remote rejection, with every hook passed, stays `push_failed`.
|
|
6
|
+
|
|
3
7
|
## 1.93.0
|
|
4
8
|
|
|
5
9
|
- BOT-3362: `bb push [git push args]` runs the push (pre-push lanes and the push) as a tracked, detached command run and returns at once with its run id. `bb wait 'push:id=<id>'` returns the terminal receipt. Its `push` field lists each lane's result, its compute slot wait and load wait, the totals, the outcome (`pushed`, `hooks_failed`, `push_failed`, `interrupted`, `timed_out`) and the gate (`gated`, `no_hooks`, `ungated` for `LEFTHOOK=0`). `waiting_over=<s>` also wakes once the push has held for host compute that long; this wake is local. The live phase is written to `~/.botbuddy/command-runs/<id>.context.json.push.json`. A second push from the same worktree is refused (exit 4 `push_in_progress`) and names the first push.
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.93.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.93.1",
|
|
3
|
+
"source_commit": "555e8917df316b940fdd1c9ec5ddd862f7e80f3e",
|
|
4
|
+
"source_sha256": "e3a8ddf0f88acf8969071e48b62b5b3f4c4ddb4ca73467b3d5a3edb9a1721500",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "1639c59335acd37f14183ecc6e8a6d27682a7d84663bbd67b6dc5f9dd92b47fd"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.93.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.93.1",
|
|
3
|
+
"source_commit": "555e8917df316b940fdd1c9ec5ddd862f7e80f3e",
|
|
4
|
+
"source_sha256": "e3a8ddf0f88acf8969071e48b62b5b3f4c4ddb4ca73467b3d5a3edb9a1721500",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "cb9679de790021710f9c09405d74cf1984c981e0588cdb6427006c9fa72ba0e7"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.93.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.93.1",
|
|
4
|
+
"source_commit": "555e8917df316b940fdd1c9ec5ddd862f7e80f3e",
|
|
5
|
+
"source_sha256": "e3a8ddf0f88acf8969071e48b62b5b3f4c4ddb4ca73467b3d5a3edb9a1721500",
|
|
6
6
|
"targets": {
|
|
7
7
|
"darwin-arm64": {
|
|
8
8
|
"goos": "darwin",
|
|
9
9
|
"goarch": "arm64",
|
|
10
10
|
"binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "1639c59335acd37f14183ecc6e8a6d27682a7d84663bbd67b6dc5f9dd92b47fd",
|
|
12
12
|
"mode": "0755"
|
|
13
13
|
},
|
|
14
14
|
"linux-x64": {
|
|
15
15
|
"goos": "linux",
|
|
16
16
|
"goarch": "amd64",
|
|
17
17
|
"binary": "daemon/bin/linux-x64/botbuddy-daemon",
|
|
18
|
-
"sha256": "
|
|
18
|
+
"sha256": "cb9679de790021710f9c09405d74cf1984c981e0588cdb6427006c9fa72ba0e7",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/push-status.mjs
CHANGED
|
@@ -86,21 +86,39 @@ const sumOrNull = (values) => {
|
|
|
86
86
|
return present.length ? present.reduce((a, b) => a + b, 0) : null;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
const ANSI = /\u001b\[[0-9;]*m/g;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The lefthook jobs that failed, from lefthook's own summary in the push's output
|
|
93
|
+
* (`✗ <job> (<n> seconds)`). It names every refusing job, including the ones that
|
|
94
|
+
* run outside lane telemetry (BOT-3362 acceptance, run aa131db8: `pr-docs`).
|
|
95
|
+
*/
|
|
96
|
+
export function failedHooksFromOutput(output) {
|
|
97
|
+
const failed = [];
|
|
98
|
+
for (const line of String(output ?? "").replace(ANSI, "").split("\n")) {
|
|
99
|
+
const match = /^\s*✗\s+([A-Za-z0-9_.:@/-]+)\s+\(/.exec(line);
|
|
100
|
+
if (match && !failed.includes(match[1])) failed.push(match[1]);
|
|
101
|
+
}
|
|
102
|
+
return failed;
|
|
103
|
+
}
|
|
104
|
+
|
|
89
105
|
/** The receipt's `push` field: each lane's result and compute wait, and the outcome. */
|
|
90
|
-
export function pushSummary({ status, gate, launchedAt, invocationState }) {
|
|
106
|
+
export function pushSummary({ status, gate, launchedAt, invocationState, hookOutput = "" }) {
|
|
91
107
|
const own = gate === "ungated" ? null : ownInvocation(invocationState, launchedAt);
|
|
92
108
|
const lanes = Object.entries(own?.lanes ?? {}).map(([lane, v]) => ({
|
|
93
109
|
lane, outcome: v?.outcome ?? null, waiting_ms: v?.waiting_ms ?? 0,
|
|
94
110
|
slot_wait_ms: v?.compute?.slot_wait_ms ?? null, load_wait_ms: v?.compute?.load_wait_ms ?? null,
|
|
95
111
|
load_ratio_at_start: v?.compute?.load_ratio_at_start ?? null,
|
|
96
112
|
}));
|
|
113
|
+
const failedHooks = status === "success" ? [] : failedHooksFromOutput(hookOutput);
|
|
97
114
|
const outcome = {
|
|
98
115
|
success: "pushed", cancelled: "interrupted", timed_out: "timed_out", owner_lost: "owner_lost",
|
|
99
|
-
failure: lanes.some((l) => FAILED_LANE_OUTCOMES.has(l.outcome)) ? "hooks_failed" : "push_failed",
|
|
116
|
+
failure: lanes.some((l) => FAILED_LANE_OUTCOMES.has(l.outcome)) || failedHooks.length ? "hooks_failed" : "push_failed",
|
|
100
117
|
}[status] ?? status;
|
|
101
118
|
return {
|
|
102
119
|
outcome,
|
|
103
120
|
gate: gate === "ungated" ? "ungated" : own ? "gated" : "no_hooks",
|
|
121
|
+
failed_hooks: failedHooks,
|
|
104
122
|
invocation_id: own?.invocation_id ?? null,
|
|
105
123
|
lanes,
|
|
106
124
|
slot_wait_ms: sumOrNull(lanes.map((l) => l.slot_wait_ms)),
|
package/src/push.mjs
CHANGED
|
@@ -214,8 +214,8 @@ export function startPushMonitor(context, call, {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
/** The receipt's push summary for a finished run, and release of the worktree lock. */
|
|
217
|
-
export function finishPush(context, status) {
|
|
218
|
-
const summary = pushSummary({ status, gate: context.push.gate, launchedAt: context.launched_at, invocationState: readInvocationState(context.push.root) });
|
|
217
|
+
export function finishPush(context, status, hookOutput = "") {
|
|
218
|
+
const summary = pushSummary({ status, gate: context.push.gate, launchedAt: context.launched_at, invocationState: readInvocationState(context.push.root), hookOutput });
|
|
219
219
|
const lockPath = join(context.push.root, ".botbuddy", PUSH_LOCK_FILE);
|
|
220
220
|
if (readJson(lockPath)?.run_id === context.run_id) rmSync(lockPath, { force: true });
|
|
221
221
|
return summary;
|
package/src/run.mjs
CHANGED
|
@@ -1215,7 +1215,7 @@ async function finalize(context, state, call, retry = {}) {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
// BOT-3362: each pre-push lane's result and compute wait, and the push's outcome.
|
|
1217
1217
|
if (context.push) {
|
|
1218
|
-
try { receipt.push = finishPush(context, state.status); } catch { /* the command receipt stands without it */ }
|
|
1218
|
+
try { receipt.push = finishPush(context, state.status, boundedLog); } catch { /* the command receipt stands without it */ }
|
|
1219
1219
|
}
|
|
1220
1220
|
await writeJson(context.receipt_path, receipt);
|
|
1221
1221
|
const bytes = await stat(context.receipt_path);
|