Skip to content

[v17] MWI: Fix certain --no- flags failing to override config file#54651

Merged
timothyb89 merged 4 commits intobranch/v17from
bot/backport-54402-branch/v17
May 9, 2025
Merged

[v17] MWI: Fix certain --no- flags failing to override config file#54651
timothyb89 merged 4 commits intobranch/v17from
bot/backport-54402-branch/v17

Conversation

@timothyb89
Copy link
Copy Markdown
Contributor

Backport #54402 to branch/v17

changelog: Machine ID: Allow --no-oneshot and similar flags to override config file values

timothyb89 added 3 commits May 9, 2025 02:55
This fixes a few instances where `--no-` flags were unable to
override config file parameters as we didn't check if the flag was
actually set by the user. This now uses the value parsed by kingpin
directly if an associated `*SetByUser` flag is also set, making it
possible to use, e.g., `--no-oneshot` to disable oneshot mode if
also loading a `tbot.yaml` with the flag enabled.

Most `BoolVar()` uses in tbot don't apply - only those that can
plausibly be overridden by a config file. That means only `start`
type commands, and then only flags which produce configs that can
actually be overridden, which excludes most generated service
definitions.
Adds a new test for inverted global flags, and fixes a broken test.
@timothyb89 timothyb89 enabled auto-merge May 9, 2025 18:03
@timothyb89 timothyb89 added this pull request to the merge queue May 9, 2025
Merged via the queue into branch/v17 with commit 4dee1a0 May 9, 2025
38 checks passed
@timothyb89 timothyb89 deleted the bot/backport-54402-branch/v17 branch May 9, 2025 18:42
@doggydogworld doggydogworld mentioned this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants