feat(platform): add support for settings-link-v1 schema - #234
feat(platform): add support for settings-link-v1 schema#234nmolham-godaddy wants to merge 15 commits into
Conversation
…ettings presentation
There was a problem hiding this comment.
Pull request overview
Adds settings-link-v1 support alongside existing form presentations, including validation, release serialization, documentation, and smoke tests.
Changes:
- Adds link presentation modeling and
opencapability validation. - Emits link-specific release metadata.
- Updates CLI help, documentation, and test coverage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Summary | Final review comment |
|---|---|---|
rust/src/platform/guides/platform-settings.md |
Documents link presentations. | — |
rust/src/platform/guides/platform-overview.md |
Updates settings terminology. | — |
rust/src/config/settings.rs |
Adds open capability support. |
— |
rust/src/config/settings_form.rs |
Adds link parsing and validation. | moderate (3 votes): Reject non-string type values instead of treating them as absent. |
rust/src/config/mod.rs |
Updates configuration round-trip tests. | — |
rust/src/application/commands/release.rs |
Serializes link presentation payloads. | — |
rust/src/application/commands/add.rs |
Updates settings command help. | nit (2 votes): Retain the existing default capability explanation. |
rust/scripts/smoke-test.sh |
Adds link validation and release checks. | — |
docs/application-settings.md |
Documents link presentations. | — |
Suppressed comments (2)
docs/application-settings.md:151
- The newly documented link variant is still contradicted by the page's introductory description and workflow, which say an application-settings capability contributes a form and instruct users to "Author the form". Update those earlier statements to say form or link so a GPA following this link example is not directed to author sections/fields; the terminal guide has the same stale wording and metadata.
## Link presentation (`settings-link-v1`)
For a GPA that must own its own configuration page or provider authorization flow instead of a native form, `presentation` can instead be a link:
rust/src/platform/guides/platform-settings.md:131
- Although this heading now documents
settings-link-v1, the guide metadata and workflow above still describe only a form (summary: ... form, the form-only introduction, and "Author the form"). Update those statements so the terminal guide accurately presents both supported presentation contracts.
### Link presentation (`settings-link-v1`)
For a GPA that must own its own configuration page or provider authorization flow instead of a native form, `presentation` can instead be a link:
💡 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 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (1)
rust/src/config/settings_form.rs:324
- A non-string
typenow falls throughas_str()and is treated as an omitted form discriminator. For example, a form file with"type": 1is accepted and rewritten as"type": "form", whereas the previousOption<String>deserialization rejected it. Preserve the existing omitted/null fallback, but reject other JSON types before dispatching.
let kind = value
.get("type")
.and_then(|t| t.as_str())
.unwrap_or("form")
.to_owned();
There was a problem hiding this comment.
Do we need to maintain this file or is the guide sufficient?
There was a problem hiding this comment.
I think it is nice to have, specially GPA settings usage is a bit complex at the beginning
jpage-godaddy
left a comment
There was a problem hiding this comment.
Looks good to me; would like an SME on the developer platform to also review.
Summary
Aligns
godaddy-cliwithapp-registry-api'sfeat/settings-link-v1branch, which adds a second settings presentation contract (settings-link-v1, for GPAs that own their own configuration UI/OAuth flow) alongside the existingsettings-form-v1. Prior to this change, the CLI had zero knowledge of the new contract —ALLOWED_CAPABILITIESlacked"open",SettingConfig.presentationwas hard-typed to the form shape only, andpresentation_from_jsonrejected anytypeother than"form".Related to https://github.com/gdcorp-commerce/app-registry-api/pull/182
"open"lifecycle capability.SettingsLinkV1Presentation(label,openMode) and aSettingPresentationenum (Form/Link), reusing the#[serde(untagged)]pattern already proven in this module forSelectValue, so existing[settings.presentation]form blocks keep working unchanged.validatePresentationCapabilitiesrefinement into Rust: a link presentation requires exactly["read","open"];openis rejected on a form presentation. Verified byte-for-byte againstpackages/schemas/src/schemas/application-setting.tson the API branch — same field names, same literal values, same error semantics.gddy platform app releasenow emits the correcttype/schemaVersion("link"/"settings-link-v1") for a link entry.--capabilityhelp text, theadd settingslong help, and both usage docs (rust/src/platform/guides/platform-settings.mdterminal guide and its checked-in twindocs/application-settings.md, which I'd initially missed) with a new link-presentation section and a corrected capability list.rust/scripts/smoke-test.shwith 6 new checks (A23-A26reject bad link capabilities/label/openMode/open-on-form,A27accepts a well-formed link entry locally,C4verifies a link setting round-trips throughreleaseagainst the mocked API with the right shape).