Skip to content

fix(config): let a repeatable flag be set as a list in the config file - #51

Closed
harrisoncramer wants to merge 1 commit into
mainfrom
config-file-list-parity
Closed

harrisoncramer wants to merge 1 commit into
mainfrom
config-file-list-parity

Conversation

@harrisoncramer

Copy link
Copy Markdown
Owner

The config file is documented to mirror the CLI: every flag should be settable there. When --compose-file became repeatable (#50), that stopped being true. The config-file flattening only understood scalar keys, so a TOML array (compose-file = ["a", "b"]) was stringified to "[a b]" and set as a single garbage value. So the compose-file layering the CLI supports could not be declared in .ultra.toml, and the two had diverged.

This teaches the config layer that a TOML array maps to a list-valued flag: each element sets the flag once, the same as passing it repeatedly on the command line. compose-file, and any future repeatable flag, now round-trips through the config file. The command line still wins as before (a flag already set from argv is not appended to from the file). Scalar keys are unchanged.

Adds unit coverage for the list flatten/apply and the command-line-wins guard, plus an integration test that drives the whole feature from a config file: apps and a layered compose-file list come from .ultra.toml, and the run proves the override wins while the resolved secret still reaches the container.

The config file is meant to mirror every CLI flag, but its flattening
only handled scalars, so a repeatable flag like --compose-file could not
be expressed: a TOML array flattened to a stringified slice and set one
garbage value. A TOML array now maps to a list-valued flag, set once per
element, so compose-file (and any future repeatable flag) fills from the
file exactly as passing it repeatedly on the command line does.
@harrisoncramer

Copy link
Copy Markdown
Owner Author

AI-GENERATED: Closing.

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