- MCP
- show on this site's /mcp
- CLI
- abso show 11 --json
- JSON
- /christopher/abso-core/versions/11?format=json
Exit 1 when a file is left out for size: record and publish say so and still send the rest. Measured on abso 156: both exited 0 with a 21 MB file missing, so a script or CI read success. withLeftOut in commands.ts, used by record and publish; the existing blobs test now expects exit 1 and the left-out line and JSON (client suite: 170 pass). init is unchanged (its exit stays 0).
of shared·review··Not checked
Version 10 · Files at version 11
3 files, 47 lines added, 14 removed.
--- a/client/src/commands.ts
+++ b/client/src/commands.ts
@@ -120,6 +120,21 @@
122122
124+ * A command that left files out for size did not do everything it was asked: say so in the exit code too, so
125+ * a script, CI or an agent cannot read "ok" while a file is missing. Other exits (refused, queued) stay as they are.
129+ const text = out.text.includes("Left out,") ? out.text : [out.text, ...leftOutText(leftOut)].join("\n");
132+ text: `${text}\nExit ${EXIT.error}: ${leftOut.length} file${leftOut.length === 1 ? " was" : "s were"} not sent.`,
137+
124139export async function uploadBlobs(api: Api, blobs: ReadonlyMap<string, BlobToSend>): Promise<void> {
@@ -290,16 +305,19 @@
292307 : `Recorded ${recordedList(r)}${changed === undefined ? "" : `; ${changed} changed on the server`}.`;
293− return {
294− text: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join("\n"),
295− json: {
296− sent: r.sent,
297− changed: r.changed ?? null,
298− news: newsLines(r.news),
299− leftOut: r.leftOut,
300− turnedBinary: r.turnedBinary,
302− };
304322
--- a/client/src/publish-commands.ts
+++ b/client/src/publish-commands.ts
@@ -18,10 +18,11 @@
24−import { absolute, forgetKnown, isLocalOnly, loadIgnore, readText, writeFileAtomic } from "./folder.ts";
25+import { absolute, forgetKnown, isLocalOnly, type LeftOut, loadIgnore, readText, writeFileAtomic } from "./folder.ts";
@@ -186,15 +187,17 @@
189− const steps = publishSteps(args, env, root, config, api, message, checked, waitSeconds, skippedCheck);
191+ const steps = publishSteps(args, env, root, config, api, message, checked, waitSeconds, skippedCheck, leftOut);
190192 // Say how far it got when the server can't be reached (#37, GAME - UI/UX: did the check run? did the draft go up?).
191− const out = await unreached(
196198 `${checked ? "The check passed; " : ""}the publish may have reached the server before its answer was lost: abso status shows whether your draft was published.`,
198201 // --done: this publish finishes the work the start note named (#44): take the note back once it's published or queued.
@@ -282,8 +285,10 @@
287292 const pre = [...recordedFirst(recorded), ...droppedIgnoredText(await dropIgnoredFromDraft(root, api))];
289294 // Publishing now would leave the others on the file's old text without anyone noticing (#25).
--- a/client/test/client.test.ts
+++ b/client/test/client.test.ts
@@ -232,7 +232,12 @@
235− assert.equal((await avcs(dir, "record")).json.sent, 0, "the known blobs match");
236241
@@ -251,7 +256,12 @@
252257 /NOT SENT: b\.txt was text and now has a NUL byte at line 1 \(byte 0\)\..*pass --binary b\.txt\.\nNot published\./,
254− assert.equal((await avcs(dir, "publish", "-m", "new picture, b is binary now", "--binary", "b.txt")).exit, 0);
260+ const published = await avcs(dir, "publish", "-m", "new picture, b is binary now", "--binary", "b.txt");