Skip to content

Adding design for automatically registering core RRTs#11610

Draft
kachawla wants to merge 1 commit intoradius-project:mainfrom
kachawla:rrt-auto-registration
Draft

Adding design for automatically registering core RRTs#11610
kachawla wants to merge 1 commit intoradius-project:mainfrom
kachawla:rrt-auto-registration

Conversation

@kachawla
Copy link
Copy Markdown
Member

@kachawla kachawla commented Apr 8, 2026

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).

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 PR is created in the design-notes 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 the samples repository is created, if existing samples are 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
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Yes
    • Not applicable

Copilot AI review requested due to automatic review settings April 8, 2026 18:33
@kachawla kachawla requested review from a team as code owners April 8, 2026 18:33
Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests bot commented Apr 8, 2026

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository kachawla/radius
Commit ref 4177f2d
Unique ID func29dffc9e05
Image tag pr-func29dffc9e05
  • gotestsum 1.13.0
  • KinD: v0.29.0
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func29dffc9e05
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func29dffc9e05
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func29dffc9e05
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func29dffc9e05
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func29dffc9e05
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a design note proposing automated default registration of Radius resource types by embedding selected manifests from resource-types-contrib into the Radius binary and registering them during UCP initialization.

Changes:

  • Introduces a design for using resource-types-contrib as a Go module dependency and embedding default manifests via go:embed.
  • Proposes a centralized defaults.yaml + go generate workflow to control which manifests ship as defaults.
  • Describes initializer/runtime behavior, error handling, and a test/CI validation plan for generated embed lists.

Comment on lines +86 to +90
│ defaults.yaml ─── lists paths ──► go generate │
│ │ │
│ Compute/containers/containers.yaml ▼ │
│ Compute/routes/routes.yaml manifests_gen.go │
│ Security/secrets/secrets.yaml (//go:embed directives) │
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The architecture diagram shows defaults.yaml “lists paths” and then examples of file paths (e.g., Compute/containers/containers.yaml), but later sections (e.g., the defaults.yaml format example) use logical resource type names like Radius.Compute/containers. Pick one representation (paths vs names) and update the diagram text/examples to match the proposed approach so the embedding/generation workflow is unambiguous.

Copilot uses AI. Check for mistakes.

#### Option 2: Central `defaults.yaml` + `go generate` (Proposed)

A `defaults.yaml` file at the repo root lists which manifest paths should be default-registered. A `go generate` script reads this file and produces `manifests_gen.go` with `//go:embed` directives for exactly those files (plus `defaults.yaml` itself). At runtime, `RegisterFS` reads `defaults.yaml` from the embedded FS to know which paths to load.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section says defaults.yaml “lists which manifest paths should be default-registered”, but the proposed defaults.yaml format later uses logical resource type identifiers (e.g., Radius.Compute/containers) and the Open Questions discuss resolving names → paths. Clarify whether the proposed design is path-based or name-based here (and align wording throughout).

Suggested change
A `defaults.yaml` file at the repo root lists which manifest paths should be default-registered. A `go generate` script reads this file and produces `manifests_gen.go` with `//go:embed` directives for exactly those files (plus `defaults.yaml` itself). At runtime, `RegisterFS` reads `defaults.yaml` from the embedded FS to know which paths to load.
A `defaults.yaml` file at the repo root lists which resource type identifiers should be default-registered (for example, `Radius.Compute/containers`), not raw manifest paths. A `go generate` script reads this file, resolves each resource type identifier to its manifest path in `resource-types-contrib`, and produces `manifests_gen.go` with `//go:embed` directives for exactly those resolved files (plus `defaults.yaml` itself). At runtime, `RegisterFS` reads `defaults.yaml` from the embedded FS to know which resource types to register and loads the corresponding embedded manifests.

Copilot uses AI. Check for mistakes.
Comment on lines +118 to +119
│ └─► radius_compute.yaml (REMOVED, now embedded) │
│ └─► radius_security.yaml (REMOVED, now embedded) │
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deploy/manifest/built-in-providers/ in this repo is split into dev/ and self-hosted/. If the intent is to remove radius_compute.yaml / radius_security.yaml, call out the concrete paths (e.g., deploy/manifest/built-in-providers/{dev,self-hosted}/radius_compute.yaml) so the change is clear and doesn’t imply there are top-level files directly under built-in-providers/.

Suggested change
│ └─► radius_compute.yaml (REMOVED, now embedded) │
│ └─► radius_security.yaml (REMOVED, now embedded) │
│ └─► dev/radius_compute.yaml (REMOVED, now embedded) │
│ └─► dev/radius_security.yaml (REMOVED, now embedded) │
│ └─► self-hosted/radius_compute.yaml (REMOVED, now embedded) │
│ └─► self-hosted/radius_security.yaml (REMOVED, now embedded)│

Copilot uses AI. Check for mistakes.
## Compatibility (optional)

- **No breaking changes**: The existing `ManifestDirectory` config continues to work. Directory-based manifests are registered after embedded manifests, so existing deployments that set a custom manifest directory will continue to function.
- **Removed files**: `radius_compute.yaml` and `radius_security.yaml` are removed from `deploy/manifest/built-in-providers/`. Any tooling or scripts that reference these files directly would need to be updated. The `copy-manifests` Makefile target will copy fewer files but continues to work.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This “Removed files” bullet references deploy/manifest/built-in-providers/ as if the manifests live directly under it, but in this repo they live under deploy/manifest/built-in-providers/dev/ and .../self-hosted/. Update the paths here to match the actual layout so readers can find the affected files/targets easily.

Suggested change
- **Removed files**: `radius_compute.yaml` and `radius_security.yaml` are removed from `deploy/manifest/built-in-providers/`. Any tooling or scripts that reference these files directly would need to be updated. The `copy-manifests` Makefile target will copy fewer files but continues to work.
- **Removed files**: `radius_compute.yaml` and `radius_security.yaml` are removed from `deploy/manifest/built-in-providers/dev/` and `deploy/manifest/built-in-providers/self-hosted/`. Any tooling or scripts that reference these files directly would need to be updated. The `copy-manifests` Makefile target will copy fewer files but continues to work.

Copilot uses AI. Check for mistakes.

- **No breaking changes**: The existing `ManifestDirectory` config continues to work. Directory-based manifests are registered after embedded manifests, so existing deployments that set a custom manifest directory will continue to function.
- **Removed files**: `radius_compute.yaml` and `radius_security.yaml` are removed from `deploy/manifest/built-in-providers/`. Any tooling or scripts that reference these files directly would need to be updated. The `copy-manifests` Makefile target will copy fewer files but continues to work.
- **Redundant registration**: If a deployment provides the same resource type via both embedded manifests and a directory-based manifest, the directory-based one will overwrite the embedded one (UCP uses `CreateOrUpdate`). This is harmless and provides an escape hatch.
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note that directory-based manifests overwriting embedded ones is “harmless” seems inaccurate: the manifest registration code uses CreateOrUpdate semantics for the location resource with a ResourceTypes map built from the current manifest, which can effectively drop previously-registered type entries if the overriding manifest is a subset. Consider clarifying the semantics (full replace vs merge) and/or requiring that an overriding directory manifest include the complete intended provider/type set.

Suggested change
- **Redundant registration**: If a deployment provides the same resource type via both embedded manifests and a directory-based manifest, the directory-based one will overwrite the embedded one (UCP uses `CreateOrUpdate`). This is harmless and provides an escape hatch.
- **Redundant registration**: If a deployment provides the same provider namespace via both embedded manifests and a directory-based manifest, the directory-based registration runs last and uses UCP `CreateOrUpdate` semantics for the location resource. This should be treated as replacing the provider/type set represented by that manifest rather than merging with previously registered embedded types. As a result, an overriding directory manifest must include the complete intended set of resource types for that provider namespace; supplying only a subset can drop type entries that were registered earlier from embedded manifests. This still provides an escape hatch, but it is a full override rather than a harmless partial overlay.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
# Automated Default Registration of Resource Types from resource-types-contrib

* **Author**: Karishma Chawla (@kachawla)

## Overview
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description still contains placeholder Fixes: #issue_number and the Type of change / checklist items aren’t selected. Please update the PR description to link the approved issue/design-doc PR (or mark items N/A) so reviewers can validate scope and tracking.

Copilot uses AI. Check for mistakes.
@kachawla kachawla marked this pull request as draft April 8, 2026 18:42
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.38%. Comparing base (9b812b3) to head (4177f2d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11610   +/-   ##
=======================================
  Coverage   51.38%   51.38%           
=======================================
  Files         699      699           
  Lines       44114    44114           
=======================================
  Hits        22666    22666           
  Misses      19279    19279           
  Partials     2169     2169           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants