fix(conformance): unwrap formae.Value wrappers in CreateUnmanagedResource - #442
Open
naxty wants to merge 3 commits into
Open
fix(conformance): unwrap formae.Value wrappers in CreateUnmanagedResource#442naxty wants to merge 3 commits into
naxty wants to merge 3 commits into
Conversation
…urce
The discovery harness's CreateAllUnmanagedResources forwards the
evaluated PKL JSON to the plugin verbatim. The agent's apply path
runs resolver.ConvertToPluginFormat on properties first, which both
resolves resolvable references *and* collapses formae.Value wrappers
({"\$value": ..., "\$strategy": ..., "\$visibility": ...}) down to
their scalar payload. The harness only does the resolvable half, so
any field declared in PKL as
field = new formae.Value { value = "x"; strategy = "SetOnce" }
reaches the plugin as the wrapper object and the cloud API rejects it
when the field is typed against the inner scalar (real example, OVH:
[version] Given data is not valid for type cloud.kube.VersionEnum
(code: InvalidRequest)
— sent during kube-cluster discovery once 1.33 was relaxed in the PKL
to (String|formae.Value)? to support SetOnce).
Adds flattenFormaeValuesInProperties / flattenFormaeValueWalk that
recursively replace any object carrying "\$value" with that key's
payload, while leaving "\$res": true resolvable markers intact (those
are owned by resolveResolvablesInProperties). Wired into
CreateAllUnmanagedResources right after the resolvable pass so plugins
authored against the apply-path contract no longer have to re-implement
this in every Create.
naxty
added a commit
to platform-engineering-labs/formae-plugin-ovh
that referenced
this pull request
Apr 28, 2026
Sidesteps the conformance harness's missing Value-flatten step (fix is in flight at platform-engineering-labs/formae#442). Plain "1.34" is how the schema's (String|formae.Value)? union is consumed by every other test that does not need SetOnce semantics, and OVH's GET still echoes the full patch ("1.34.6-1") so Verify is unaffected.
# Conflicts: # pkg/plugin-conformance-tests/harness.go
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 discovery conformance harness creates resources directly through the plugin. A property authored as
formae.Valuepreviously reached that create request as an envelope instead of its payload, causing scalar provider fields to reject otherwise valid input.Unwrap Value envelopes recursively after resolving resource references and before normalizing empty collections. Reject stored secret hashes before those transformations so a digest cannot be written as a live secret. Keep numeric precision in the added conversion step. The standalone conformance SDK implements this locally without importing the agent’s internal resolver.
Regression coverage captures the actual unmanaged-create coordinator request, verifies nested values and a dependent resource reference, and proves stored hashes never reach the request boundary. The request regression fails against current main and passes with this change; hash rejection and numeric conversion regressions failed before their fixes. The full conformance package passes with Go 1.26.2.
Refreshed against main while preserving its reference resolution, secret redaction, retry, and cleanup behavior. Fable source review found no blocking in-scope defect; the full conformance package also passes with the race detector. All final-head CI checks pass, including the property suite, main build/test job, and every E2E test plus cleanup. A live OVH conformance run has not been performed.