Repository navigation
fix(config): let a repeatable flag be set as a list in the config file - #51
Closed
harrisoncramer wants to merge 1 commit into
Closed
harrisoncramer wants to merge 1 commit into
harrisoncramer wants to merge 1 commit into
Conversation
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.
Owner
Author
|
AI-GENERATED: Closing. |
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.
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.