Skip to content

210 base resource manifest - #15

Closed
nithyatsu wants to merge 13 commits into
mainfrom
210-base-resource-manifest
Closed

210 base resource manifest#15
nithyatsu wants to merge 13 commits into
mainfrom
210-base-resource-manifest

Conversation

@nithyatsu

Copy link
Copy Markdown
Owner

Description

Please explain the changes you've made.

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).
  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).
  • This pull request is a design document and only includes files in the eng/design-notes directory.

Fixes: #issue_number

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

nithyatsu added 13 commits June 19, 2026 10:30
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.
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]>
@github-actions

Copy link
Copy Markdown

❌ Spellcheck Failed

There are spelling errors in your PR. Visit the workflow output to see what words are failing.

Adding new words

You can add new custom words to .cspellignore.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has been inactive for 4 weeks. To keep it open, either remove the stale label or add a new comment to this pull request. If there is no further activity, it will be closed in 1 day. Feel free to re-open this pull request if you would like to see further activity on it.

@github-actions github-actions Bot added the stale label Jul 18, 2026
@github-actions github-actions Bot closed this Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant