From eb8121729758adac4a251f144bac6e2fdd32c8da Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 18:47:25 +0100 Subject: [PATCH] fix(kit): bin/live says when it skips the check, and --again runs it anyway A record covers the shipped code, not scripts/live.sh. After a change to the script alone, bin/live found the version's old record, skipped the run and printed it as a pass. ydisk #12 added a live step that therefore never ran against the Disk (found 2026-11-18; the step later passed in ydisk #13 after removing the record by hand). Co-Authored-By: Claude Opus 5.5 --- bin/live | 21 ++++++++++++++++----- changes/feat-live-again.md | 5 +++++ kit/README.md | 3 ++- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 changes/feat-live-again.md diff --git a/bin/live b/bin/live index 5737443..463f7be 100755 --- a/bin/live +++ b/bin/live @@ -4,13 +4,14 @@ // scripts/live.sh with the token on stdin, records the pass in docs/dev/live-checks.txt and, when the branch has an // open pull request, commits the record, pushes it and adds its line to the pull request's Conformance section. // -// bin/live [arguments for scripts/live.sh, such as the test page's link] +// bin/live [--again] [arguments for scripts/live.sh, such as the test page's link] // // Linux only: it reads the keyring with secret-tool and runs scripts/live.sh with bash. // The token is the keyring entry `service clidev-app-live account `, stored once with // secret-tool store --label="clidev live check" service clidev-app-live account // It stays in this process and reaches scripts/live.sh on stdin only: never an argument, the environment or the -// screen. A version whose shipped code already has a record is not checked again. +// screen. A version whose shipped code already has a record is not checked again, and it says so; --again runs the +// check anyway, as after a change to scripts/live.sh alone, which the record does not cover. import { execFileSync, spawnSync } from "node:child_process" import { existsSync, readFileSync, realpathSync } from "node:fs" import { join, resolve } from "node:path" @@ -105,16 +106,26 @@ const check = async (account, version, args) => { } const main = async () => { - const [account, ...args] = process.argv.slice(2) + const [account, ...rest] = process.argv.slice(2) + const again = rest.includes("--again") + const args = rest.filter((arg) => arg !== "--again") if (!account || account === "--help" || account === "-h") { - process.stdout.write(`Usage: ${join(ROOT, "bin/live")} [arguments for scripts/live.sh]\n`) + const usage = " [--again] [arguments for scripts/live.sh]" + process.stdout.write(`Usage: ${join(ROOT, "bin/live")} ${usage}\n`) process.exitCode = account ? 0 : 2 return } if (existsSync(KIT)) fail("this is cli-template itself, which has no service to check") const { version } = JSON.parse(readFileSync(PACKAGE_JSON, "utf8")) const current = run("pnpm", ["exec", "cli-dev", "live", "check", "--version", version], { stdio: "ignore" }) - const record = current.status === 0 ? recordOf(version) : await check(account, version, args) + const checked = current.status === 0 && !again + if (checked) { + process.stdout.write( + `Not run: ${version}'s shipped code already passed. Run with --again to check it anyway, as after a change to ` + + "scripts/live.sh alone.\n", + ) + } + const record = checked ? recordOf(version) : await check(account, version, args) if (!record) fail(`no record for ${version} in ${RECORDS}`) const view = run("gh", ["pr", "view", "--json", "url,state,body"], { stdio: ["ignore", "pipe", "ignore"] }) diff --git a/changes/feat-live-again.md b/changes/feat-live-again.md new file mode 100644 index 0000000..743d9c2 --- /dev/null +++ b/changes/feat-live-again.md @@ -0,0 +1,5 @@ +### Fixed + +- `bin/live` says when it does not run the check because the version's shipped code already passed, and `--again` + runs it anyway. A change to `scripts/live.sh` alone is not part of the record, so before this the new steps were + silently skipped and the old record was reported as a pass. diff --git a/kit/README.md b/kit/README.md index 517e83a..988d6f4 100644 --- a/kit/README.md +++ b/kit/README.md @@ -39,7 +39,8 @@ The steps run the owner's scripts the CLI gets, each one readable file that prin - `bin/live ` runs `scripts/live.sh` against a test account. It prints the script's `# Needs:` lines, reads the token from the keyring entry `service -live account ` and passes it on stdin, records the pass, and on a release branch commits the record and adds it to the pull request's Conformance - section (WC-REL-17). + section (WC-REL-17). A version whose shipped code already passed is not run again; `--again` runs it anyway, as + after a change to `scripts/live.sh` alone. With `--spec` other than `none`, `new` also builds the `api` group from the service's API description: one command per operation through cli-core's `serviceApiCommand`, its permissions, its tests against cli-base's `fakeApi`, and the