feat(app): add settings support for app registration - #216
feat(app): add settings support for app registration#216nmolham-godaddy wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for application “settings” registrations in the CLI by extending godaddy.toml ([[settings]] placement + typed settings-form-v1 presentation), wiring settings into gddy platform app add settings and the release payload, and documenting the workflow.
Changes:
- Introduces new config models + structural validation for
[[settings]]placement metadata andsettings-form-v1presentation. - Adds
gddy platform app add settingsand includessettingsingddy platform app releasepayload mapping (with presentation required at release-time). - Adds a build/verify helper script and end-user documentation for authoring settings.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rust/src/config/settings.rs | Defines SettingConfig/SettingIcon and validates placement metadata (slug, entryPath, capabilities, icon library, overlap). |
| rust/src/config/settings_form.rs | Defines typed settings-form-v1 presentation model plus structural validation (keys/options/uniqueness). |
| rust/src/config/mod.rs | Wires settings: Vec<SettingConfig> into Config + Config::validate(), and updates tests/config literals. |
| rust/src/application/commands/release.rs | Maps config settings into the createRelease.settings payload and enforces presentation required at release-time. |
| rust/src/application/commands/add.rs | Adds gddy platform app add settings to write placement metadata into godaddy.toml. |
| rust/src/application/commands/schemas.rs | Adds ConfigSetting output schema for the new add settings command. |
| rust/src/application/commands/init.rs | Ensures generated config includes settings: vec![]. |
| rust/scripts/build-and-verify.sh | Adds a helper script to run local verification + a debug build smoke run. |
| docs/application-settings.md | Documents the settings workflow and the settings-form-v1 TOML authoring shape. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
rust/src/config/settings_form.rs:265
- Nested list-group fields are only validated individually, so sibling fields may reuse the same key or reuse the reserved
idField. Both cases produce ambiguous object properties and contradict the documented guarantees that field keys are unique andidFieldcannot be editable. Track keys within each item and reject both collisions.
for (k, inner) in item.fields.iter().enumerate() {
validate_field(inner, errors, &format!("{path}.item.fields[{k}]"));
}
rust/scripts/build-and-verify.sh:20
- This verification script omits the repository's required
cargo testcheck, so it can report success despite test failures. Add the test suite to the verification sequence.
step "cargo clippy -- -D warnings"
cargo clippy -- -D warnings
rust/src/application/client.rs:191
- The release response now includes
settings, butApplicationReleasestill omits that field. Consequentlyrelease --helpandrelease --schemado not advertise the newly emitted JSON member, contrary to the synchronization requirement inrust/src/output_schema.rs:15-17. Addsettingsas an optional[]objectfield to the release output schema.
"query": "mutation CreateRelease($input: MutationCreateReleaseInput!) { createRelease(input: $input) { id version description createdAt uiExtensions { id name handle type source target } settings { id groupSlug appSettingSlug entryPath capabilities order title } } }",
|
@nmolham-godaddy thanks for driving this end-to-end — I validated the implementation against the live App Registry settings schema, the #131 registration plan, and DEVEX-1021. I found two blockers before this can merge:
Follow-up: the docs say local validation enforces key uniqueness, but nested The core settings mapping and targeted GraphQL test otherwise align with App Registry. |
|
The API mapping here looks right, but we should support both presentation authoring modes before merging: inline TOML and a referenced JSON file. Suggested manifest shape: [[settings]]
group = "tax-center"
slug = "manual-tax"
entryPath = "/settings/manual-tax"
presentationFile = "fixtures/manual-tax-registry-presentation.json"The referenced JSON should contain the complete API presentation object ( Expected behavior:
This is especially useful for the existing GPA examples, which already keep substantial registry presentations in JSON fixtures; requiring inline-only TOML would create a second source of truth. |
There was a problem hiding this comment.
It'd be better if this was embedded in a guide so that LLMs can discover these instructions without needing to do a web search. I think the whole gddy platform module probably needs a holistic guide with application settings included (or I guess multiple guides is also fine).
| label = "Canada" | ||
| value = "CA" | ||
| ``` | ||
| - Optional: `defaultValue` must match one option's `value`. |
There was a problem hiding this comment.
Looks like the Markdown parser hit a snag starting on this line. You probably need to fix indentation or some other kind of white space.
| "Register the placement metadata for an application-settings \ | ||
| capability in the godaddy.toml manifest in the current directory. \ | ||
| This command only writes group/slug/entryPath/order/capabilities/icon \ | ||
| — it cannot author the settings-form-v1 form itself. After running \ |
There was a problem hiding this comment.
Is the meaning of "settings-form-v1" something that's clear to users?
| error = %e, | ||
| path = %config_path.display(), | ||
| "failed to read config; releasing with empty actions, subscriptions, and uiExtensions" | ||
| "failed to read config; releasing with empty actions, subscriptions, uiExtensions, and settings" |
There was a problem hiding this comment.
I know this isn't new behavior, but if someone doesn't notice this warning, it could cause a lot of frustration, if they're releasing but it doesn't reflect their config. As a user, I'd prefer the release failed instead.
(non-blocking)
Summary
[[settings]]support togodaddy.tomland wire it throughgddy platform app add settings/gddy platform app release— closes the gap whereapp-registry-api'screateRelease.settingscapability had no CLI support at all (config, add command, and release payload all silently dropped it).gddy platform app add settingscommand writes placement metadata only (group/slug/entryPath/order/capabilities/icon) — matches the flag shape ofadd action/add subscription/add extension.settings-form-v1presentation model (text/textarea/number/boolean/select/multi-select/list-group, recursive nesting) authored inline ingodaddy.toml— no JSON file, no opaque passthrough.presentationis hand-added afteradd settings;releaserejects a settings entry with nopresentationinstead ofConfig::validate(), so a placement-only entry still works fine for every other command.options) — bounds/default-consistency/nesting-depth stay server-validated, consistent with how the rest ofConfig::validate()already treats every other section.rust/scripts/build-and-verify.sh— check/clippy/fmt/module-size, then build and rungddy(args forwarded, defaults to--help).docs/application-settings.md— end-user guide: workflow, full field-type reference, worked nestedlist-groupexample, gotchas (no release inheritance, no auto-backfill to already-enabled stores).Changes
rust/src/config/settings_form.rs(new) —SettingsFormV1Presentation/Section/Fieldenum/ListGroupItem/ChoiceOption/SelectValue, structural validation.rust/src/config/settings.rs(new) —SettingConfig/SettingIcon, slug/entryPath/capability/icon-library validation, entry-path-overlap check.rust/src/config/mod.rs—settings: Vec<SettingConfig>field, wired intoConfig::validate().rust/src/application/commands/release.rs—setting_entry/build_settingsmap config toApplicationSettingCreateInput, enforcepresentationrequired here (not inConfig::validate()).rust/src/application/commands/add.rs—add settingscommand.rust/src/application/commands/schemas.rs—ConfigSettingoutput schema.rust/src/application/commands/init.rs— add missingsettings: vec![]to aConfigliteral.rust/scripts/build-and-verify.sh(new).docs/application-settings.md(new).QA
cargo checkcargo clippy -- -D warningscargo test(19 new tests: config validation,settings_formstructural checks + TOML round-trip,release::setting_entrymapping incl. missing-presentation error path)cargo fmt --check./rust/scripts/check-module-size.shadd settingsagainst a scratchgodaddy.toml, hand-added[settings.presentation](incl. nestedlist-groupwith multipleoptions), confirmed round-trip throughread_config/validate/write_configpreservesdefaultValueand every nested field; confirmed--icon-name/--icon-librarypairing and entry-path-overlap rejections fire before any write.