Repository navigation
feat(cli): add void build logs command - #244
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_688b1352-8dc5-40e1-85ba-553792622f23) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78c4b88be6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tput Adversarial-review findings: followBuildLogs now retries transient poll failures (fatal only on 401/403/404) instead of exiting the tail; --output truncates the file once before the initial dump so re-downloads don't concatenate stale logs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…etch Confirm-closure finding: the first getBuildLogs(since=0) was outside the retry loop, so a transient error on the first poll still killed --follow. Hoist isFatal/onRetry and apply the same policy to the first fetch (fatal only on 401/403/404; one-shot mode still exits on any error). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hile following Reviewer (Codex #244) flagged that a permanent platform error like the version gate's 426 cli_outdated would be retried forever under `void build logs -f` (isFatal matched only 401/403/404). The gate isn't wired to the build-logs routes today so it's unreachable, but harden defensively to match the rest of the CLI, which always treats 426 as terminal: extract an exported isFatalFollowError that classifies any 4xx except 429 (rate limit, transient) as fatal. Surfaces the verbatim upgrade message and exits instead of looping. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
78c4b88 to
0dd7496
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_6d55c4c1-2514-49f8-b706-6fa11ac137dd) |
What
Adds a
void build logsCLI command so project owners can view, follow, and download their container build logs directly — closing the gap where container build logs were previously admin-only.How
PlatformClient:listBuilds(projectId, limit)+getBuildLogs(projectId, buildId, since)fronting the new owner-guarded platform routes (GET /projects/:id/builds,GET /projects/:id/builds/:buildId/logs).build-args.ts:parseBuildArgs—-f/--follow,-o/--output <file>,-p/--project <name>,[buildId]positional; rejects unknown flags / a second positional / unknown subcommands.build-cmd.ts:runBuildLogsCommandresolves the project + latest build, prints the first page, then either exits or enters a pure, injectablefollowBuildLogsloop that advances alastSeqcursor and stops on terminal status.github_actionsbuilds have no in-platform log store — the command links out to their GitHub Actions run instead.--outputtruncates once up front, then appends each page (safe for both dump and follow).cli.ts) as a top-levelbuildgroup + interactive menu entry, and documented inhelp.tsanddocs/reference/cli.md.Tests
build-args.test.ts(10),build-client.test.ts(4),build-logs-follow.test.ts(3) — 17 passing.voidpackage typecheck / fmt / lint all clean.Notes
This is the framework (open-source) half of the feature. The platform half — the two owner-guarded routes it calls — is a separate PR on
void-platform. Thevoid-platformsubmodule pointer will be re-pointed to this PR's merge commit after it lands.🤖 Generated with Claude Code
Note
Low Risk
Read-only CLI feature gated on existing auth; behavior depends on companion platform routes landing, but failure modes are localized to build log access with solid test coverage for follow/retry logic.
Overview
Adds
void build logsso project owners can print, live-tail (-f), or save (-o) container build logs from the platform, defaulting to the latest build when no build id is given.PlatformClientgainslistBuildsand paginatedgetBuildLogs(via asince/lastSeqcursor) against owner-scoped RDS routes.build-cmdresolves project like deploy (--project,VOID_PROJECT, linked project), handles GitHub Actions builds by printing the external Actions URL instead of streaming, truncates--outputonce then appends during follow, and usesfollowBuildLogswith retries on transient errors (5xx, 429) while treating most 4xx (including 426cli_outdated) as fatal.The new
buildcommand group is registered incli.ts,help.ts, anddocs/reference/cli.md, with unit tests for arg parsing, client calls, and the follow loop.Reviewed by Cursor Bugbot for commit 0dd7496. Bugbot is set up for automated code reviews on this repo. Configure here.