Skip to content

Adding design for automatically registering core RRTs#11610

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

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
@kachawla kachawla force-pushed the rrt-auto-registration branch from f165ae2 to 4177f2d Compare April 8, 2026 18:34
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 +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.

@kachawla kachawla force-pushed the rrt-auto-registration branch 2 times, most recently from 06da8d4 to 369e713 Compare April 30, 2026 18:02
@kachawla kachawla requested a review from Copilot April 30, 2026 18:04
Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
@kachawla kachawla force-pushed the rrt-auto-registration branch from 369e713 to 9262bfb Compare April 30, 2026 18:07
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

@kachawla kachawla marked this pull request as ready for review April 30, 2026 18:08
@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests Bot commented Apr 30, 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 9262bfb
Unique ID func32bf85ee4d
Image tag pr-func32bf85ee4d
  • 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-func32bf85ee4d
  • 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-func32bf85ee4d
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func32bf85ee4d
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func32bf85ee4d
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func32bf85ee4d
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details
❌ corerp-cloud functional test failed. Please check the logs for more details

```yaml
defaultRegistration:
- Networking/loadBalancers/loadBalancers.yaml
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the defaults.yaml in radius repo?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

in resource-types-contrib

2. **Defaults key format**: Should `defaults.yaml` entries be file paths (e.g., `Compute/containers/containers.yaml`) or logical resource type names (e.g., `Radius.Compute/containers`)?

- **Option A: File paths (proposed).** Directly resolvable by `go:embed` and `fs.ReadFile` with no lookup step. Breakage on renames is mitigated by `go generate` failing immediately on missing files, making stale paths easy to catch. This is simpler to implement and aligns with how `go:embed` patterns work.
- **Option B: Logical resource type names.** Uses the canonical `<namespace>/<typeName>` format (e.g., `Radius.Compute/containers`) which is stable across file renames and consistent with how resource types are referenced elsewhere in Radius (CLI, API, logs). The `go generate` script resolves names to file paths by scanning the directory tree for matching `namespace` and type entries. This adds generator complexity and couples the generator to the manifest schema format.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm actually leaning towards this as preferred when combined with a version. I'd expect like Radius.Compute/containers@v1 and a file path would look weird.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree, for now I wanted to keep this simple because I believe @Reshrahim is planning to revisit how we surface different stages or resource types. If we think this file is going to be the longer term approach then option B is definitely much better

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like Option B as well because I can totally see someone moving a .yaml manifest file but forgetting to update the file path in defaults.yaml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

going with option B based on the discussion

Remaining files ( `radius_core.yaml`, `microsoft_resources.yaml`) stay because they are not included in resource-types-contrib.

### Error Handling

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there any risk of issues with upgrades? e.g. adding a new resource that's only available in the new version of radius?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have added new resource types in new releases in the past. Have we run into any issues with it so far?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

discussed that this is not expected to happen but we will make sure that proper error handling is done and a test is added for this scenario


**Manifest YAML files** remain unchanged: no `location` field, no `defaultRegistration` field. They contain only `namespace` and `types`.

#### UCP
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Quick question I recently refactored all the type registration to use internal methods not http calls and just want to validate this persists the same pattern

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah thanks for the reminder. I started this design before your changes, I will review your changes and update this accordingly


#### Platform engineer updates a resource type schema

A platform engineer updates the schema for `Radius.Compute/containers` in `resource-types-contrib`. The change flows to Radius when a maintainer bumps the dependency by running `go get -u github.com/radius-project/resource-types-contrib` and merging the `go.mod` change. No file copying or sync scripts are needed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change flows to Radius when a maintainer bumps the dependency by running go get -u github.com/radius-project/resource-types-contrib and merging the go.mod change.

Is the expectation that this gets done at each release? Would it be feasible to build this into a workflow so that it's automated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm hoping dependabot would take care of upgrades here once we add tagged releases to resource-types-contrib, which I'm taking on as a next step after initial implementation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

action item to update release process to include this step till we implement tagged releases


### High Level Design

The design introduces `resource-types-contrib` as a Go module dependency of `radius`. Resource type manifests are embedded into the Radius binary using Go's `embed.FS` mechanism. A central `defaults.yaml` file in `resource-types-contrib` lists which manifests should be embedded and registered by default.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Naming nit: default-types.yaml might be more appropriate if the design is to only store default type definitions in the file.

However, if additional default items (e.g. default recipe packs @nithyatsu 👀) may be stored in the same config file, then defaults.yaml makes sense.

Copy link
Copy Markdown
Member

@brooke-hamilton brooke-hamilton left a comment

Choose a reason for hiding this comment

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

🚀 I really like how this proposal sets up resource-types-contrib as a clear dependency of Radius via a Golang module dependecy.


### 3. Tagged releases and automated dependency updates for `resource-types-contrib`

`resource-types-contrib` does not have a formal release or tagging process today. Without tagged releases, Radius depends on Go pseudo-versions (e.g., `v0.0.0-20260408153021-abc123def456`), and dependency updates require a maintainer to manually run `go get -u`. This limits automation and makes it harder to track what changed between versions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 on creating GitHub releases for the generated go code. Having releases would allow for idiomatic consumption of the releases in the Radius repo, and trigger dependabot updates when a new version is available.

If there is a need for more granular releases for specific resource types, then each resource type could be separated into its own go module and released separately. I don't think this would be required, but it's an option if we find ourselves updating the individual types in different cycles.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants