refactor: declare the toggle task fields once - #469
Merged
josegonzalez merged 1 commit intoAug 13, 2026
Merged
Conversation
The three toggle tasks and `dokku_maintenance` each restated the same `app` and `state` field set, so every cross-cutting change had to be applied four times by hand. They now name a defined type over the shared `ToggleFields`. A defined type rather than an embedded struct keeps the field set flat to reflection, so the catalog, the required-field walk behind `missing_required_field`, the identity walk that names an unnamed task and the sensitive-value walks read the fields exactly as before. The parameter descriptions become plugin-agnostic as a result, which is what regenerates the task pages; each page's title and synopsis already name the plugin. `TestToggleTasksDeclareTheSharedFields` decides which tasks are toggles by whether their `Plan()` reaches `planToggle` rather than by their name, which is what keeps `dokku_maintenance` bound to the shared set despite not being spelled like one. The contributor docs described a `planToggle` signature removed in #322 and two envelope examples used a `state:` value no task accepts; both are corrected here. Fixes #467.
josegonzalez
deleted the
467-extract-a-shared-togglefields-type-across-the-toggle-tasks
branch
August 13, 2026 16:20
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 three toggle tasks and
dokku_maintenanceeach restated the sameappandstatefield set, so every cross-cutting change had to be applied four times by hand. They now name a defined type over the sharedToggleFields. A defined type rather than an embedded struct keeps the field set flat to reflection, so the catalog, the required-field walk behindmissing_required_field, the identity walk that names an unnamed task and the sensitive-value walks read the fields exactly as before. The parameter descriptions become plugin-agnostic as a result, which is what regenerates the task pages; each page's title and synopsis already name the plugin.TestToggleTasksDeclareTheSharedFieldsdecides which tasks are toggles by whether theirPlan()reachesplanTogglerather than by their name, which is what keepsdokku_maintenancebound to the shared set despite not being spelled like one. The contributor docs described aplanTogglesignature removed in #322 and two envelope examples used astate:value no task accepts; both are corrected here. Fixes #467.