Skip to content

fix: hook up repodata fetch reporter to gateway queries#6112

Open
baszalmstra wants to merge 5 commits into
prefix-dev:mainfrom
baszalmstra:claude/fix-repodata-reporter-KevOZ
Open

fix: hook up repodata fetch reporter to gateway queries#6112
baszalmstra wants to merge 5 commits into
prefix-dev:mainfrom
baszalmstra:claude/fix-repodata-reporter-KevOZ

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Description

The "fetching repodata" progress bar owned by TopLevelProgress was never receiving events because no reporter was attached to the Gateway queries in SolveCondaKey::compute or ephemeral_env::fetch_binary_repodata.

This PR introduces a standalone GatewayReporter trait registered on the dispatcher's DataStore. Every gateway-query site looks it up and passes OperationId::current() (the surrounding pixi-solve or instantiate-backend op, which is already started via scope_active) into create_gateway_reporter. TopLevelProgress implements the trait and returns its existing RepodataReporter, so the bar finally drives.

The integration EventReporter also implements the trait and records a GatewayQuery event so the event tree shows where each fetch lands.

How Has This Been Tested?

  • cargo check --workspace --all-targets
  • cargo test -p pixi_command_dispatcher --test integration --features slow_integration_tests locally; the integration__simple_test.snap snapshot was refreshed to include the new "Repodata fetch" nodes.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude Code

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

claude and others added 4 commits May 13, 2026 15:44
Adds `CondaSolveReporter::create_gateway_reporter` so reporters can
hand out a per-call `rattler_repodata_gateway::Reporter`, and wires
the gateway queries in `SolveCondaKey` and the ephemeral-env binary
repodata fetch through it. `TopLevelProgress` now returns its
existing `RepodataReporter` from this hook, so the previously
unused "fetching repodata" progress bar actually receives events.
Replaces the bolt-on `CondaSolveReporter::create_gateway_reporter`
with a standalone `GatewayReporter` trait. It is registered
independently on the `CommandDispatcher`'s `DataStore` and looked up
by every gateway-query site (`SolveCondaKey::compute` and
`fetch_binary_repodata`).

`create_gateway_reporter` now receives the `OperationId` of the
already-started parent operation (pixi-solve or
backend-instantiate, depending on caller), obtained via
`OperationId::current()` — both call sites already run inside the
parent's `scope_active`. This lets reporter implementations
attribute the repodata fetch to the right operation while keeping
gateway-querying code reporter-agnostic.

`TopLevelProgress` implements the new trait and registers itself
via `with_gateway_reporter` in `register_with`.
Adds a `GatewayQuery { id, op_id }` event recorded each time a
gateway-query site asks `EventReporter::create_gateway_reporter`,
where `op_id` is the started parent op the fetch belongs to and
`id` is a fresh op id whose parent in the registry is `op_id`. The
event-tree renderer adds a "Repodata fetch" node so the snapshot
shows where every fetch lands relative to the surrounding pixi
solve / backend-instantiate operations.

The existing snapshot (e.g. `integration__simple_test.snap`)
captures the pre-wiring tree and will need refreshing via
`cargo insta review` once the slow integration tests are run in an
environment that can host the git fixtures.
@baszalmstra baszalmstra force-pushed the claude/fix-repodata-reporter-KevOZ branch from 47805ab to cc4e90b Compare May 13, 2026 13:49
@baszalmstra baszalmstra marked this pull request as ready for review May 13, 2026 14:05
@baszalmstra baszalmstra requested review from ruben-arts May 13, 2026 14:05
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