Skip to content

gix cli progress cleanup - #3033

Draft
Sebastian Thiel (Byron) wants to merge 9 commits into
mainfrom
gix-cli-progress-cleanup
Draft

Sebastian Thiel (Byron) wants to merge 9 commits into
mainfrom
gix-cli-progress-cleanup

Conversation

@Byron

@Byron Byron commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Tasks

  • refackiew

@Byron
Sebastian Thiel (Byron) force-pushed the gix-cli-progress-cleanup branch 2 times, most recently from e3bcff3 to fcf37b7 Compare October 1, 2026 11:46
Codex (codex) and others added 4 commits October 2, 2026 07:28
<!-- Byron -->

This was a faster review as it's mostly a port. Did do some refactoring
though around adding tests for all features, and not using `thiserror` anymore.
I only looked at the structure and docs, not at the code itself.

<!-- agent -->
Port the synchronous core of `tracing-forest` 0.2.0 into
`gix-trace::forest`, including its MIT attribution. Keep inspectable trees,
processors and fallbacks, tags, and configurable printers without the
procedural macro crate or asynchronous runtime.

Expose `ForestLayer` at the crate root and the main forest types directly
under `forest`, with one public path per type. Keep supporting types in
their submodules and document and use the canonical paths throughout.

Gate collection and ANSI output behind `forest` and `forest-ansi`.
Ordinary tracing remains independent of the forest dependencies. Migrate
CLI and corpus callers and remove both external `tracing-forest` packages.
Keep conversion to the existing stored JSON format in corpus code.
Associate stored trees with the `run_id` recorded on their root spans,
so delayed span closure and unrelated roots cannot overwrite another run.
Remove the redundant atomic current-run state in sequential and parallel
execution, and cover out-of-order closure with a regression test.

Retain the latest recorded span field values, including fields initially
left empty. Measure each span once while any entry is active, so nested or
concurrent entries do not overwrite its start time. Keep the child-duration
sum and total-duration floor for separately timed worker spans.

Add `Pretty::with_max_level` to filter nodes before formatting, promote
visible descendants through hidden spans, and retain the original root's
timing baseline. Render zero-duration percentages as `0.00%`.

Document capturing a parent span and dispatcher before spawning a thread,
creating distinct worker spans, and closing handles inside the installed
dispatch. Cover cross-thread ancestry, delayed root closure, timing, field
updates, filtering, fallback recovery, and corpus JSON compatibility.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
<!-- Byron -->

Quick review only, as it's mostly about tracing and `gix` which both aren't super
important, and are seemingly working well. An extra agent-review couldn't
find anything either.

<!-- agent -->
Replace the old boolean trace switch with a bounded `-t`/`--trace` counter:
forest INFO and DEBUG at one or two occurrences, then flat DEBUG and TRACE at
three or four. Keep `--threads` long-only and route tracing independently of
verbose and progress rendering, including commands with bespoke execution paths
and corpus runs.

Initialize display tracing once before repository discovery, buffer it outside
`prodash`, and emit it after command and progress teardown. Format forest and
flat output with ANSI, then adapt the final stderr write so terminals get color
while pipes and `NO_COLOR` remain plain.

Corpus worker subscribers share that sink while retaining their complete
JSON trace storage, and flat modes include completed spans. `gix tix` remains
delegated to Tix so it installs only one subscriber.

Assisted-by: GPT 6.0 Astra
Co-authored-by: GPT 6.0 Astra <codex@openai.com>
<!-- agent -->
Full-screen progress required separate command and UI threads plus channel
coordination, while line progress already covers long-running commands and works
with independently buffered tracing.

Remove `--progress`, `--progress-keep-open`, and the `prodash-render-tui` feature. Keep synchronous line progress as the only progress UI.

Assisted-by: GPT 6.0 Astra
Co-authored-by: GPT 6.0 Astra <codex@openai.com>
<!-- Byron -->

Made a change on how no-values are displayed.

<!-- agent -->
Elapsed trace durations include time spent waiting. Add the optional
`forest-cpu-time` feature to measure user and kernel CPU work separately
on Linux, macOS, FreeBSD, and OpenBSD, using the optional Unix `libc`
dependency.

Charge each thread's CPU intervals to its current distinct span and roll
child totals into parents. Nested spans, concurrent entries, and futures
moving between threads retain separate accounting without double counting.
Expose own, child, and total CPU durations on completed spans and show
inclusive user/system times in the pretty printer. Failed samples and
unsupported platforms report CPU time as unavailable.

Expose this through the CLI's `tracing-cpu-time` feature and enable it in
`max-control`. Keep `forest::init()` fallible so subscriber installation
errors are returned to callers, as its existing regression test requires.

Assisted-by: GPT 6.0 Astra
Co-authored-by: GPT 6.0 Astra <codex@openai.com>
<!-- Byron -->

Looked at every hunk, and thought the `gix_trace::in_thread()` idea is great
Due to a lack of understanding of how tracing really works, it looks a bit magical,
despite being seemingly simple.

<!-- agent -->
`gix status` emitted separate trace trees for its tree/index comparison,
index/worktree comparison, directory walk, and parallel index work because
new threads did not inherit the caller's tracing context.

Capture the active span and subscriber with `gix_trace::in_thread()` and
restore both around each worker. Apply it to every production thread spawn,
including shared parallel helpers, transports, filters, CLI tools, and Tix.
Without tracing the helper returns the original closure unchanged.

Cover scoped, nested, and detached workers, thread-local subscribers,
parent lifetime, parallel callbacks, and a CLI status regression that fails
with five roots before the fix and passes with a single `run` tree.

Assisted-by: GPT 6.0 Astra
Co-authored-by: GPT 6.0 Astra <codex@openai.com>
<!-- agent -->
Use `gix_error::Result` and its canonical error helpers throughout the CLI,
`gitoxide-core`, Tix, examples, internal tools, and fuzz targets. Preserve
context, concrete causes, and typed recovery while converting native errors
at their actual call sites. Remove the `anyhow` dependency from all downstream
crates.

Returning native results must retain complete diagnostics without an outer
reporting crate. Reuse the existing test-error formatter for the flattened
`Error` representation: Debug reports every cause and its location, while
alternate Display includes the full chain on one line. Cover nested native
I/O payloads so causes appear exactly once in either representation.

Update error snapshots for native tree reports, ignoring source line numbers
in CLI snapshots, and update contributor guidance to the new error API.
Use `gix_error::TestResult` for migrated tests and their helpers so native
errors and exceptions propagate directly with `?`.

Assisted-by: GPT 6.0 Astra
Co-authored-by: GPT 6.0 Astra <codex@openai.com>
The CLI's Rust 1.88 minimum already provides the standard terminal-detection
trait. Use it for both stdin guards and remove the direct `is-terminal`
dependency and its feature references. Retain the lockfile package required
by `prodash`'s terminal autoconfiguration.

Validation: default all-target checks and the `small`, `lean`, `lean-async`,
and `max-pure` presets pass. Seven focused stdin journey cases pass, and both
stdin guards reject a real terminal. Formatting and whitespace checks pass.
An additional `pretty-cli,sha1` probe encounters existing progress-feature
errors in `src/shared.rs`.
Literal tree connectors made ordinary source chains noisy, as in SSH
argument-validation failures. Use a single `Caused by:` section so linear
chains read from context to underlying failure. Retain branches through
indented paths such as `0-0` and `0-0-0`, with each level adding two spaces.

Apply this layout to `Debug`, alternate `Debug`, and alternate `Display`.
Filter classification markers before numbering, preserve diagnostic labels
and location behavior, and emit nested error boundaries once. Keep the
existing flat presentation when only `auto-chain-error` is enabled.

Add regression coverage for SSH chains, branching native sources, hidden
classification markers, and an outer context. Update formatting docs and
workspace/CLI snapshots. Refresh two stale panic source locations exposed
by the journey tests as well.

Validation on macOS:

- 4,528 workspace tests passed in the main run. The remaining two
  identity-sensitive `gix-tix` tests passed with their own fixture setup.
- `gix-error` tests and doctests passed with no default features,
  `auto-chain-error`, and `auto-chain-error,tree-error`.
- Transport tests passed for curl, reqwest, and async configurations.
- `just journey-tests-small`, `just journey-tests-pure`, and
  `just journey-tests` passed, covering `small`, `max-pure`, and `max`.
- The `lean` build check, `cargo fmt --all -- --check`, and
  `cargo clippy -p gix-error --all-targets --all-features` passed.
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