@botbuddy/cli 1.83.0 → 1.85.0
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 +8 -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/commands.mjs +2 -0
- package/src/release-notes.mjs +68 -0
- package/src/wait.mjs +33 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.85.0
|
|
4
|
+
|
|
5
|
+
- `bb release-notes digest --release <version> --voice internal|external` prints one production release's notes as Markdown, JSON (the bbrn-digest-1 schema) or Slack Block Kit (`--format`), byte for byte as the API returns them when piped, so a GitHub Actions step can post it to your own Slack or email (BOT-3204). On a terminal, control characters in a note print as visible escapes. `--repository owner/name` names the repository when a version exists in more than one; `--json` prints the whole answer.
|
|
6
|
+
|
|
7
|
+
## 1.84.0
|
|
8
|
+
|
|
9
|
+
- `bb wait` tells the staging suspect to act (BOT-3287): a wait ended because you were elected release manager says your change may have broken staging and to fix staging as a priority; a `staging-release` wake on a red train for the suspect PR says to call `claim_release_manager` now (seat open) or names the release manager (seat held); a wake with `reason: cancelled` says the run did not release your PR and how to re-arm with `after_run=<run_id>`.
|
|
10
|
+
|
|
3
11
|
## 1.83.0
|
|
4
12
|
|
|
5
13
|
- `bb release-notes publish <source_key> --to internal` shows a note to your team using the agent session; `--to external` publishes its external wording to your customers, and `bb release-notes withdraw <source_key>` takes it out of every feed. Both of those use your own sign-in and need the manage scope (BOT-3163). Each prints the new state and revision, or says that nothing changed; `--json` prints the receipt.
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.85.0",
|
|
3
|
+
"source_commit": "0597756faf47e986dc7c147b0f8fee8e77db06b4",
|
|
4
|
+
"source_sha256": "fe01dfc7bc60fb96051df54fbb1b690f7a8c535b271f39d46579c808015dd9ba",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "10d2ac05c6c9f1637a5beffc2709abf02ccd980b6ca714cf5970437abec74771"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.85.0",
|
|
3
|
+
"source_commit": "0597756faf47e986dc7c147b0f8fee8e77db06b4",
|
|
4
|
+
"source_sha256": "fe01dfc7bc60fb96051df54fbb1b690f7a8c535b271f39d46579c808015dd9ba",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "292c775e27a87b030dc719dc24b8d43a7859210cc216e3ff77c1959d3edc75bc"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.85.0",
|
|
4
|
+
"source_commit": "0597756faf47e986dc7c147b0f8fee8e77db06b4",
|
|
5
|
+
"source_sha256": "fe01dfc7bc60fb96051df54fbb1b690f7a8c535b271f39d46579c808015dd9ba",
|
|
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": "10d2ac05c6c9f1637a5beffc2709abf02ccd980b6ca714cf5970437abec74771",
|
|
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": "292c775e27a87b030dc719dc24b8d43a7859210cc216e3ff77c1959d3edc75bc",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/commands.mjs
CHANGED
|
@@ -353,6 +353,8 @@ ${bold("EVIDENCE")} (${cyan("bb help evidence")})
|
|
|
353
353
|
Publish a note to your team, or its external wording to customers
|
|
354
354
|
release-notes withdraw <source_key>
|
|
355
355
|
Take a note out of every feed (kept, never deleted)
|
|
356
|
+
release-notes digest --release <v> --voice internal|external
|
|
357
|
+
Print one release's notes as Markdown, JSON or Slack Block Kit
|
|
356
358
|
release-notes grants list|add|remove
|
|
357
359
|
Owners grant members the release-note submit or manage scope
|
|
358
360
|
release-notes tags [group|add|retire|view]
|
package/src/release-notes.mjs
CHANGED
|
@@ -12,6 +12,7 @@ export const RELEASE_NOTES_USAGE = `Usage: bb release-notes submit <note.json> [
|
|
|
12
12
|
bb release-notes withdraw <source_key> [--tenant <slug>] [--json]
|
|
13
13
|
bb release-notes list [--tag <group>=<value>]... [--type <type>] [--state <state>] [--cursor <cursor>] [--json]
|
|
14
14
|
bb release-notes get <source_key> [--json]
|
|
15
|
+
bb release-notes digest --release <version> --voice internal|external [--format markdown|json|slack] [--repository owner/name] [--json]
|
|
15
16
|
bb release-notes grants list [--tenant <slug>] [--json]
|
|
16
17
|
bb release-notes grants add <email> <submit|manage> [--tenant <slug>] [--json]
|
|
17
18
|
bb release-notes grants remove <email> <submit|manage> [--tenant <slug>] [--json]
|
|
@@ -101,6 +102,18 @@ own sign-in. A value is retired, never deleted: notes that carry it keep it.
|
|
|
101
102
|
--internal-only marks a group that is never shown externally (one-way).
|
|
102
103
|
view --show shows the tag and its filter, --tag-only the tag, --hide neither.
|
|
103
104
|
|
|
105
|
+
Digest (BOT-3204). digest prints one production release's notes, exactly as
|
|
106
|
+
the API returns them (byte for byte when piped; on a terminal, control
|
|
107
|
+
characters print as visible escapes): markdown, json (the bbrn-digest-1
|
|
108
|
+
schema) or slack ({"messages": [...]}: each message is a Block Kit payload for
|
|
109
|
+
your own incoming webhook; BotBuddy posts nothing). voice internal is your
|
|
110
|
+
team's wording with source keys and pull requests; voice external holds only
|
|
111
|
+
published external wording and never falls back to internal text. A release
|
|
112
|
+
with no notes prints an explicit empty digest. --json prints the whole answer
|
|
113
|
+
(tenant, version, note_count, content_type, body). Refusals: release_unknown,
|
|
114
|
+
repository_required, release_not_shipped, no_previous_release,
|
|
115
|
+
release_range_unavailable, entitlement_missing, scope_missing.
|
|
116
|
+
|
|
104
117
|
Exit codes: 0 stored or read · 1 refused or not found · 2 usage · 3 authentication · 5 BotBuddy unreachable.
|
|
105
118
|
|
|
106
119
|
Viewer keys and origins (tenant owners, BOT-3158):
|
|
@@ -114,6 +127,8 @@ export async function cmdReleaseNotes(args, {
|
|
|
114
127
|
call = callToolJson,
|
|
115
128
|
log = console.log,
|
|
116
129
|
errorLog = console.error,
|
|
130
|
+
write = (text) => process.stdout.write(text),
|
|
131
|
+
isTTY = process.stdout.isTTY === true,
|
|
117
132
|
} = {}) {
|
|
118
133
|
if (args.length === 0 || ["help", "--help", "-h"].includes(args[0])) {
|
|
119
134
|
(args.length === 0 ? errorLog : log)(RELEASE_NOTES_USAGE);
|
|
@@ -128,6 +143,8 @@ export async function cmdReleaseNotes(args, {
|
|
|
128
143
|
// BOT-3158: viewer keys and allowed origins.
|
|
129
144
|
if (args[0] === "keys") return await cmdReleaseNotesKeys(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
130
145
|
if (args[0] === "origins") return await cmdReleaseNotesOrigins(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
146
|
+
// BOT-3204: the per-release digest.
|
|
147
|
+
if (args[0] === "digest") return await cmdDigest(args.slice(1), { resolveAuth, call, log, errorLog, write, isTTY });
|
|
131
148
|
const json = args.includes("--json");
|
|
132
149
|
let rest = args.filter((a) => a !== "--json");
|
|
133
150
|
// BOT-3260: --pack <pack.json>, anywhere after submit.
|
|
@@ -505,6 +522,57 @@ async function cmdPublish(action, argv, { resolveAuth, call, log, errorLog }) {
|
|
|
505
522
|
return CALL_EXIT.OK;
|
|
506
523
|
}
|
|
507
524
|
|
|
525
|
+
// ── BOT-3204: bb release-notes digest ─────────────────────────────────
|
|
526
|
+
|
|
527
|
+
const DIGEST_TOOL = "get_release_note_digest";
|
|
528
|
+
const DIGEST_FLAGS = { "--release": "release", "--voice": "voice", "--format": "format", "--repository": "repository" };
|
|
529
|
+
|
|
530
|
+
export async function cmdDigest(argv, { resolveAuth, call, log, errorLog, write, isTTY = false }) {
|
|
531
|
+
const json = argv.includes("--json");
|
|
532
|
+
const args = {};
|
|
533
|
+
for (let i = 0; i < argv.length; i++) {
|
|
534
|
+
const a = argv[i];
|
|
535
|
+
if (a === "--json") continue;
|
|
536
|
+
const key = DIGEST_FLAGS[a];
|
|
537
|
+
const v = argv[i + 1];
|
|
538
|
+
if (!key || !v || v.startsWith("--") || key in args) {
|
|
539
|
+
errorLog(RELEASE_NOTES_USAGE);
|
|
540
|
+
return 2;
|
|
541
|
+
}
|
|
542
|
+
args[key] = v;
|
|
543
|
+
i++;
|
|
544
|
+
}
|
|
545
|
+
if (!args.release || !args.voice) {
|
|
546
|
+
errorLog(RELEASE_NOTES_USAGE);
|
|
547
|
+
return 2;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
let result;
|
|
551
|
+
try {
|
|
552
|
+
const resolved = await resolveAuth({ toolName: DIGEST_TOOL, preferSession: true });
|
|
553
|
+
result = resolved?.error || !resolved?.auth
|
|
554
|
+
? { ok: false, auth: true }
|
|
555
|
+
: await call(DIGEST_TOOL, args, { auth: resolved.auth, signal: AbortSignal.timeout(60_000) });
|
|
556
|
+
} catch {
|
|
557
|
+
result = { ok: false, status: null };
|
|
558
|
+
}
|
|
559
|
+
const data = result?.data;
|
|
560
|
+
if (result?.ok && data?.ok === true && typeof data.body === "string") {
|
|
561
|
+
// Piped or redirected, the API's document is written unchanged: no
|
|
562
|
+
// trailing newline is added or removed. On a terminal, note text could
|
|
563
|
+
// carry control sequences, so they print as visible escapes (tabs kept).
|
|
564
|
+
if (json) log(JSON.stringify(data));
|
|
565
|
+
else write(isTTY ? data.body.split("\t").map(termClean).join("\t") : data.body);
|
|
566
|
+
return CALL_EXIT.OK;
|
|
567
|
+
}
|
|
568
|
+
if (result?.ok && data?.ok !== false) {
|
|
569
|
+
if (json) log(JSON.stringify({ ok: false, error: "receipt_unavailable" }));
|
|
570
|
+
errorLog("✗ BotBuddy did not return a digest. Retry the same command; a digest is a read and changes nothing.");
|
|
571
|
+
return CALL_EXIT.ERROR;
|
|
572
|
+
}
|
|
573
|
+
return printRefusalOrFailure(result, json, log, errorLog, "Nothing was changed.");
|
|
574
|
+
}
|
|
575
|
+
|
|
508
576
|
// ── BOT-3166: bb release-notes list | get ──────────────────────────────
|
|
509
577
|
|
|
510
578
|
function readUsage(errorLog) {
|
package/src/wait.mjs
CHANGED
|
@@ -946,7 +946,7 @@ export function waitPreemptedNotice(receipt, conditionArgs = [], options = {}) {
|
|
|
946
946
|
`${inc.run_url ? ` (${inc.run_url})` : ""}`;
|
|
947
947
|
let role;
|
|
948
948
|
if (st.role === "release_manager") {
|
|
949
|
-
role = "you are now the release manager — call get_staging_gate for the next steps";
|
|
949
|
+
role = "you are now the release manager — your change may have broken staging, so fix staging as a priority; call get_staging_gate for the next steps";
|
|
950
950
|
} else if (st.rm_seat_open) {
|
|
951
951
|
role = "the release-manager seat is OPEN — call claim_release_manager, then get_staging_gate";
|
|
952
952
|
} else {
|
|
@@ -957,9 +957,40 @@ export function waitPreemptedNotice(receipt, conditionArgs = [], options = {}) {
|
|
|
957
957
|
`bb-wait: re-arm (exit ${EXIT.PREEMPTED}): ${rearm}`;
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
+
/**
|
|
961
|
+
* BOT-3287: a `staging-release` wake that needs the agent to act, not triage.
|
|
962
|
+
* - The suspect PR's waiter on a red train is told its change may have broken staging,
|
|
963
|
+
* and either to claim the open release-manager seat now or who holds it.
|
|
964
|
+
* - A train that carried the PR and ended cancelled (reason "cancelled") is named, so a
|
|
965
|
+
* dead candidate is noticed at once.
|
|
966
|
+
* Returns null for every other receipt.
|
|
967
|
+
*/
|
|
968
|
+
export function stagingSuspectNotice(receipt) {
|
|
969
|
+
if (receipt?.outcome !== "matched" || !Array.isArray(receipt.matched)) return null;
|
|
970
|
+
const entry = receipt.matched.find((m) => m?.signal_type === "staging_release");
|
|
971
|
+
const p = entry?.payload;
|
|
972
|
+
if (!p || typeof p !== "object") return null;
|
|
973
|
+
const repo = p.repo ?? "?";
|
|
974
|
+
const lines = [];
|
|
975
|
+
if (p.reason === "cancelled") {
|
|
976
|
+
lines.push(`bb-wait: staging ${repo} run ${p.workflow_run_id ?? "?"} ended ${p.conclusion ?? "cancelled"} — it did not release your PR; ` +
|
|
977
|
+
`re-arm with after_run=${p.workflow_run_id ?? "?"} for the next train, or re-run it.`);
|
|
978
|
+
}
|
|
979
|
+
const inc = p.incident && typeof p.incident === "object" ? p.incident : null;
|
|
980
|
+
if (inc?.you_are_suspect === true) {
|
|
981
|
+
const head = `bb-wait: staging ${repo} is red and your PR #${inc.suspect_pr_number ?? p.pr_number ?? "?"} is the suspect — your change may have broken staging`;
|
|
982
|
+
if (inc.next_action === "claim_release_manager" || inc.rm_seat_open === true) {
|
|
983
|
+
lines.push(`${head}. The release-manager seat is OPEN — call claim_release_manager now, then fix staging as a priority (get_staging_gate for the next steps).`);
|
|
984
|
+
} else {
|
|
985
|
+
lines.push(`${head}; release manager: ${inc.release_manager_name ?? "assigned"}. If that is you, fix staging as a priority (get_staging_gate for the next steps).`);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return lines.length > 0 ? lines.join("\n") : null;
|
|
989
|
+
}
|
|
990
|
+
|
|
960
991
|
function writeLeaseLostNotice(receipt, conditionArgs = [], options = {}) {
|
|
961
992
|
const notice = leaseLostNotice(receipt) ?? waitAbandonedNotice(receipt) ?? reviewTimeoutNotice(receipt) ??
|
|
962
|
-
waitPreemptedNotice(receipt, conditionArgs, options);
|
|
993
|
+
waitPreemptedNotice(receipt, conditionArgs, options) ?? stagingSuspectNotice(receipt);
|
|
963
994
|
if (notice) process.stderr.write(`${notice}\n`);
|
|
964
995
|
}
|
|
965
996
|
|