210 base resource manifest - #15
Closed
nithyatsu wants to merge 13 commits into
Closed
Conversation
Integrate three clarification answers into spec.md: - codeReference v1 shape: optional string treated as a URI (richer structured shapes are a future additive change). - Base manifest evolution: frozen forever at the four named common properties; promoting more is a separate feature. - Backward-compat scope: prototype is scoped to new authoring experiences. No per-type validator versioning, snapshotting, or migration tooling. Existing types' deployment behavior is preserved entirely by FR-004 acting on their existing env declarations. Spec changes: new Clarifications section; new FR-013 forbidding per-type validator versioning; FR-006 extended to deployment-time backward compat; FR-012 commits to frozen-base; Assumptions and Out of Scope updated; OQ-001 pin-version rationale dropped. OQ-001 (Approach A vs B) intentionally remains open.
Radius is in incubation and does not guarantee backward compatibility. Narrow the prototype accordingly so US1 (new authoring experience) is the only first-class story, and ship documentation in place of preservation. - US2 (per-type override workflow) deferred to a follow-on. Mechanism still works via FR-004 but no polished workflow, no command-time conflict diagnostics, no override-shape validation in the prototype. FR-003 marked Deferred; FR-007 softened from MUST to SHOULD on the error-quality half (correctness guard retained). - US3 (existing types keep working unchanged) dropped. Backward compatibility for existing in-repo and out-of-tree resource types is no longer a requirement. FR-006 rewritten to permit the breaking change and require documentation in its place. FR-013 simplified accordingly. SC-003 replaced with a documented-breaking-change SC. - New 'Breaking Changes & Documentation Impact' section captures what changed, who is affected, what action authors take, what is NOT promised, and where it is documented. - Edge cases pruned to remove now-irrelevant override and out-of-tree backward-compat entries. - Assumptions trimmed to a single clear incubation/breaking- change-allowed bullet. - OQ-001's 'Existing manifests keep working' claim corrected for the new stance. OQ-001 (Approach A vs B) intentionally remains open.
- plan.md: implementation plan scoped to Approach A only
- research.md: 9 decisions; Approach B preserved as future POC
- data-model.md: entities, composition rule, validation rules
- contracts/base-manifest.schema.yaml: shape of the embedded base.yaml
- contracts/inheritance-keyword.md: grammar + placement + resolution + errors
- quickstart.md: build / register / deploy / demo walkthrough
- spec.md: OQ-001 closed; FR-011 updated to reference allOf composition
- AGENTS.md: SPECKIT pointer updated
Inheritance keyword uses standard JSON-Schema composition:
allOf:
- $ref: "radius:base"
URI is a valid RFC 3986 custom-scheme URI (not a URL); resolved
lexically by pkg/schema/baseresource/loader.go.
Signed-off-by: Nithya Subramanian <[email protected]>
Introduces the canonical Radius base resource manifest and the resolver
that merges it into per-type schemas when they opt in via:
allOf:
- $ref: "radius:base"
The four base properties (application, environment, connections,
codeReference) are frozen per FR-012 of specs/210-base-resource-manifest.
Apply() runs before the OpenAPI validator and strips the radius: $ref
entry so the downstream validator never sees a custom URI it cannot
resolve. Per-type-wins precedence is enforced via a simple existence
check on the schema's Properties map.
Signed-off-by: Nithya Subramanian <[email protected]>
Resource type schemas no longer have to declare the environment property.
The base resource manifest now provides environment (and the other three
common properties) as opt-in via allOf: [{$ref: "radius:base"}]. A
per-type schema that wants environment to be required must list it in
its own required: array.
Updates three existing test cases that asserted the now-removed behavior
and adjusts the recipe/multi-violation tests that previously counted
environment as an automatic violation.
Signed-off-by: Nithya Subramanian <[email protected]>
validateManifestSchemas now resolves the radius:base opt-in between
ConvertToOpenAPISchema and ValidateSchema so that 'rad resource-type
create' accepts schemas that compose the base manifest. Apply errors are
wrapped in a SchemaError carrying the per-type schemaPath so the user
sees which resource type and API version produced the failure.
Adds three new test cases:
* a schema that opts into the base validates successfully
* a schema that overrides a base property keeps its per-type version
* a schema with an unsupported radius: URI fails with an error that
names the resource type/API version
Signed-off-by: Nithya Subramanian <[email protected]>
Adds AllOf and Ref fields to bicep-tools' manifest.Schema and a parallel applyBaseResource() that mirrors the schema package's resolver. Called from addResourceTypeForAPIVersion() before addSchemaType() so that generated Bicep extension types include all four base properties when a resource type opts into radius:base. A synchronization test (TestApplyBaseResource_PropertiesMatchCanonicalYAML) reads the canonical pkg/schema/baseresource/base.yaml and asserts that the hardcoded list in bicep-tools agrees with it exactly. This keeps the parallel implementations from drifting. Signed-off-by: Nithya Subramanian <[email protected]>
* pkg/resourceutil: append "codeReference" to BasicProperties so the dynamic resource processor and container renderer skip it correctly when iterating type-specific properties. * pkg/dynamicrp/datamodel: add CodeReference() to dynamicResourceBasicPropertiesAdapter mirroring ApplicationID() and EnvironmentID(). The method is intentionally NOT added to the v1.BasicResourcePropertiesAdapter interface — only dynamic resources carry codeReference today, so callers that need it type-assert. This closes the runtime side of FR-009: codeReference behaves like any other base property at runtime. Signed-off-by: Nithya Subramanian <[email protected]>
Covers the three sections required by research.md Decision 9: what changed (environment is no longer globally required), who is affected (resource type authors, existing authors, downstream consumers), and how to author manifests that opt into the base — including the allOf-vs-properties placement footgun and the per-type-wins precedence rule. Signed-off-by: Nithya Subramanian <[email protected]>
Covers the manual test plan for both surfaces the feature touches:
* Path A — 'rad resource-type create' (opt-in, override, bad URI,
backward compatibility, reserved-name rejection, codeReference
round-trip).
* Path B — Bicep extension generation via manifest-to-bicep and
'rad bicep publish-extension'.
Also lists the automated regression coverage so contributors know what
runs in CI versus what they must drive by hand.
Signed-off-by: Nithya Subramanian <[email protected]>
Adds a 'Worked example' subsection to the How to test section showing contributors how to migrate the in-repo testresourcetypes.yaml fixture to the base-resource opt-in form, with concrete before/after YAML for userTypeAlpha (richer per-type connections override), postgres (base provides connections), and externalResource (base + extended required). Includes step-by-step verification for both 'rad resource-type create' and 'rad bicep publish-extension', with negative test instructions for each, and the pass criteria for the unpacked Bicep extension output. Signed-off-by: Nithya Subramanian <[email protected]>
❌ Spellcheck FailedThere are spelling errors in your PR. Visit the workflow output to see what words are failing. Adding new wordsYou can add new custom words to .cspellignore. |
|
This pull request has been automatically marked as stale because it has been inactive for 4 weeks. To keep it open, either remove the |
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.
Description
Please explain the changes you've made.
Type of change
Fixes: #issue_number
Contributor checklist
Please verify that the PR meets the following requirements, where applicable:
eng/design-notes/in this repository, if new APIs are being introduced.