Skip to content

Integrate contrib types into unified Bicep extension#11915

Merged
kachawla merged 20 commits into
mainfrom
kachawla/bicep-types-contrib
May 18, 2026
Merged

Integrate contrib types into unified Bicep extension#11915
kachawla merged 20 commits into
mainfrom
kachawla/bicep-types-contrib

Conversation

@kachawla

@kachawla kachawla commented May 15, 2026

Copy link
Copy Markdown
Member

Overview

Today, resource types from resource-types-contrib (e.g. Radius.Compute/containers, Radius.Security/secrets) are published as separate Bicep extensions (radiusCompute, radiusData, radiusSecurity), requiring users to configure multiple entries in bicepconfig.json and use different extension directives depending on the namespace. This PR is part of a series that consolidates them into the existing radius Bicep extension so users have a single extension radius for all Radius-authored types.

Specifically, this PR wires up the build pipeline so that contrib resource type manifests (maintained via make update-resource-types) are included in the unified radius extension alongside the existing TypeSpec/Swagger-generated types.

What this PR does

  1. generate-bicep-types-contrib Makefile target -- reads deploy/manifest/defaults.yaml to discover which contrib namespaces to include and passes all per-type manifests for each namespace to manifest-to-bicep generate for merging into types.json + index.json + index.md. Creates empty docs/ directories so the doc generation script doesn't crash (contrib resource type docs tracked in #11918).
  2. publish-bicep-extension Makefile target -- wraps bicep publish-extension for local testability.
  3. Shared index-builder.ts module -- extracts buildTypeIndex() from generate.ts into a shared module so both the autorest pipeline and the new rebuild-index CLI can use it without code duplication.
  4. rebuild-index.ts CLI wrapper -- standalone entry point that rebuilds the unified index.json/index.md after contrib types.json files are added to the generated tree.
  5. Extended generate-bicep-types target -- now calls generate-bicep-types-contrib then rebuild-index after the existing autorest step, so the full pipeline produces one unified extension.
  6. Removed contrib extension references -- radiusCompute, radiusData, radiusSecurity removed from bicepconfig.json, install-bicep.sh, and pkg/cli/setup since these namespaces are now part of the single radius extension.
  7. Updated functional test workflows -- added yq install step to functional-test-noncloud.yaml and functional-test-cloud.yaml before the make generate-bicep-types step, since the new generate-bicep-types-contrib target requires yq to parse defaults.yaml.

How the build pipeline works after this PR

make generate-bicep-types
  |
  +--> Step 1: autorest pipeline (existing, unchanged)
  |      Generates types from Swagger/TypeSpec for Applications.Core, Applications.Dapr, etc.
  |      Output: generated/radius/applications.core/.../types.json, etc.
  |
  +--> Step 2: generate-bicep-types-contrib (new)
  |      Reads defaults.yaml, runs manifest-to-bicep generate per namespace
  |      Output: generated/radius/radius.compute/.../types.json, etc.
  |
  +--> Step 3: rebuild-index (new)
         Walks the full generated/ tree, builds unified index.json + index.md
         Output: generated/index.json (covers all namespaces from both steps)

CI impact

The generate-bicep-types-contrib step requires yq to parse defaults.yaml. Workflows that call make generate-bicep-types need yq installed beforehand. This PR adds the install step to the two affected workflows (functional-test-noncloud.yaml and functional-test-cloud.yaml), using the same pattern as verify-resource-types.yaml from #11911.

Test plan

  • go test ./pkg/cli/setup/... -- verifies updated bicepconfig template
  • TypeScript build: pnpm -C hack/bicep-types-radius/src/generator run build -- verifies the refactored generate.ts and new index-builder.ts compile cleanly

Dependencies

Changes

  • build/generate.mk: New generate-yq-installed, generate-bicep-types-contrib, and publish-bicep-extension targets
  • hack/bicep-types-radius/src/generator/src/index-builder.ts: New shared module exporting buildTypeIndex()
  • hack/bicep-types-radius/src/generator/src/cmd/generate.ts: Refactored to import buildTypeIndex from the shared module instead of defining it inline
  • hack/bicep-types-radius/src/generator/src/cmd/rebuild-index.ts: New thin CLI wrapper that parses args and calls the shared buildTypeIndex()
  • hack/bicep-types-radius/src/generator/package.json: Added rebuild-index script entry
  • bicepconfig.json, build/install-bicep.sh, pkg/cli/setup/application.go, pkg/cli/setup/application_test.go: Removed contrib extension references
  • .github/workflows/functional-test-noncloud.yaml: Added yq install step before make generate-bicep-types
  • .github/workflows/functional-test-cloud.yaml: Added yq install step before make generate-bicep-types
  • hack/bicep-types-radius/generated/: Regenerated index.json and added contrib type definitions for Radius.Compute, Radius.Data, and Radius.Security (3 new namespace directories with types.json, index.json, index.md, and empty docs/ placeholder)

Part of

Unified Bicep extension publishing (PR 2/4). See design note.

Wire up the build pipeline so that contrib resource type manifests
(maintained via 'make update-resource-types') are included in the unified
'radius' Bicep extension alongside the existing TypeSpec/Swagger-generated
types. This eliminates the separate radiusCompute, radiusData, and
radiusSecurity extensions.

- Add generate-bicep-types-contrib Makefile target that reads
  deploy/manifest/defaults.yaml to discover which contrib namespaces to
  include and passes all per-type manifests for each namespace to
  'manifest-to-bicep generate' for merging.

- Add generate-yq-installed prerequisite target for yq detection.

- Add publish-bicep-extension Makefile target wrapping
  'bicep publish-extension' for local testability.

- Extract buildTypeIndex() from generate.ts into a shared
  index-builder.ts module. Add rebuild-index.ts as a thin CLI wrapper.

- Extend generate-bicep-types target to call generate-bicep-types-contrib
  then rebuild-index after the existing autorest step.

- Remove radiusCompute, radiusData, radiusSecurity from bicepconfig.json,
  install-bicep.sh, and pkg/cli/setup since these namespaces are now
  part of the single 'radius' extension.

Part of: unified Bicep extension publishing (PR 2/4)

Signed-off-by: Karishma Chawla <[email protected]>
Copilot AI review requested due to automatic review settings May 15, 2026 21:45
@kachawla kachawla requested review from a team as code owners May 15, 2026 21:45
@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

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.

Pull request overview

This PR integrates contrib resource types into the unified Radius Bicep extension pipeline so users can rely on a single extension radius configuration.

Changes:

  • Adds Make targets to generate contrib Bicep types, rebuild the unified index, and publish the extension.
  • Refactors Bicep type index generation into a shared TypeScript module with a new rebuild-index CLI.
  • Removes separate contrib extension references from generated and repo-level Bicep configs.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
build/generate.mk Adds contrib generation, index rebuild, and publish targets.
hack/bicep-types-radius/src/generator/src/index-builder.ts Extracts shared index-building logic.
hack/bicep-types-radius/src/generator/src/cmd/rebuild-index.ts Adds CLI entry point for rebuilding indexes.
hack/bicep-types-radius/src/generator/src/cmd/generate.ts Reuses shared index builder.
hack/bicep-types-radius/src/generator/package.json Adds rebuild-index script.
bicepconfig.json Removes separate contrib extensions.
build/install-bicep.sh Updates generated Bicep config extension list.
pkg/cli/setup/application.go / application_test.go Updates scaffolded Bicep config and test expectation.

Comment thread build/generate.mk Outdated
@kachawla kachawla changed the base branch from main to kachawla/multi-file-generate May 15, 2026 21:53
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.70%. Comparing base (076da82) to head (a178a26).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11915      +/-   ##
==========================================
- Coverage   51.73%   51.70%   -0.04%     
==========================================
  Files         726      726              
  Lines       45608    45608              
==========================================
- Hits        23594    23580      -14     
- Misses      19792    19800       +8     
- Partials     2222     2228       +6     

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

@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

Unit Tests

    2 files  ±0    423 suites  ±0   7m 33s ⏱️ +17s
5 128 tests ±0  5 126 ✅ ±0  2 💤 ±0  0 ❌ ±0 
6 157 runs  ±0  6 155 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit a178a26. ± Comparison against base commit 076da82.

♻️ This comment has been updated with latest results.

kachawla added 2 commits May 15, 2026 15:08
Signed-off-by: Karishma Chawla <[email protected]>
Signed-off-by: Karishma Chawla <[email protected]>
nithyatsu
nithyatsu previously approved these changes May 15, 2026
Base automatically changed from kachawla/multi-file-generate to main May 15, 2026 22:41
@kachawla kachawla dismissed nithyatsu’s stale review May 15, 2026 22:41

The base branch was changed.

The doc generation script in the docs repo walks the generated/ tree and
expects a docs/ subdirectory under each namespace/apiVersion. The autorest
pipeline creates this for core namespaces, but manifest-to-bicep generate
does not. Without it, the script crashes with FileNotFoundError.

Creating an empty docs/ directory is safe because the script handles
empty directories gracefully (prints a message and continues). Contrib
resource type docs will be addressed separately.

Signed-off-by: Karishma Chawla <[email protected]>
The generate-bicep-types-contrib Makefile target requires yq to parse
deploy/manifest/defaults.yaml. Add an explicit yq install step (using
go install) before the generate-bicep-types step in the noncloud and
cloud functional test workflows.

Uses the same pattern as verify-resource-types.yaml from the automated
resource type registration PR.

Signed-off-by: Karishma Chawla <[email protected]>
kachawla added 2 commits May 15, 2026 17:02
Adds generated types for Radius.Compute, Radius.Data, and
Radius.Security and rebuilds the unified index.json to include
all 8 namespaces.

Signed-off-by: Karishma Chawla <[email protected]>
nithyatsu
nithyatsu previously approved these changes May 16, 2026
@kachawla kachawla force-pushed the kachawla/bicep-types-contrib branch 3 times, most recently from 004ce1f to 13d68c7 Compare May 18, 2026 05:23
Sort resource type keys, API version keys, and schema property keys before
building bicep types to avoid map-iteration nondeterminism in generated
outputs. Add a regression test that runs Convert repeatedly and verifies
stable TypesContent, IndexContent, and DocumentationContent.

Regenerate contrib types.json files with deterministic ordering.

Signed-off-by: Karishma Chawla <[email protected]>
@kachawla kachawla force-pushed the kachawla/bicep-types-contrib branch from 13d68c7 to 2ee7061 Compare May 18, 2026 05:24
@kachawla kachawla requested a review from Copilot May 18, 2026 06:01

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 13 out of 20 changed files in this pull request and generated 1 comment.

Comment thread build/generate.mk Outdated
Signed-off-by: Karishma Chawla <[email protected]>
@kachawla kachawla force-pushed the kachawla/bicep-types-contrib branch from b87380d to f54cc9b Compare May 18, 2026 06:16

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 14 out of 21 changed files in this pull request and generated 1 comment.

Comment thread build/generate.mk Outdated
@radius-functional-tests

radius-functional-tests Bot commented May 18, 2026

Copy link
Copy Markdown

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref a178a26
Unique ID func1199f50279
Image tag pr-func1199f50279
  • 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-func1199f50279
  • 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-func1199f50279
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func1199f50279
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func1199f50279
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func1199f50279
  • 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...
✅ corerp-cloud functional tests succeeded
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@kachawla kachawla merged commit 9a15c2d into main May 18, 2026
60 checks passed
@kachawla kachawla deleted the kachawla/bicep-types-contrib branch May 18, 2026 14:24
kachawla added a commit to radius-project/resource-types-contrib that referenced this pull request May 19, 2026
## Overview

Today the `radius` Bicep extension published to `biceptypes.azurecr.io`
includes core namespaces (`Applications.Core`, `Applications.Dapr`,
etc.) and, with
[radius#11915](radius-project/radius#11915),
also includes contrib resource types (`Radius.Compute`, `Radius.Data`,
`Radius.Security`). However, when resource type manifests change in this
repo, there is no automation to notify the Radius repo so it can refresh
its manifest copies and republish the extension.

This PR adds a workflow that fires a `repository_dispatch` event to
`radius-project/radius` whenever resource type manifests are updated on
`main`, triggering the Radius repo's automated sync and publish
pipeline.

## End-to-end flow

```
resource-types-contrib merges to main
  |
  +--> notify-radius.yaml (this PR) fires repository_dispatch
         |
         +--> contrib-update-resource-types.yaml (radius repo) receives dispatch
                |
                +--> Runs 'make update-resource-types' to refresh manifest copies
                +--> Opens/updates PR on bot/update-resource-types branch
                       |
                       +--> Human reviews and merges the PR
                              |
                              +--> Push to main triggers build.yaml's existing
                                   build-and-push-bicep-types job
                                     |
                                     +--> Dispatches to radius-publisher
                                     +--> Publishes radius:latest to biceptypes.azurecr.io
```

## What this PR adds

### `notify-radius.yaml`

**Trigger:** Push to `main` touching any YAML file, excluding `.github/`
and `docs/`. This avoids hardcoding namespace folder names (`Compute/`,
`Data/`, `Security/`) so new top-level namespace folders are
automatically covered without workflow changes.

**What it does:**
1. Sends a `resource-types-contrib-updated` dispatch event to
`radius-project/radius` using `peter-evans/repository-dispatch@v3`
2. Includes the commit SHA in the payload for traceability
(informational only -- the Radius workflow always fetches `@latest`)
3. Writes a summary to the GitHub Actions UI

**What happens if a non-manifest YAML changes?** The Radius workflow
runs `make update-resource-types`, finds no diff, and exits cleanly
without opening a PR. A no-op CI run (~1 minute) is the only cost.

**What happens if a new namespace folder is added here but not in
`defaults.yaml`?** Only types listed in the Radius repo's
`deploy/manifest/defaults.yaml` are included in the extension. The
dispatch fires but `make update-resource-types` finds no changes for the
unlisted namespace and no PR is opened. The new types only appear in the
extension when someone adds them to `defaults.yaml` in the Radius repo.

## Dependencies

- Radius repo: [Add workflow to sync contrib resource types and publish
Bicep extensions](radius-project/radius#11916)
-- the receiver of the dispatch
- Required secret: `GH_RAD_CI_BOT_PAT` with `repo` scope on
`radius-project/radius`

## Changes

- `.github/workflows/notify-radius.yaml`: New workflow

## Part of

Unified Bicep extension publishing (PR 4/4). See [design
doc](radius-project/radius#11892).

---------

Signed-off-by: Karishma Chawla <[email protected]>
kachawla added a commit that referenced this pull request May 19, 2026
…ons (#11916)

## Overview

Today the `radius` Bicep extension is published to
`biceptypes.azurecr.io` via the existing
[`build-and-push-bicep-types`](https://github.com/radius-project/radius/blob/main/.github/workflows/build.yaml#L356)
job in `build.yaml`, which dispatches to the `radius-publisher` pipeline
on every push to `main` and on version tag pushes. With
[#11915](#11915) updating
`make generate-bicep-types` to include contrib types, the existing
publish pipeline automatically produces the combined extension -- no new
publish workflow is needed.

However, there is no automation to pull updated resource type manifests
from `resource-types-contrib` into this repo. When someone merges a
schema change or a new resource type in contrib, the manifest copies
committed under `deploy/manifest/built-in-providers/` must be refreshed
manually via `make update-resource-types` before the next publish picks
them up.

This PR adds a workflow that closes that gap by automating the manifest
sync.

## How it works

```
resource-types-contrib merges to main
  |
  +--> notify-radius.yaml (contrib repo, PR 4) fires repository_dispatch
         |
         +--> contrib-update-resource-types.yaml (this PR) receives dispatch
                |
                +--> Runs 'make update-resource-types' to refresh manifest copies
                +--> Opens/updates PR on bot/update-resource-types branch
                       |
                       +--> Human reviews and merges the PR
                              |
                              +--> Push to main triggers build.yaml's existing
                                   build-and-push-bicep-types job
                                     |
                                     +--> Dispatches to radius-publisher
                                     +--> radius-publisher runs make generate-bicep-types
                                          (now includes contrib) and publishes
                                          radius:latest to biceptypes.azurecr.io
```

## What this PR adds

### `contrib-update-resource-types.yaml`

Handles `repository_dispatch` events (type:
`resource-types-contrib-updated`) from `resource-types-contrib`.

**Triggers:**
- `repository_dispatch` -- fired by the contrib repo's
`notify-radius.yaml` workflow (PR 4)
- `workflow_dispatch` -- commented out for production, can be enabled
during development

**Steps:**
1. Validates `contrib_ref` as a hex commit SHA (informational only --
the actual version fetched is determined by `make update-resource-types`
which runs `go get ...@latest`)
2. Installs yq (required by `make update-resource-types` to parse
`defaults.yaml`)
3. Runs `make update-resource-types` to bump `go.mod` to latest contrib
and copy manifests
4. If changes are detected (using `git status --porcelain` to catch both
modified and new untracked files), opens or updates a PR on the
`bot/update-resource-types` branch
5. Merging that PR triggers the existing publish pipeline to republish
`radius:latest`

**Security:**
- `contrib_ref` is validated against `^[a-f0-9]{7,40}$` and passed via
environment variables (not inline `${{ }}` interpolation) to prevent
shell and script injection
- Uses `GH_RAD_CI_BOT_PAT` for checkout and PR creation so the resulting
push triggers CI checks (the default `GITHUB_TOKEN` cannot trigger
workflows on pushes it creates)

**Note:** This workflow depends on `make update-resource-types` from
[#11911](#11911). It
includes a pre-flight check that fails fast with a descriptive error if
the target is not yet available.

## Dependencies

- [Integrate contrib types into unified Bicep
extension](#11915)
- [Automated default resource type
registration](#11911)
(provides `make update-resource-types`)
- Required secret: `GH_RAD_CI_BOT_PAT`

## Changes

- `.github/workflows/contrib-update-resource-types.yaml`: New workflow

## Part of

Unified Bicep extension publishing (PR 3/4). See [design
doc](#11892).

---------

Signed-off-by: Karishma Chawla <[email protected]>
Co-authored-by: Nicole James <[email protected]>
zachcasper pushed a commit to zachcasper/radius that referenced this pull request May 19, 2026
…ons (radius-project#11916)

## Overview

Today the `radius` Bicep extension is published to
`biceptypes.azurecr.io` via the existing
[`build-and-push-bicep-types`](https://github.com/radius-project/radius/blob/main/.github/workflows/build.yaml#L356)
job in `build.yaml`, which dispatches to the `radius-publisher` pipeline
on every push to `main` and on version tag pushes. With
[radius-project#11915](radius-project#11915) updating
`make generate-bicep-types` to include contrib types, the existing
publish pipeline automatically produces the combined extension -- no new
publish workflow is needed.

However, there is no automation to pull updated resource type manifests
from `resource-types-contrib` into this repo. When someone merges a
schema change or a new resource type in contrib, the manifest copies
committed under `deploy/manifest/built-in-providers/` must be refreshed
manually via `make update-resource-types` before the next publish picks
them up.

This PR adds a workflow that closes that gap by automating the manifest
sync.

## How it works

```
resource-types-contrib merges to main
  |
  +--> notify-radius.yaml (contrib repo, PR 4) fires repository_dispatch
         |
         +--> contrib-update-resource-types.yaml (this PR) receives dispatch
                |
                +--> Runs 'make update-resource-types' to refresh manifest copies
                +--> Opens/updates PR on bot/update-resource-types branch
                       |
                       +--> Human reviews and merges the PR
                              |
                              +--> Push to main triggers build.yaml's existing
                                   build-and-push-bicep-types job
                                     |
                                     +--> Dispatches to radius-publisher
                                     +--> radius-publisher runs make generate-bicep-types
                                          (now includes contrib) and publishes
                                          radius:latest to biceptypes.azurecr.io
```

## What this PR adds

### `contrib-update-resource-types.yaml`

Handles `repository_dispatch` events (type:
`resource-types-contrib-updated`) from `resource-types-contrib`.

**Triggers:**
- `repository_dispatch` -- fired by the contrib repo's
`notify-radius.yaml` workflow (PR 4)
- `workflow_dispatch` -- commented out for production, can be enabled
during development

**Steps:**
1. Validates `contrib_ref` as a hex commit SHA (informational only --
the actual version fetched is determined by `make update-resource-types`
which runs `go get ...@latest`)
2. Installs yq (required by `make update-resource-types` to parse
`defaults.yaml`)
3. Runs `make update-resource-types` to bump `go.mod` to latest contrib
and copy manifests
4. If changes are detected (using `git status --porcelain` to catch both
modified and new untracked files), opens or updates a PR on the
`bot/update-resource-types` branch
5. Merging that PR triggers the existing publish pipeline to republish
`radius:latest`

**Security:**
- `contrib_ref` is validated against `^[a-f0-9]{7,40}$` and passed via
environment variables (not inline `${{ }}` interpolation) to prevent
shell and script injection
- Uses `GH_RAD_CI_BOT_PAT` for checkout and PR creation so the resulting
push triggers CI checks (the default `GITHUB_TOKEN` cannot trigger
workflows on pushes it creates)

**Note:** This workflow depends on `make update-resource-types` from
[radius-project#11911](radius-project#11911). It
includes a pre-flight check that fails fast with a descriptive error if
the target is not yet available.

## Dependencies

- [Integrate contrib types into unified Bicep
extension](radius-project#11915)
- [Automated default resource type
registration](radius-project#11911)
(provides `make update-resource-types`)
- Required secret: `GH_RAD_CI_BOT_PAT`

## Changes

- `.github/workflows/contrib-update-resource-types.yaml`: New workflow

## Part of

Unified Bicep extension publishing (PR 3/4). See [design
doc](radius-project#11892).

---------

Signed-off-by: Karishma Chawla <[email protected]>
Co-authored-by: Nicole James <[email protected]>
Signed-off-by: Zach Casper <[email protected]>
zachcasper pushed a commit to zachcasper/radius that referenced this pull request May 19, 2026
…ons (radius-project#11916)

## Overview

Today the `radius` Bicep extension is published to
`biceptypes.azurecr.io` via the existing
[`build-and-push-bicep-types`](https://github.com/radius-project/radius/blob/main/.github/workflows/build.yaml#L356)
job in `build.yaml`, which dispatches to the `radius-publisher` pipeline
on every push to `main` and on version tag pushes. With
[radius-project#11915](radius-project#11915) updating
`make generate-bicep-types` to include contrib types, the existing
publish pipeline automatically produces the combined extension -- no new
publish workflow is needed.

However, there is no automation to pull updated resource type manifests
from `resource-types-contrib` into this repo. When someone merges a
schema change or a new resource type in contrib, the manifest copies
committed under `deploy/manifest/built-in-providers/` must be refreshed
manually via `make update-resource-types` before the next publish picks
them up.

This PR adds a workflow that closes that gap by automating the manifest
sync.

## How it works

```
resource-types-contrib merges to main
  |
  +--> notify-radius.yaml (contrib repo, PR 4) fires repository_dispatch
         |
         +--> contrib-update-resource-types.yaml (this PR) receives dispatch
                |
                +--> Runs 'make update-resource-types' to refresh manifest copies
                +--> Opens/updates PR on bot/update-resource-types branch
                       |
                       +--> Human reviews and merges the PR
                              |
                              +--> Push to main triggers build.yaml's existing
                                   build-and-push-bicep-types job
                                     |
                                     +--> Dispatches to radius-publisher
                                     +--> radius-publisher runs make generate-bicep-types
                                          (now includes contrib) and publishes
                                          radius:latest to biceptypes.azurecr.io
```

## What this PR adds

### `contrib-update-resource-types.yaml`

Handles `repository_dispatch` events (type:
`resource-types-contrib-updated`) from `resource-types-contrib`.

**Triggers:**
- `repository_dispatch` -- fired by the contrib repo's
`notify-radius.yaml` workflow (PR 4)
- `workflow_dispatch` -- commented out for production, can be enabled
during development

**Steps:**
1. Validates `contrib_ref` as a hex commit SHA (informational only --
the actual version fetched is determined by `make update-resource-types`
which runs `go get ...@latest`)
2. Installs yq (required by `make update-resource-types` to parse
`defaults.yaml`)
3. Runs `make update-resource-types` to bump `go.mod` to latest contrib
and copy manifests
4. If changes are detected (using `git status --porcelain` to catch both
modified and new untracked files), opens or updates a PR on the
`bot/update-resource-types` branch
5. Merging that PR triggers the existing publish pipeline to republish
`radius:latest`

**Security:**
- `contrib_ref` is validated against `^[a-f0-9]{7,40}$` and passed via
environment variables (not inline `${{ }}` interpolation) to prevent
shell and script injection
- Uses `GH_RAD_CI_BOT_PAT` for checkout and PR creation so the resulting
push triggers CI checks (the default `GITHUB_TOKEN` cannot trigger
workflows on pushes it creates)

**Note:** This workflow depends on `make update-resource-types` from
[radius-project#11911](radius-project#11911). It
includes a pre-flight check that fails fast with a descriptive error if
the target is not yet available.

## Dependencies

- [Integrate contrib types into unified Bicep
extension](radius-project#11915)
- [Automated default resource type
registration](radius-project#11911)
(provides `make update-resource-types`)
- Required secret: `GH_RAD_CI_BOT_PAT`

## Changes

- `.github/workflows/contrib-update-resource-types.yaml`: New workflow

## Part of

Unified Bicep extension publishing (PR 3/4). See [design
doc](radius-project#11892).

---------

Signed-off-by: Karishma Chawla <[email protected]>
Co-authored-by: Nicole James <[email protected]>
Signed-off-by: Zach Casper <[email protected]>
@DariuszPorowski DariuszPorowski mentioned this pull request May 22, 2026
12 tasks
Reshrahim pushed a commit to Reshrahim/radius that referenced this pull request Jun 15, 2026
…11915)

## Overview

Today, resource types from `resource-types-contrib` (e.g.
`Radius.Compute/containers`, `Radius.Security/secrets`) are published as
separate Bicep extensions (`radiusCompute`, `radiusData`,
`radiusSecurity`), requiring users to configure multiple entries in
`bicepconfig.json` and use different `extension` directives depending on
the namespace. This PR is part of a series that consolidates them into
the existing `radius` Bicep extension so users have a single `extension
radius` for all Radius-authored types.

Specifically, this PR wires up the build pipeline so that contrib
resource type manifests (maintained via [`make
update-resource-types`](radius-project#11911))
are included in the unified `radius` extension alongside the existing
TypeSpec/Swagger-generated types.

## What this PR does

1. **`generate-bicep-types-contrib` Makefile target** -- reads
`deploy/manifest/defaults.yaml` to discover which contrib namespaces to
include and passes all per-type manifests for each namespace to
`manifest-to-bicep generate` for merging into `types.json` +
`index.json` + `index.md`. Creates empty `docs/` directories so the [doc
generation
script](https://github.com/radius-project/docs/blob/main/.github/scripts/generate_resource_references.py)
doesn't crash (contrib resource type docs tracked in
[radius-project#11918](radius-project#11918)).
2. **`publish-bicep-extension` Makefile target** -- wraps `bicep
publish-extension` for local testability.
3. **Shared `index-builder.ts` module** -- extracts `buildTypeIndex()`
from `generate.ts` into a shared module so both the autorest pipeline
and the new `rebuild-index` CLI can use it without code duplication.
4. **`rebuild-index.ts` CLI wrapper** -- standalone entry point that
rebuilds the unified `index.json`/`index.md` after contrib `types.json`
files are added to the generated tree.
5. **Extended `generate-bicep-types` target** -- now calls
`generate-bicep-types-contrib` then `rebuild-index` after the existing
autorest step, so the full pipeline produces one unified extension.
6. **Removed contrib extension references** -- `radiusCompute`,
`radiusData`, `radiusSecurity` removed from `bicepconfig.json`,
`install-bicep.sh`, and `pkg/cli/setup` since these namespaces are now
part of the single `radius` extension.
7. **Updated functional test workflows** -- added `yq` install step to
`functional-test-noncloud.yaml` and `functional-test-cloud.yaml` before
the `make generate-bicep-types` step, since the new
`generate-bicep-types-contrib` target requires `yq` to parse
`defaults.yaml`.

## How the build pipeline works after this PR

```
make generate-bicep-types
  |
  +--> Step 1: autorest pipeline (existing, unchanged)
  |      Generates types from Swagger/TypeSpec for Applications.Core, Applications.Dapr, etc.
  |      Output: generated/radius/applications.core/.../types.json, etc.
  |
  +--> Step 2: generate-bicep-types-contrib (new)
  |      Reads defaults.yaml, runs manifest-to-bicep generate per namespace
  |      Output: generated/radius/radius.compute/.../types.json, etc.
  |
  +--> Step 3: rebuild-index (new)
         Walks the full generated/ tree, builds unified index.json + index.md
         Output: generated/index.json (covers all namespaces from both steps)
```

## CI impact

The `generate-bicep-types-contrib` step requires `yq` to parse
`defaults.yaml`. Workflows that call `make generate-bicep-types` need
`yq` installed beforehand. This PR adds the install step to the two
affected workflows (`functional-test-noncloud.yaml` and
`functional-test-cloud.yaml`), using the same pattern as
`verify-resource-types.yaml` from
[radius-project#11911](radius-project#11911).

## Test plan

- `go test ./pkg/cli/setup/...` -- verifies updated bicepconfig template
- TypeScript build: `pnpm -C hack/bicep-types-radius/src/generator run
build` -- verifies the refactored generate.ts and new index-builder.ts
compile cleanly

## Dependencies

- [Add multi-file merge support to manifest-to-bicep generate
command](radius-project#11914) (merged)
- [Automated default resource type
registration](radius-project#11911)
(merged -- provides `defaults.yaml` and per-type manifest files)

## Changes

- `build/generate.mk`: New `generate-yq-installed`,
`generate-bicep-types-contrib`, and `publish-bicep-extension` targets
- `hack/bicep-types-radius/src/generator/src/index-builder.ts`: New
shared module exporting `buildTypeIndex()`
- `hack/bicep-types-radius/src/generator/src/cmd/generate.ts`:
Refactored to import `buildTypeIndex` from the shared module instead of
defining it inline
- `hack/bicep-types-radius/src/generator/src/cmd/rebuild-index.ts`: New
thin CLI wrapper that parses args and calls the shared
`buildTypeIndex()`
- `hack/bicep-types-radius/src/generator/package.json`: Added
`rebuild-index` script entry
- `bicepconfig.json`, `build/install-bicep.sh`,
`pkg/cli/setup/application.go`, `pkg/cli/setup/application_test.go`:
Removed contrib extension references
- `.github/workflows/functional-test-noncloud.yaml`: Added `yq` install
step before `make generate-bicep-types`
- `.github/workflows/functional-test-cloud.yaml`: Added `yq` install
step before `make generate-bicep-types`
- `hack/bicep-types-radius/generated/`: Regenerated `index.json` and
added contrib type definitions for `Radius.Compute`, `Radius.Data`, and
`Radius.Security` (3 new namespace directories with `types.json`,
`index.json`, `index.md`, and empty `docs/` placeholder)

## Part of

Unified Bicep extension publishing (PR 2/4). See [design
note](radius-project#11892).

---------

Signed-off-by: Karishma Chawla <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Reshrahim pushed a commit to Reshrahim/radius that referenced this pull request Jun 15, 2026
…ons (radius-project#11916)

## Overview

Today the `radius` Bicep extension is published to
`biceptypes.azurecr.io` via the existing
[`build-and-push-bicep-types`](https://github.com/radius-project/radius/blob/main/.github/workflows/build.yaml#L356)
job in `build.yaml`, which dispatches to the `radius-publisher` pipeline
on every push to `main` and on version tag pushes. With
[radius-project#11915](radius-project#11915) updating
`make generate-bicep-types` to include contrib types, the existing
publish pipeline automatically produces the combined extension -- no new
publish workflow is needed.

However, there is no automation to pull updated resource type manifests
from `resource-types-contrib` into this repo. When someone merges a
schema change or a new resource type in contrib, the manifest copies
committed under `deploy/manifest/built-in-providers/` must be refreshed
manually via `make update-resource-types` before the next publish picks
them up.

This PR adds a workflow that closes that gap by automating the manifest
sync.

## How it works

```
resource-types-contrib merges to main
  |
  +--> notify-radius.yaml (contrib repo, PR 4) fires repository_dispatch
         |
         +--> contrib-update-resource-types.yaml (this PR) receives dispatch
                |
                +--> Runs 'make update-resource-types' to refresh manifest copies
                +--> Opens/updates PR on bot/update-resource-types branch
                       |
                       +--> Human reviews and merges the PR
                              |
                              +--> Push to main triggers build.yaml's existing
                                   build-and-push-bicep-types job
                                     |
                                     +--> Dispatches to radius-publisher
                                     +--> radius-publisher runs make generate-bicep-types
                                          (now includes contrib) and publishes
                                          radius:latest to biceptypes.azurecr.io
```

## What this PR adds

### `contrib-update-resource-types.yaml`

Handles `repository_dispatch` events (type:
`resource-types-contrib-updated`) from `resource-types-contrib`.

**Triggers:**
- `repository_dispatch` -- fired by the contrib repo's
`notify-radius.yaml` workflow (PR 4)
- `workflow_dispatch` -- commented out for production, can be enabled
during development

**Steps:**
1. Validates `contrib_ref` as a hex commit SHA (informational only --
the actual version fetched is determined by `make update-resource-types`
which runs `go get ...@latest`)
2. Installs yq (required by `make update-resource-types` to parse
`defaults.yaml`)
3. Runs `make update-resource-types` to bump `go.mod` to latest contrib
and copy manifests
4. If changes are detected (using `git status --porcelain` to catch both
modified and new untracked files), opens or updates a PR on the
`bot/update-resource-types` branch
5. Merging that PR triggers the existing publish pipeline to republish
`radius:latest`

**Security:**
- `contrib_ref` is validated against `^[a-f0-9]{7,40}$` and passed via
environment variables (not inline `${{ }}` interpolation) to prevent
shell and script injection
- Uses `GH_RAD_CI_BOT_PAT` for checkout and PR creation so the resulting
push triggers CI checks (the default `GITHUB_TOKEN` cannot trigger
workflows on pushes it creates)

**Note:** This workflow depends on `make update-resource-types` from
[radius-project#11911](radius-project#11911). It
includes a pre-flight check that fails fast with a descriptive error if
the target is not yet available.

## Dependencies

- [Integrate contrib types into unified Bicep
extension](radius-project#11915)
- [Automated default resource type
registration](radius-project#11911)
(provides `make update-resource-types`)
- Required secret: `GH_RAD_CI_BOT_PAT`

## Changes

- `.github/workflows/contrib-update-resource-types.yaml`: New workflow

## Part of

Unified Bicep extension publishing (PR 3/4). See [design
doc](radius-project#11892).

---------

Signed-off-by: Karishma Chawla <[email protected]>
Co-authored-by: Nicole James <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
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.

4 participants