Skip to content

fix: derive Azure kube-recipe pins from the recipe pack (#12688) - #12690

Open
sk593 wants to merge 4 commits into
mainfrom
sk593-issue-12688-azure-deploy-blocked-rabbitmq-missing-fr-9315ec
Open

fix: derive Azure kube-recipe pins from the recipe pack (#12688)#12690
sk593 wants to merge 4 commits into
mainfrom
sk593-issue-12688-azure-deploy-blocked-rabbitmq-missing-fr-9315ec

Conversation

@sk593

@sk593 sk593 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

What

Fixes #12688.

Every Azure deploy driven by the generated run-rad-commands-azure.yml was failing in the Create Radius environment and recipe pack step, before rad deploy ever read the application model:

ERROR: the Azure recipe pack still contains a mutable kube recipe tag.

Why

The step downloads the upstream Azure recipe pack and rewrites each mutable ghcr.io/radius-project/kube-recipes/*:latest source to a commit-pinned source, then asserts none remain. The pin list was hardcoded to five recipes, but the pack now ships a sixthkube-recipes/rabbitmq:latest — pulled in when the pack ref was bumped. Nothing pinned it, so the mutable :latest survived the rewrite, the guard's grep matched it, and the job exited 1 for every repo, independent of app content.

This is drift between two independently versioned things. Rather than re-sync the hardcoded list, this takes the issue's recommended durable fix: stop hardcoding and derive the pin set from the pack.

Change

.github/extension/run-rad-commands-azure.yml — derive the pins from the downloaded pack instead of a fixed list. Each recipe entry is keyed by its Radius resource type, e.g.

'Radius.Messaging/rabbitMQ': { kind: 'bicep' source: 'ghcr.io/radius-project/kube-recipes/rabbitmq:latest' }

so both the resource type (which selects the namespace commit in deploy/manifest/defaults.yaml) and the kube-recipe artifact come from the pack itself. awk walks the pack, pairs each kube-recipes/*:latest source with its owning resource type, and each pair is pinned via the existing pin_kube_recipe/radius_contrib_kube_recipe_source path. Whatever Kubernetes recipes the pack ships — rabbitmq today, anything new tomorrow — are pinned automatically, so this class of drift can't reblock deploys.

The mutable-tag guard stays as a safety net. It now names the offending sources (fixing the "deploy failed with no error text" symptom), tolerates grep's no-match exit under set -eo pipefail instead of failing the success path, and explains what an operator must fix.

build/scripts/verify-contrib-consumers.sh — CI's verify-contrib-consumers used to enumerate recipes by scraping the (now-removed) static pin_kube_recipe lines. It now downloads each consumed recipe pack, derives the same <resourceType, artifact> pairs, and docker manifest inspects every pinned source — so CI still proves each ref exists upstream at build time, without a parallel hardcoded list.

build/scripts/test-sync-resource-types.sh — new test_azure_recipe_pack_pin_coverage runs the workflow's own derivation against a fixture pack (including rabbitMQ, the recipe the old list omitted, plus a managed AVM recipe that must be left untouched) and asserts every kube recipe is pinned with nothing left for the guard, and that the guard still fires for a recipe that can't be mapped.

Mapping to the issue's criteria

  • Durable fix (recommended) — pin set computed from $ENV_BICEP; any kube-recipes/<artifact>:latest is pinned automatically via its owning resource type's namespace ref. ✅
  • Improve failure reporting — guard names offenders and gives actionable remediation. ✅ (plus a pipefail correctness fix)
  • Regression test catching this drift at build time — the new coverage test and the pack-deriving CI verifier. ✅

Validation

  • test_azure_recipe_pack_pin_coverage passes: containers + rabbitmq derived and pinned, AVM source untouched, zero offenders; unmappable recipe trips the guard.
  • Full verify-contrib-consumers.sh passes, verifying all six Azure-pack kube recipes (including rabbitmq at the Radius.Messaging ref) plus AWS's direct recipe and the git recipes; --source-of-truth-only passes.
  • test_azure_recipe_pack_pinning (the pin_kube_recipe unit test) and the rest of the sync test suite still pass.
  • YAML still parses.

Note: no resource-types-contrib change is needed — the read-only secrets schema block on Radius.Messaging/rabbitMQ follows the existing repo convention and is kept.

The generated run-rad-commands-azure.yml rewrites each mutable
kube-recipes/*:latest source in the Azure recipe pack to a commit-pinned
source, then asserts none remain. The pin list was hardcoded to five
recipes, but the pack now ships a sixth (kube-recipes/rabbitmq:latest,
pulled in when the pack ref was bumped). The unpinned :latest survived
the rewrite and tripped the mutable-tag guard, failing every Azure deploy
before the app model was ever read.

Add a pin_kube_recipe line for Radius.Messaging/rabbitMQ, handling it the
same way as the other Kubernetes recipes (e.g. containerImages). It
resolves to the Radius.Messaging namespace ref already validated in
defaults.yaml.

Also make the guard name the offending kube-recipes/*:latest sources and
tell the maintainer to add a matching pin_kube_recipe line, instead of
emitting a single generic error, so this class of drift is diagnosable.

Fixes #12688

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 04:58
@sk593
sk593 requested review from a team as code owners August 16, 2026 04:58
@github-actions

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 updates the generated Azure deploy workflow used by the Radius extension to prevent Azure deploys from failing during the “Create Radius environment and recipe pack” step due to an unpinned kube-recipes/*:latest reference in the upstream recipe pack.

Changes:

  • Adds pin_kube_recipe Radius.Messaging/rabbitMQ rabbitmq so the Azure recipe pack rewrite covers the newly introduced RabbitMQ kube recipe.
  • Improves the mutable-tag guard to list the exact remaining kube-recipes/*:latest offenders and provide actionable remediation text.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/extension/run-rad-commands-azure.yml Outdated
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

Functional Tests - statestore-noncloud

2 tests  ±0   2 ✅ ±0   6m 11s ⏱️ + 3m 9s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 84a39dc. ± Comparison against base commit a25786d.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

Unit Tests

    2 files  ±0    457 suites  ±0   7m 35s ⏱️ +3s
6 225 tests ±0  6 223 ✅ ±0  2 💤 ±0  0 ❌ ±0 
7 457 runs  ±0  7 455 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 02715cb. ± Comparison against base commit a25786d.

♻️ This comment has been updated with latest results.

The offenders scan ran as `grep ... | sort -u` inside a command
substitution. Under the workflow's default `set -eo pipefail`, grep
exits 1 when there are no matches (the success case), which propagated
through the pipeline and failed the step. Capture grep's status
directly, treat exit 1 (no matches) as success, and still fail on a
real grep error (status > 1).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.18%. Comparing base (a25786d) to head (02715cb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12690      +/-   ##
==========================================
- Coverage   54.20%   54.18%   -0.02%     
==========================================
  Files         770      770              
  Lines       51085    51085              
==========================================
- Hits        27690    27682       -8     
- Misses      20789    20793       +4     
- Partials     2606     2610       +4     

☔ View full report in Codecov by Harness.
📢 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.

The Azure deploy workflow rewrote a fixed list of kube-recipe sources to
commit-pinned refs, then failed if any 'kube-recipes/*:latest' survived.
When the upstream pack gained a sixth recipe (rabbitMQ) the hardcoded
list did not follow, so the mutable tag survived and blocked every Azure
deploy (#12688).

Derive the pin set directly from the downloaded pack instead. Each recipe
entry is keyed by its Radius resource type, so both the type (which
selects the namespace commit in defaults.yaml) and the kube-recipe
artifact come from the pack itself; whatever Kubernetes recipes the pack
ships, present or future, are pinned automatically. The mutable-tag guard
remains as a safety net and now explains what an operator must fix.

verify-contrib-consumers.sh downloads each consumed recipe pack, derives
the same pairs, and docker-manifest-inspects every pinned source, so CI
still proves each ref exists upstream without a parallel hardcoded list.
A new test, test_azure_recipe_pack_pin_coverage, runs the workflow's own
derivation against a fixture pack (including rabbitMQ, the recipe the old
list omitted) and asserts every kube recipe is pinned with none left for
the guard, plus that the guard still fires for an unmappable recipe.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
@sk593 sk593 changed the title fix: pin rabbitMQ kube recipe in Azure deploy workflow (#12688) fix: derive Azure kube-recipe pins from the recipe pack (#12688) Aug 16, 2026
The derive-from-pack comment in run-rad-commands-azure.yml references the
awk built-in match variables RSTART/RLENGTH and the mawk implementation
used on the Ubuntu runner. Add them to the repo cspell word list so the
Spellcheck check passes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sk593 <shruthikumar@microsoft.com>
@radius-functional-tests

radius-functional-tests Bot commented Aug 17, 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 02715cb
Unique ID funcd2c1e7bcd5
Image tag pr-funcd2c1e7bcd5
  • 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-funcd2c1e7bcd5
  • 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-funcd2c1e7bcd5
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcd2c1e7bcd5
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcd2c1e7bcd5
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcd2c1e7bcd5
  • 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 ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

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.

Azure deploy blocked: rabbitmq missing from pin_kube_recipe list trips the mutable-tag guard

2 participants