8000 fix: render download progress during min add by gominimal-aw-bot[bot] · Pull Request #1213 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix: render download progress during min add - #1213

Merged
norrietaylor merged 4 commits into
mainfrom
inbox-patch/min-add-progress-17b8e8ebf0c7d101
Aug 24, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
inbox-patch/min-add-progress-17b8e8ebf0c7d101

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Aug 12, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABLow0qA

min add downloaded packages with no visible progress — the first-time fetch of a package showed only a static line while bytes downloaded and the archive extracted. The instrumentation already existed: rcache::materialize reports FetchPkg/ExtractPkg operations through an ot::OpTracker, and mip renders that tree to stderr from run_cli. min never created a tracker or started a renderer, so config.ot was None and those operations drew nowhere. This attaches the same process-global tracker mip uses to the shared build_config, spawning the stderr renderer once per process, so min add shows a live progress tree while packages download and materialize. The renderer stays hidden on non-TTY output. (informed by #591)

Verification

cargo fmt --all --check — passed
cargo clippy --workspace --locked -- -D warnings — passed, 0 warnings
cargo build --workspace --locked — passed
cargo test --workspace --locked — passed, 84 suites ok, 0 failed

Note

Render download progress to stderr during min add

Attaches an ot::OpTracker to the config in build_config by calling with_operation_tracker(operation_tracker()), where operation_tracker() lazily initializes a process-global tracker via OnceLock and starts ot::render_to_stderr on first use. This causes progress output to appear in stderr when running min add.

Macroscope summarized 40cbca9.

Summary by CodeRabbit

  • New Features
    • Added live progress reporting for build-system commands during package installation.
    • Progress information is displayed in the command-line output alongside build errors.
    • Cached builds remain quiet and do not produce unnecessary progress output.

min never created an ot operation tracker or started its stderr
renderer, so the FetchPkg/ExtractPkg operations that rcache already
reports while download_if_available fetches and extracts cached
packages had nowhere to draw — min add appeared to hang on a static
line. mip wires this in run_cli; min's build_config did not.

Attach a process-global OpTracker to every Config the package commands
build and spawn its renderer once per process, matching mip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai
coderabbitai Bot commented Aug 12, 2026 •
Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7bbf7a4-7e2f-492d-9516-5dbe6ab0eb6d

📥 Commits

Reviewing files that changed from the base of the PR and between 40cbca9 and e49054c.

📒 Files selected for processing (1)
  • crates/minimald/src/env.rs

Included review availability: 4 reviews are currently available. Based on recent review activity, included reviews refill at 5 per hour.


📝 Walkthrough

Walkthrough

The minimal crate now initializes one process-global operation tracker with stderr rendering. build_config clones this tracker into each generated mctx::Config. Package installation streams build progress through BuildRenderer and session responses.

Changes

Build progress reporting

Layer / File(s) Summary
Tracker initialization and configuration wiring
crates/minimal/src/lib.rs
A lazily initialized global operation tracker starts stderr rendering once. build_config attaches a cloned tracker to generated configurations.
Installation progress streaming
crates/minimald/src/env.rs
SessionChannel::install passes an asynchronous log channel to build_graph, renders progress events as msg: responses, and reports build errors after rendering completes. Cached builds remain quiet.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to e4905

The change enables download progress rendering for min add while keeping non-TTY output hidden, with no actionable merge-blocking risk remaining after normal checks and review.

Possibly related PRs

  • gominimal/minimal#960: Introduced the BuildRenderer and build-progress streaming infrastructure used by this change.

Suggested reviewers: twitchyliquid64

Poem

A rabbit sees the build logs stream,
Through tracker paths and messages gleam.
Builds report progress as they run,
Then errors speak when work is done.
Hop, hop—the quiet cache stays calm!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: rendering download progress during min add.
Description check ✅ Passed The description explains the change and includes detailed verification results, although it uses Verification instead of the template's Testing heading and omits the checklist.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch inbox-patch/min-add-progress-17b8e8ebf0c7d101

Comment @coderabbitai help to get the list of available commands.

@norrietaylor
norrietaylor marked this pull request as ready for review August 17, 2026 16:31
@norrietaylor
norrietaylor requested a review from a team as a code owner August 17, 2026 16:31
@twitchyliquid64 twitchyliquid64 left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wires the ot to min add outside the session, which I dont think actually downloads or sets up the packages. You actually want to wire up progress output here:

async fn install(&mut self, pkgs: &[(&str, BuildSpecRef)], stream: &mut UnixStream) {

`min add` inside a session builds and fetches its packages through
`SessionChannel::install`, which drew nothing while packages
downloaded and extracted. Attach a log sink to the install's
`build_graph` and render its events over the command channel as
`msg:` lines, through the same `BuildRenderer` that `min build`
uses, so both read identically. A fully-cached add emits no events
and stays quiet, matching today's behavior.

Refs: #1213

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@norrietaylor
8000 Copy link
Copy Markdown
Member

Wired the in-session path in e49054c: SessionChannel::install now attaches a log sink to its build_graph and renders the events over the command channel as msg: lines — the same BuildRenderer that min build uses, so both read identically (env.rs#L713-L737). A first-time in-session min add now shows fetching <pkg> as packages hydrate from the remote cache and building <pkg> for real builds; a fully-cached add emits no events, so the quiet no-op case is unchanged. (The line protocol the sandbox helper speaks can't carry an ANSI progress tree, so this streams lines rather than attaching the ot renderer.)

On the outside-the-session half: host-side min add does download — cmd_add ends with ctx.download_if_available(...) (lib.rs#L3314), which fetches any not-locally-cached package via rc.materialize, and that remote cache carries config.ot (attached in Context::remote_cache). So the original tracker wiring does draw a live progress tree for that fetch (and for min update's trailing download); I've kept it for that path rather than moving it. Happy to drop it if you'd rather the host CLI stay silent.

Comment thread crates/minimal/src/lib.rs Resolved
Comment thread crates/minimald/src/env.rs Resolved
Review feedback on #1213: the package work a session cares about happens
daemon-side, where SessionChannel::install already streams progress
(e49054c). The host CLI needs no process-global tracker; host-side
trailing downloads stay quiet as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@norrietaylor
norrietaylor merged commit e688a55 into main Aug 24, 2026
33 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/min-add-progress-17b8e8ebf0c7d101 branch August 24, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0