Add a global config at ~/.config/forge.toml - #23
Merged
Conversation
Every layer that could set the task board's CQL host was tied to WHERE
forge is run from: an explicit argument, an environment variable, or a
.forge/config.toml found by walking up from the working directory. There
was no way to configure a machine.
That is a real gap for an installer. The Ferrosa workbench provisions a
database on a non-default port, and could only reach forge by asking the
user to export a variable or by dropping a file into every repo they
own. Anything else met
Error: connect to CQL ... Connection refused
against a database that was running the whole time.
The new layer sits between the project file and the built-in default, so
a repo still pins its own board and a machine-wide setting only applies
where nothing more specific does. debug_stop gets the same treatment,
since it shares the file and schema -- honouring the global config for
one key and ignoring it for the other would be the more surprising
design.
The path matches the rest of the system rather than inventing a
location: forge already reads ~/.config/ferrosa-memory.toml for its
memory client, so its own settings sit beside it, with the same schema
as the project file.
Verified with the release binary against a live database, from a
directory with no project config:
before: Error: connect to CQL
after: []
and precedence confirmed both ways -- a project config pointing at a
dead port still wins over a working global one, and the environment
variable still wins over that.
CI's Format & Lint gate caught four sites in the new code. Committed separately from the change itself so the review diff stays about the config layer.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every layer that could set the task board's CQL host was tied to where forge is run from: an explicit argument,
FORGE_CQL_HOST, or a.forge/config.tomlfound by walking up from the working directory. There was no way to configure a machine.That is a real gap for an installer. The Ferrosa workbench provisions a database on a non-default port and could only reach forge by asking the user to export a variable, or by dropping a file into every repo they own. Anything else met
against a database that was running the whole time.
The layer
~/.config/forge.toml, between the project file and the built-in default:--cql-host/cql_hostargumentFORGE_CQL_HOST.forge/config.toml, walking up from the cwd~/.config/forge.toml127.0.0.1:9042A project config still wins, so a repo pins its own board and a machine-wide setting only applies where nothing more specific does.
debug_stopgets the same treatment. It shares the file and the schema, and honouring the global config for one key while ignoring it for the other would be the more surprising design.Why that path
It matches the rest of the system rather than inventing a location — forge already reads
~/.config/ferrosa-memory.tomlfor its memory client, so its own settings sit beside it, with the same schema as the project file:One shape, two locations. A separate schema for the global file would mean two formats to document and keep in step.
Verification
Unit coverage for the precedence rule at every layer, blank-value fall-through, the resolved path landing at
~/.config/forge.toml, and both keys parsing from one body.Beyond that, checked with the release binary against a live database from a directory with no project config and no exported variable:
Precedence confirmed in both directions — a project config pointing at a dead port still beats a working global one, and
FORGE_CQL_HOSTstill beats that.Full workspace suite green (1304), build clean.
Note for review
dirsis added toforge-tasks, workspace-pinned like every other crate that uses it. TheCargo.lockchange is the single corresponding line.