Skip to content

fix(forge_config): make global config file optional#2699

Merged
tusharmath merged 1 commit intomainfrom
make-file-optional
Mar 26, 2026
Merged

fix(forge_config): make global config file optional#2699
tusharmath merged 1 commit intomainfrom
make-file-optional

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Mar 26, 2026

Summary

Fix a missed case from the config refactor where the global TOML config file was required to be present, causing failures when it doesn't exist.

Context

PR #2685 introduced the forge_config crate as part of a config refactor. During that refactor, the read_global method was added to ConfigReader, but the config file source was registered as required — meaning Forge would fail to start if the global config file (forge.toml) was absent. Since the global config file is optional by design, this was an oversight.

Changes

  • Mark the global config file source as required(false) so Forge starts normally even when the file does not exist

Testing

# Ensure no global config file is present and start Forge
rm -f ~/.config/forge/forge.toml  # or wherever the global config lives
cargo run -- --help

# Run crate tests
cargo insta test --accept -p forge_config

Links

@tusharmath tusharmath enabled auto-merge (squash) March 26, 2026 05:40
@tusharmath tusharmath merged commit f1c938a into main Mar 26, 2026
17 of 18 checks passed
@tusharmath tusharmath deleted the make-file-optional branch March 26, 2026 06:17
@amitksingh1490 amitksingh1490 added the type: fix Iterations on existing features or infrastructure. label Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants