Repository navigation
Report program status from preflight, login, downloads and push - #1041
Merged
Merged
Conversation
Extend OSC 7501 program status reporting to the remaining long-running commands, each ending with done, error, or idle when the user cancels: - bk preflight reports each step and job progress while watching - bk auth login reports blocked on auth while waiting for the browser or device code - bk artifacts download reports per-artifact progress - bk build download and bk package push report their outcome bk build watch now reports idle on Ctrl-C. It exits with a user-aborted error rather than success, so a chained command does not run. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-e8ace642-180b-4cd2-a865-21662f7a18ca
Address review feedback on the program status reporting: - Report the outcome of bk artifacts download, bk build download and bk package push from Run, so build resolution failures and the --web browser step are covered and only one final report is sent. - Report "No matching artifacts found" rather than claiming a download when no artifacts match. - Catch Ctrl-C in bk build watch only once the build is resolved. The resolver's prompts read stdin without watching the context, so a signal could not stop them. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-e8ace642-180b-4cd2-a865-21662f7a18ca
wolfeidau
marked this pull request as ready for review
October 16, 2026 00:27
mcncl
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #1040, which added OSC 7501 program status reporting for spinners, prompts and
bk build watch. This extends it to the remaining long-running commands, so a terminal can show what they are doing and how they ended.Each command now leaves a final record:
doneon success,errorwith the message on failure, oridlewhen the user cancels. The spec says a program should reportdoneorerrorjust before it exits, so the user finds the result when they come back.Changes
programstatus.Finish(err, msg)maps an outcome to the final report. A user cancel (context.Canceled) isidle; timeouts are failures.bk preflightreports each step (pushing the snapshot, creating the build, cleanup) and job progress while watching. The preflight renderer is wrapped so events become reports, andRunreports the outcome after cleanup and build cancellation.bk auth loginreportsblocked kind=authwhile waiting for the browser or the device code. The browser flow moved intorunBrowserLogin, next torunDeviceLogin, so both share the final report.bk artifacts downloadreports per-artifact progress. It,bk build downloadandbk package pushreport their outcome fromRun, so build resolution failures and the--webbrowser step are included. No matching artifacts reports "No matching artifacts found" rather than claiming a download.bk build watchnow handles Ctrl-C like other commands and reportsidle. Signals are only caught once the build is resolved, because the resolver's prompts read stdin without watching the context. It returns a user-aborted error (exit 130, as before) instead of the previousCanceled → nilpath, sobk build watch && deploydoes not deploy after an interrupt.donemessagebk preflightworkingper step, then job progress--no-watch)bk auth loginblocked kind=auth"Sign in to Buildkite in your browser" / "Enter code WXYZ-1234 to sign in to Buildkite"bk artifacts downloadworking"Downloading artifact 2 of 3" with progressbk build download,bk package pushworkingfrom the spinnerTesting
go test ./...)go fmt ./...)I also ran the built binary in a PTY against a fake HTTPS API for each command, with both success and failure responses, and saw the reports above. Ctrl-C during preflight and
build watchreportedidleand exited 130. With stdout redirected, no reports reached stdout, and preflight's TTY screen rendered the same as onmain.After review, I also checked no matching artifacts (
done"No matching artifacts found", exit 0), resolution failures in both download commands (error, exit 1),bk package push --webwith no browser (error, exit 1) and Ctrl-C while polling inbuild watch(idle, exit 130).