Skip to content

Honour --config-dir when loading/saving defaults.#2510

Merged
fnando merged 4 commits intomainfrom
config-dir-vs-global-dir
Apr 22, 2026
Merged

Honour --config-dir when loading/saving defaults.#2510
fnando merged 4 commits intomainfrom
config-dir-vs-global-dir

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented Apr 21, 2026

What

Honour --config-dir when loading/saving defaults.

Why

Known limitations

N/A

Copilot AI review requested due to automatic review settings April 21, 2026 23:11
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Apr 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures the CLI honors --config-dir when reading and writing config.toml defaults (network/identity/inclusion fee), aligning startup behavior and “use” commands with the selected config profile.

Changes:

  • Add path-aware Config::load / Config::save_to helpers and route new()/save() through them.
  • Update default write/unset helpers to read/write config.toml under the active config dir.
  • Update startup env-default loading to prefer --config-dir (parsed from raw args) and add integration tests covering both startup reads and default writes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cmd/soroban-cli/src/config/mod.rs Introduces path-based load/save helpers to support non-global config locations.
cmd/soroban-cli/src/config/locator.rs Writes/unsets defaults using a config.toml path derived from the active config dir.
cmd/soroban-cli/src/cli.rs Startup defaults loading now honors --config-dir by scanning raw CLI args before clap parsing.
cmd/crates/soroban-test/tests/it/config.rs Adds integration tests ensuring --config-dir affects startup defaults and where defaults are written.

Comment thread cmd/soroban-cli/src/cli.rs
@fnando fnando enabled auto-merge (squash) April 22, 2026 00:03
@fnando fnando merged commit 843c192 into main Apr 22, 2026
213 checks passed
@fnando fnando deleted the config-dir-vs-global-dir branch April 22, 2026 00:28
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants