Skip to content

fix(config): support all configuration keys and subkeys in pixi config list - #7053

Open
aoright wants to merge 1 commit into
prefix-dev:mainfrom
aoright:fix-config-list-keys
Open

aoright wants to merge 1 commit into
prefix-dev:mainfrom
aoright:fix-config-list-keys

Conversation

@aoright

@aoright aoright commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes an inconsistency where running pixi config list [KEY] failed for valid configuration keys and dotted subkeys (as noted in #6825).

Previously, partial_config() in crates/pixi_cli/src/config.rs hardcoded a fixed list of 12 keys, returning key must be one of: ... for valid configuration keys such as tls-root-certs, concurrency, detached-environments, pinning-strategy, run-post-link-scripts, s3-options, tool-platform, cache, experimental, and build. Furthermore, dotted subkeys across sections (e.g. cache.conda-packages, concurrency.solves, shell.change-ps1, proxy-config.http, repodata-config.disable-bzip2) were unsupported.

Key changes:

  • Supported all top-level configuration keys in partial_config: tls-root-certs, concurrency, detached-environments, pinning-strategy, run-post-link-scripts, s3-options, tool-platform, cache, experimental, build.
  • Supported nested dotted subkeys for shell.*, cache.*, proxy-config.*, pypi-config.*, repodata-config.*, index-config.*, experimental.*, concurrency.*, and s3-options.*.
  • Added output subkey pruning in prune_subkeys to isolate requested subfields for non-Option sections like concurrency (solves vs downloads) and s3-options.<bucket> in both TOML and JSON output.
  • Replaced the hardcoded static error list in partial_config with config.get_keys() so error diagnostics are dynamically synchronized with Config.
  • Added "build" to Config::get_keys() and deserialization in Config::set().
  • Exposed pub source_completion_scripts: Option<bool> on ShellConfig.
  • Added comprehensive unit tests in crates/pixi_cli/src/config.rs and crates/pixi_config/src/lib.rs verifying all supported keys and subkeys.

Relates to #6825

How Has This Been Tested?

  1. Unit tests in crates/pixi_cli/src/config.rs:
    • test_partial_config_tls_root_certs: verifies tls-root-certs is preserved.
    • test_partial_config_concurrency: verifies concurrency is preserved.
    • test_partial_config_concurrency_solves: verifies concurrency.solves is isolated in TOML/JSON.
    • test_partial_config_concurrency_downloads: verifies concurrency.downloads is isolated in TOML/JSON.
    • test_partial_config_cache_subkeys: verifies cache.conda-packages.
    • test_partial_config_shell_subkeys: verifies shell.change-ps1.
    • test_partial_config_proxy_subkeys: verifies proxy-config.http.
    • test_partial_config_pypi_subkeys: verifies pypi-config.index-url.
    • test_partial_config_repodata_subkeys: verifies repodata-config.disable-bzip2.
    • test_partial_config_index_subkeys: verifies index-config.base-url.
    • test_partial_config_experimental_subkeys: verifies experimental.conda-script.
    • test_partial_config_s3_options: verifies s3-options, s3-options.<bucket>, and subkey pruning.
    • test_partial_config_invalid_key_error: verifies dynamic diagnostic message with all valid keys.
    • test_partial_config_all_supported_keys: exhaustively checks that every key in config.get_keys() is accepted by partial_config().
  2. Unit tests in crates/pixi_config/src/lib.rs:
    • test_alter_config: verifies build key deserialization in Config::set().
  3. Executed test suite:
    • cargo test -p pixi_config (64 passed, 0 failed)
    • cargo test -p pixi_cli (203 passed, 0 failed)
    • cargo clippy -p pixi_config -p pixi_cli --all-targets (passed, zero warnings)
    • cargo fmt --check (passed)

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

Support all configuration keys and subkeys in `pixi config list [KEY]` and synchronize with `Config::get_keys()`.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

…g list

Support all configuration keys and subkeys in `pixi config list [KEY]`.
Previously, `partial_config()` in `crates/pixi_cli/src/config.rs` hardcoded a subset
of 12 keys and returned an error for valid configuration keys like `tls-root-certs`,
`concurrency`, `detached-environments`, `pinning-strategy`, `run-post-link-scripts`,
`s3-options`, `tool-platform`, `cache`, `experimental`, and `build`. Furthermore,
dotted subkeys were unsupported.

This change:
- Supports all top-level keys and dotted subkeys in `partial_config`.
- Trims/prunes subkey outputs for `concurrency.*` and `s3-options.*` in TOML/JSON.
- Uses `config.get_keys()` dynamically for error diagnostics when an invalid key is provided.
- Adds `build` to `Config::get_keys()` and deserialization in `Config::set()`.
- Adds comprehensive unit tests covering all configuration keys and subkey pruning.

Relates to prefix-dev#6825

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
@aoright
aoright force-pushed the fix-config-list-keys branch from 8602b6f to a5309e6 Compare September 18, 2026 12:44
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.

1 participant