Modernize demo sample to Radius.* resource types and add Redis/Postgr… - #2645
Merged
Conversation
…eSQL variants Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
zachcasper
marked this pull request as ready for review
August 14, 2026 22:44
willdavsmith
added a commit
that referenced
this pull request
Aug 17, 2026
PR #2645 dropped the 'image' parameter from samples/demo/app.bicep, but the demo entry in .github/workflows/test.yaml deploys with '-p image=sampleregistry:5000/samples/demo' so the test exercises the freshly-built image rather than the published ghcr.io one. ARM rejects -p for an undeclared parameter, so the job would fail. Restore the parameter (default-valued, so plain 'rad deploy' is unchanged) in all three files instead of editing the workflow.
willdavsmith
approved these changes
Aug 17, 2026
sk593
added a commit
to radius-project/radius
that referenced
this pull request
Aug 17, 2026
The modernized sample (radius-project/samples#2645) removed the inline redis resource, so the demo app runs without a configured database and stores todo items in memory. Its GET /api/todos responses now include the message "No database is configured, items will be stored in memory." instead of null. Update the three expected list-response bodies to assert that message; the functional test deploy and pod validation already pass, this was the remaining assertion failure. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
pujitha24
pushed a commit
to pujitha24/radius
that referenced
this pull request
Aug 18, 2026
…ple (radius-project#12697) ## Root cause The repo-wide `Functional Tests - samples-noncloud` job is failing on `main` since the samples repo was updated [radius-project/samples#2645](radius-project/samples#2645) ("Modernize demo sample to Radius.* resource types"). radius CI checks out the samples repo at `refs/heads/edge` (`.github/workflows/functional-test-noncloud.yaml`). That samples PR merged into `edge`, so CI now pulls a modernized `samples/demo/app.bicep` that: - uses `Radius.Core/applications` + `Radius.Compute/containers` at `2025-08-01-preview` (was `Applications.Core`), - has **no** `application` parameter (only `environment`), - names the app/container `demo-${environmentName}` → `demo-tutorial` for the `tutorial` environment, - removes the inline `Applications.Datastores/redisCaches` resource (redis now lives in a separate `app-redis.bicep` this test does not deploy). The consuming `Test_FirstApplicationSample` still used the legacy `Applications.Core` types and app name `demo`, and passed `--application`, producing a deploy 404 (container created under `Radius.Compute/containers/demo-tutorial`, app looked up under `Applications.Core/applications/demo-tutorial`). ## Changes **`testdata/tutorial-environment.bicep`** - Modernized to `Radius.Core/environments@2025-08-01-preview` named `tutorial` with `properties.providers.kubernetes.namespace: 'tutorial'`. - Removed the redis recipe registration and the now-unused `registry`/`version` params. `rad deploy` injects the default recipe pack, which supplies the `Radius.Compute/containers` recipe, so no explicit pack is needed. **`tutorial_test.go` (`Test_FirstApplicationSample`)** - Env-deploy executor no longer passes `registry`/`version` bicep params. - App-deploy step drops `.WithApplication(...)`; keeps `.WithEnvironment("tutorial")`. - Expected `RPResources` updated: application `demo-tutorial` (`radius.core/applications`) and container `demo-tutorial` (`radius.compute/containers`); removed the redis `db` expectation. - Pod port-forward + K8s validation now target the `demo-tutorial` resource selector in the environment namespace `tutorial` (recipe-driven `Radius.Compute/containers` pods land in the env's Kubernetes namespace, matching existing modern container tests). This unblocks the repo-wide `samples-noncloud` functional test failure. ## Validation - `go build ./test/...` passes. - `go vet ./test/functional-portable/samples/...` passes. - End-to-end run requires a kind cluster with Radius installed and `RADIUS_SAMPLES_REPO_ROOT` pointing at a samples `edge` checkout; the logic mirrors the modernized sample and existing modern `Radius.Compute/containers` functional tests. --------- Signed-off-by: sk593 <shruthikumar@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the
demosample to the currentRadius.*resource types and adds two datastore variants that show how to connect the demo container to a managed cache and database.Changes
samples/demo/app.bicepApplications.*(2023-10-01-preview) toRadius.*(2025-08-01-preview) resource types.Radius.Core/applicationsresource plus aRadius.Compute/containersresource using the new nestedcontainersmap schema.environmentNamefrom the Environment ID and suffix resource names (demo-${environmentName}) so multiple environments (dev/test/prod) can coexist in the same resource group without name collisions.samples/demo/app-redis.bicep(new)Radius.Data/redisCachescache via aconnections.redislink.samples/demo/app-postgresql.bicep(new)Radius.Data/postgreSqlDatabasesdatabase via aconnections.postgresqllink.@secure()parameter (never stored in the file).Deploy
rad deploy samples/demo/app.bicep rad deploy samples/demo/app-redis.bicep rad deploy samples/demo/app-postgresql.bicep -p password=$(openssl rand -hex 16)