Skip to content

Add multi-file merge support to manifest-to-bicep generate command#11914

Merged
kachawla merged 2 commits into
mainfrom
kachawla/multi-file-generate
May 15, 2026
Merged

Add multi-file merge support to manifest-to-bicep generate command#11914
kachawla merged 2 commits into
mainfrom
kachawla/multi-file-generate

Conversation

@kachawla
Copy link
Copy Markdown
Member

@kachawla kachawla commented May 15, 2026

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, 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):

go run ./bicep-tools/cmd/manifest-to-bicep generate containers.yaml /tmp/out

Multiple files (merge into one output):

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.

Dependencies

Copilot AI review requested due to automatic review settings May 15, 2026 21:08
@kachawla kachawla requested review from a team as code owners May 15, 2026 21:08
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Dependency Review

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

Scanned Files

None

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

Extends the manifest-to-bicep generate subcommand to accept multiple manifest files that share a namespace, merging their Types into a single Bicep extension output. This supports the per-type manifest file layout introduced by the automated resource-type registration work, while remaining backward compatible for single-file usage.

Changes:

  • Update generate command to accept <manifest1> [manifest2 ...] <output> and treat the last positional arg as the output directory.
  • Add mergeManifestFiles() that validates namespace consistency, rejects duplicate type names, and re-serializes a merged ResourceProvider for GenerateFromString.
  • Add unit tests and YAML test fixtures (containers.yaml, routes.yaml, secrets.yaml).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bicep-tools/cmd/manifest-to-bicep/main.go Accept multi-file args, refactor RunGenerate signature, add mergeManifestFiles helper.
bicep-tools/cmd/manifest-to-bicep/main_test.go New tests for single-file, multi-file merge, namespace mismatch, missing file, empty list, duplicate type.
bicep-tools/cmd/manifest-to-bicep/testdata/containers.yaml Test fixture for Radius.Compute/containers.
bicep-tools/cmd/manifest-to-bicep/testdata/routes.yaml Test fixture for Radius.Compute/routes.
bicep-tools/cmd/manifest-to-bicep/testdata/secrets.yaml Test fixture for Radius.Security/secrets used in namespace-mismatch test.

@kachawla kachawla force-pushed the kachawla/multi-file-generate branch from 1207c92 to 5e9c5c2 Compare May 15, 2026 21:13
Comment thread bicep-tools/cmd/manifest-to-bicep/main.go
Comment thread bicep-tools/cmd/manifest-to-bicep/main.go
nithyatsu
nithyatsu previously approved these changes May 15, 2026
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, where
each file defines a single resource type within a namespace.

Backward compatible: single-file usage works exactly as before.

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

Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.80%. Comparing base (73acc9a) to head (76e9a54).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11914      +/-   ##
==========================================
+ Coverage   51.71%   51.80%   +0.08%     
==========================================
  Files         726      726              
  Lines       45608    57559   +11951     
==========================================
+ Hits        23587    29817    +6230     
- Misses      19795    25519    +5724     
+ Partials     2226     2223       -3     

☔ 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
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Unit Tests

    2 files  ±0    423 suites  ±0   7m 15s ⏱️ -11s
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 76e9a54. ± Comparison against base commit 73acc9a.

♻️ This comment has been updated with latest results.

Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests Bot commented May 15, 2026

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 76e9a54
Unique ID func1ea27918b6
Image tag pr-func1ea27918b6
  • 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-func1ea27918b6
  • 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-func1ea27918b6
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func1ea27918b6
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func1ea27918b6
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func1ea27918b6
  • 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...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ corerp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@kachawla kachawla merged commit 7766024 into main May 15, 2026
59 checks passed
@kachawla kachawla deleted the kachawla/multi-file-generate branch May 15, 2026 22:41
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.

3 participants