The integration guide's configuration section omits ConfigKey's Type, Enum and Positive fields #268

Open
opened 2026-10-24 06:52:47 +00:00 by cgalo5758 · 0 comments
Owner

Where

docs/building-an-integration.md, section "6. Configuration"

What it says

The section's listing of ConfigKey has Name, Default, Usage, Secret, RequiredGroup, DeploymentOnly and NeedsTemporal, with a bullet for each. The Default bullet says its dynamic type, string or []string, selects the flag constructor. The "Boolean keys" paragraph says the flag constructors cover only string and []string, with no bool arm, so a boolean setting takes a string default, and names discourse-auto-create-users as the worked example.

What it should say, or what is missing

The listing and the bullets should match ConfigKey in internal/config/spec.go, which also has:

  • Type: the key's declared value type (config.TypeString, TypeURL, TypeDuration, TypeInt, TypeBool, TypeList or TypeEnum). Left unset, TypeOf infers string, bool, int, list or duration from Default, and enum from a non-empty Enum. A URL needs it declared (fedwiki-farm-api-url declares config.TypeURL), and so does a string key with no default that is not free text. config.CheckSpecs refuses a Type that disagrees with Default's Go type.
  • Enum: closes the key's set of values. The settings page renders the key as a select and refuses any other value, the boot overlay checks stored overrides again, and config.ValidateStart checks the deployment's value (fedwiki-site-scheme, discourse-linkage-mode).
  • Positive: marks an int or duration key whose zero means "unset, use the default"; a zero value is refused with a sentence that names the key (fedwiki-sync-interval, discourse-sync-interval). config.CheckSpecs refuses it on a key of any other type.

The Default bullet and the "Boolean keys" paragraph should describe the flag registration as it is: registerIntegrationConfigFlags (cmd/start.go) picks the flag constructor from the key's type, with bool, duration, int and list arms besides string, so a boolean key takes a bool default (discourse-sync-trigger-immediately). discourse-auto-create-users is now an Enum of "false" and "true", no longer the worked example of a boolean.

### Where `docs/building-an-integration.md`, section "6. Configuration" ### What it says The section's listing of `ConfigKey` has `Name`, `Default`, `Usage`, `Secret`, `RequiredGroup`, `DeploymentOnly` and `NeedsTemporal`, with a bullet for each. The `Default` bullet says its dynamic type, `string` or `[]string`, selects the flag constructor. The "Boolean keys" paragraph says the flag constructors cover only `string` and `[]string`, with no `bool` arm, so a boolean setting takes a string default, and names `discourse-auto-create-users` as the worked example. ### What it should say, or what is missing The listing and the bullets should match `ConfigKey` in `internal/config/spec.go`, which also has: - `Type`: the key's declared value type (`config.TypeString`, `TypeURL`, `TypeDuration`, `TypeInt`, `TypeBool`, `TypeList` or `TypeEnum`). Left unset, `TypeOf` infers string, bool, int, list or duration from `Default`, and enum from a non-empty `Enum`. A URL needs it declared (`fedwiki-farm-api-url` declares `config.TypeURL`), and so does a string key with no default that is not free text. `config.CheckSpecs` refuses a `Type` that disagrees with `Default`'s Go type. - `Enum`: closes the key's set of values. The settings page renders the key as a select and refuses any other value, the boot overlay checks stored overrides again, and `config.ValidateStart` checks the deployment's value (`fedwiki-site-scheme`, `discourse-linkage-mode`). - `Positive`: marks an int or duration key whose zero means "unset, use the default"; a zero value is refused with a sentence that names the key (`fedwiki-sync-interval`, `discourse-sync-interval`). `config.CheckSpecs` refuses it on a key of any other type. The `Default` bullet and the "Boolean keys" paragraph should describe the flag registration as it is: `registerIntegrationConfigFlags` (`cmd/start.go`) picks the flag constructor from the key's type, with bool, duration, int and list arms besides string, so a boolean key takes a `bool` default (`discourse-sync-trigger-immediately`). `discourse-auto-create-users` is now an `Enum` of `"false"` and `"true"`, no longer the worked example of a boolean.
cgalo5758 added the
kind
docs
good-first-issue
labels 2026-10-24 06:52:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#268