Automate default resource type registration from resource-types-contrib#11911
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
There was a problem hiding this comment.
Pull request overview
This PR makes resource-types-contrib the source of truth for the default resource type manifests shipped with Radius by introducing a local sync target and a PR-time drift check, plus updating the built-in provider manifests to be per-resource-type and omit location so routing uses UCP’s DefaultDownstreamEndpoint.
Changes:
- Add
make update-resource-types/make sync-resource-typesto copy default manifests listed indeploy/manifest/defaults.yamlfrom the pinnedresource-types-contribmodule version. - Add a GitHub Actions workflow that re-runs
make sync-resource-typesand fails if the committed copies drift. - Refactor built-in provider manifests to per-type files (and add an integration test covering manifest registration without
location).
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/verify-resource-types.yaml | Adds PR-time drift detection by re-syncing and diffing built-in provider manifests. |
| build/resource-types.mk | Implements local sync/version-bump targets to copy manifests from the Go module cache. |
| deploy/manifest/defaults.yaml | Declares which <namespace>/<typeName> resource types ship as defaults and are synced. |
| deploy/manifest/built-in-providers/dev/containers.yaml | Updates dev built-in manifests to per-type layout and removes explicit location. |
| deploy/manifest/built-in-providers/dev/mySqlDatabases.yaml | Removes explicit location and aligns formatting with upstream per-type manifest. |
| deploy/manifest/built-in-providers/dev/persistentVolumes.yaml | Adds per-type persistentVolumes manifest synced from upstream. |
| deploy/manifest/built-in-providers/dev/routes.yaml | Adds per-type routes manifest synced from upstream. |
| deploy/manifest/built-in-providers/dev/secrets.yaml | Removes explicit location and updates schema/docs per upstream manifest. |
| deploy/manifest/built-in-providers/self-hosted/containers.yaml | Updates self-hosted built-in manifests to per-type layout and removes explicit location. |
| deploy/manifest/built-in-providers/self-hosted/mySqlDatabases.yaml | Removes explicit location and aligns formatting with upstream per-type manifest. |
| deploy/manifest/built-in-providers/self-hosted/persistentVolumes.yaml | Adds per-type persistentVolumes manifest synced from upstream. |
| deploy/manifest/built-in-providers/self-hosted/routes.yaml | Adds per-type routes manifest synced from upstream. |
| deploy/manifest/built-in-providers/self-hosted/secrets.yaml | Removes explicit location and updates schema/docs per upstream manifest. |
| deploy/manifest/built-in-providers/dev/radius_compute.yaml (removed) | Removes old namespace-bundled manifest (superseded by per-type YAMLs). |
| deploy/manifest/built-in-providers/self-hosted/radius_compute.yaml (removed) | Removes old namespace-bundled manifest (superseded by per-type YAMLs). |
| deploy/manifest/built-in-providers/dev/radius_data.yaml (removed) | Removes old namespace-bundled manifest (superseded by per-type YAMLs). |
| deploy/manifest/built-in-providers/self-hosted/radius_data.yaml (removed) | Removes old namespace-bundled manifest (superseded by per-type YAMLs). |
| deploy/manifest/built-in-providers/dev/radius_security.yaml (removed) | Removes old namespace-bundled manifest (superseded by per-type YAMLs). |
| deploy/manifest/built-in-providers/self-hosted/radius_security.yaml (removed) | Removes old namespace-bundled manifest (superseded by per-type YAMLs). |
| pkg/resourcetypescontrib/import.go | Adds a blank import to keep resource-types-contrib pinned in go.mod. |
| go.mod | Pins github.com/radius-project/resource-types-contrib dependency version. |
| go.sum | Adds checksums for the new module dependency. |
| Makefile | Includes build/resource-types.mk to expose the new targets. |
| pkg/ucp/integrationtests/resourceproviders/resourceproviders_test.go | Adds a test ensuring manifests without location are registered at startup. |
| pkg/ucp/integrationtests/resourceproviders/testdata/manifests-no-location/containers.yaml | Adds a minimal no-location manifest fixture for the new integration test. |
Comments suppressed due to low confidence (2)
deploy/manifest/built-in-providers/dev/containers.yaml:53
- Typo in the manifest description: "emphemeral" should be "ephemeral". Since this file is now synced from resource-types-contrib, fix it upstream and re-run
make sync-resource-typesto update the copy.
deploy/manifest/built-in-providers/self-hosted/containers.yaml:53 - Typo in the manifest description: "emphemeral" should be "ephemeral". Since this file is now synced from resource-types-contrib, fix it upstream and re-run
make sync-resource-typesto update the copy.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11911 +/- ##
==========================================
+ Coverage 51.70% 51.71% +0.01%
==========================================
Files 726 726
Lines 45608 45608
==========================================
+ Hits 23581 23587 +6
+ Misses 19798 19795 -3
+ Partials 2229 2226 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace manually-maintained per-namespace manifest files with per-type manifest files copied from resource-types-contrib. This eliminates schema drift by making resource-types-contrib the single source of truth for resource type schemas that ship as defaults in Radius. File layout change: Previously, built-in-providers/ contained one YAML file per namespace (e.g. radius_compute.yaml with containers, routes, and persistentVolumes all in one file). Now each resource type has its own file (containers.yaml, routes.yaml, persistentVolumes.yaml, etc.), matching the per-type file layout in resource-types-contrib. This makes it straightforward to map defaults.yaml entries to files and keeps diffs scoped to the type that changed. Changes: - Add deploy/manifest/defaults.yaml listing default resource types - Add build/resource-types.mk with update-resource-types and sync-resource-types Makefile targets - Add pkg/resourcetypescontrib/import.go with a blank import to keep resource-types-contrib in go.mod across go mod tidy - Add go.mod dependency on resource-types-contrib pinned to v0.0.0-20260515162318-067b29d71eb8 - Copy per-type manifest files from resource-types-contrib into both dev/ and self-hosted/ directories - Remove old per-namespace files (radius_compute.yaml, radius_data.yaml, radius_security.yaml) from both directories - Add .github/workflows/verify-resource-types.yaml for CI drift detection - Add integration test for no-location manifest registration The copied manifests have no 'location' field, so UCP routes requests via DefaultDownstreamEndpoint (dynamic-rp), matching existing behavior. Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
Shell comments (#) inside multi-line backslash-continued recipe blocks break the continuation chain, causing 'Syntax error: end of file unexpected' in CI. Move all inline comments to standalone @# lines before the shell block they describe. Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
Verify the global location resource is created with no address property, confirming UCP will use DefaultDownstreamEndpoint for routing. Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
5a5922a to
e2af82c
Compare
Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
# Description Adding mysql type to default recipepack as a quick follow up to #11911 --------- Signed-off-by: Nithya Subramanian <nithyasu@microsoft.com>
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
…11914) ## Overview Update the existing `generate` subcommand of `manifest-to-bicep` to accept multiple manifest files. When given multiple YAML manifests with the same namespace, their `Types` maps are merged into a single output (`types.json`, `index.json`, `index.md`). This supports per-type manifest files (e.g. `containers.yaml`, `routes.yaml`) as introduced by the [automated resource type registration design](#11911), where each file defines a single resource type within a namespace. Backward compatible: single-file usage works exactly as before. ## Changes - `bicep-tools/cmd/manifest-to-bicep/main.go`: Updated `generate` to accept `<manifest1> [manifest2...] <output>` (last arg is always output dir). Added `mergeManifestFiles()` that validates same namespace and rejects duplicate types. - `bicep-tools/cmd/manifest-to-bicep/main_test.go`: Added tests for single-file, multi-file merge, namespace mismatch, nonexistent file, empty manifest list, and duplicate type detection. - `bicep-tools/cmd/manifest-to-bicep/testdata/`: Added test manifest files for `Radius.Compute` (containers, routes) and `Radius.Security` (secrets). ## Usage Single file (backward compatible): ```bash go run ./bicep-tools/cmd/manifest-to-bicep generate containers.yaml /tmp/out ``` Multiple files (merge into one output): ```bash go run ./bicep-tools/cmd/manifest-to-bicep generate containers.yaml routes.yaml persistentVolumes.yaml /tmp/out ``` ## Test plan - `go test ./bicep-tools/cmd/manifest-to-bicep/` - 6 tests covering single-file generation, multi-file merge, namespace mismatch rejection, nonexistent file handling, empty input, and duplicate type detection. ## Part of Unified Bicep extension publishing (PR 1/4). See [design doc](#11892). ## Dependencies - [Automated default resource type registration](#11911) (provides `defaults.yaml` and per-type manifest files that this command consumes) --------- Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
Overview
Implement automated sync of default resource type manifests from
resource-types-contribinto theradiusrepo, as described in the design: https://github.com/radius-project/radius/pull/11610/changes.This eliminates manual cross-repo file editing and schema drift by making
resource-types-contribthe single source of truth for resource type manifests that ship as defaults in Radius.How it works
There are two pieces: a manual Makefile target that copies manifests, and a CI check that verifies the copies are up to date.
1. Manual sync (developer runs locally)
When a developer wants to update the default resource types - either to pick up schema changes from
resource-types-contribor to add/remove a default type - they run:make update-resource-types # bumps go.mod to latest resource-types-contrib, then copies manifestsmake sync-resource-types(copy only, no version bump) is useful when:defaults.yamlwithout changing theresource-types-contribversionmake sync-resource-types # copies manifests from the version already pinned in go.modThis reads
deploy/manifest/defaults.yamlto determine which resource types to copy, resolves each entry to a file in theresource-types-contribGo module cache, and copies it intodeploy/manifest/built-in-providers/{dev,self-hosted}/. It also removes any stale previously-copied files that are no longer indefaults.yaml. The developer then commits the resulting changes.There is no automated workflow that does the copying - it is always a deliberate local action followed by a PR.
2. CI drift detection (runs automatically on PRs)
The
verify-resource-types.yamlworkflow runs on every PR that touchesgo.mod,go.sum,defaults.yaml, the copied manifests, or the sync logic. It:make sync-resource-typesin CI (copy only, no version bump).git diffon thebuilt-in-providers/directories.make sync-resource-typesand commit.This catches cases where someone bumps
go.modbut forgets to re-sync, manually edits a copied file, or adds an entry todefaults.yamlwithout re-running the copy.Key design points
go.mod:resource-types-contribis added as a Go module dependency. A blank import inpkg/resourcetypescontrib/import.gokeepsgo mod tidyfrom removing it. The version pinned ingo.modis the single source of truth for which version of manifests are used.RegisterDirectorystartup path is reused as-is. Copied manifests have nolocationfield, so UCP routes viaDefaultDownstreamEndpoint(dynamic-rp).built-in-providers/contained one YAML file per namespace (e.g.,radius_compute.yamlwithcontainers,routes, andpersistentVolumesall in one file). Now each resource type has its own file (e.g.,containers.yaml,routes.yaml). This matches the per-type file layout inresource-types-contrib, makes it straightforward to mapdefaults.yamlentries to files, and keeps diffs scoped to the individual type that changed.Changes
New files
deploy/manifest/defaults.yaml- Lists which resource types fromresource-types-contribship as defaults.build/resource-types.mk- Makefile targets:make update-resource-types- Bumpsgo.modto the latestresource-types-contribversion and syncs manifest files.make sync-resource-types- Copies manifest files from the version pinned ingo.mod(no version bump). Used by CI for drift detection..github/workflows/verify-resource-types.yaml- CI drift detection: runsmake sync-resource-typesand fails if committed copies diverge from the pinned version.pkg/resourcetypescontrib/import.go- Blank import to retain theresource-types-contribdependency ingo.mod.dev/andself-hosted/:containers.yaml,persistentVolumes.yaml,routes.yaml,mySqlDatabases.yaml,secrets.yamlRemoved files
radius_compute.yaml(dev + self-hosted) - Replaced by per-type files:containers.yaml,persistentVolumes.yaml,routes.yamlradius_data.yaml(dev + self-hosted) - Replaced by per-type file:mySqlDatabases.yamlradius_security.yaml(dev + self-hosted) - Replaced by per-type file:secrets.yamlModified files
Makefile- Includesbuild/resource-types.mkgo.mod- Addsresource-types-contribdependency (pinned tov0.0.0-20260515162318-067b29d71eb8)Dependencies
go.modanddoc.gotoresource-types-contrib) - mergedTest plan
make sync-resource-typescopies exactly the files listed indefaults.yamldefaults.yamlcauses the script to fail clearlyTest_ResourceProvider_RegisterManifestscontinues to pass