Skip to content

Add e2e test for x-radius-sensitive annotation updates#11348

Open
lakshmimsft wants to merge 6 commits intomainfrom
lakshmimsft/e2etestssensitivedata
Open

Add e2e test for x-radius-sensitive annotation updates#11348
lakshmimsft wants to merge 6 commits intomainfrom
lakshmimsft/e2etestssensitivedata

Conversation

@lakshmimsft
Copy link
Contributor

Description

This pull request adds new functional tests that validates sensitive field encryption and redaction for user-defined resource types in the dynamic resource provider. The test ensures that fields marked with the x-radius-sensitive annotation are encrypted on creation and update, and are redacted (set to null) when retrieved via GET or LIST operations. The changes include the test logic, supporting Bicep templates, and the resource type schema definition.

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Fixes: #11097

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Yes
    • Not applicable

@lakshmimsft lakshmimsft temporarily deployed to external-contributor-approval March 2, 2026 18:17 — with GitHub Actions Inactive
@lakshmimsft lakshmimsft requested a review from sk593 March 2, 2026 18:17
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Unit Tests

    2 files  ±0    415 suites  ±0   6m 48s ⏱️ +7s
4 862 tests ±0  4 860 ✅ ±0  2 💤 ±0  0 ❌ ±0 
5 762 runs  ±0  5 760 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 585f7fb. ± Comparison against base commit a1059b6.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.09%. Comparing base (0980cf9) to head (9799cc1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11348      +/-   ##
==========================================
- Coverage   51.10%   51.09%   -0.01%     
==========================================
  Files         699      699              
  Lines       44067    44067              
==========================================
- Hits        22521    22518       -3     
- Misses      19400    19402       +2     
- Partials     2146     2147       +1     

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

@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from e552078 to b5d53dd Compare March 2, 2026 19:05
@lakshmimsft lakshmimsft temporarily deployed to external-contributor-approval March 2, 2026 19:05 — with GitHub Actions Inactive
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from b5d53dd to 5ba468a Compare March 2, 2026 21:31
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 21:31 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 21:39 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from b919236 to 320f953 Compare March 2, 2026 22:12
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 22:12 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from 320f953 to 8adbd82 Compare March 2, 2026 22:26
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 22:26 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from 8adbd82 to ae1a4fa Compare March 2, 2026 22:50
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 22:50 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 23:21 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from 120aad6 to 140679d Compare March 2, 2026 23:25
@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 2, 2026 23:25 — with GitHub Actions Waiting
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from 140679d to 4dd6e40 Compare March 2, 2026 23:27
@lakshmimsft lakshmimsft temporarily deployed to external-contributor-approval March 2, 2026 23:27 — with GitHub Actions Inactive
@lakshmimsft lakshmimsft marked this pull request as ready for review March 2, 2026 23:47
@lakshmimsft lakshmimsft requested a review from a team as a code owner March 2, 2026 23:47
Copilot AI review requested due to automatic review settings March 2, 2026 23:47
@lakshmimsft lakshmimsft requested a review from a team as a code owner March 2, 2026 23:47
Copy link
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

Adds a new DynamicRP functional (non-cloud portable) test scenario to validate handling of x-radius-sensitive fields for user-defined resource types, including recipe-time decryption and GET/LIST-time redaction.

Changes:

  • Add a new DynamicRP resource type schema (sensitiveResource) with a mix of sensitive/non-sensitive fields (including nested + object-level sensitivity).
  • Add Bicep templates for deploying the sensitive resource and a recipe that writes decrypted values into a Kubernetes Secret.
  • Add an end-to-end functional test that verifies redaction on GET/LIST and verifies decrypted values were provided to the recipe on create and update.

Reviewed changes

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

File Description
test/testrecipes/test-bicep-recipes/dynamicrp_sensitive_recipe.bicep New recipe writes decrypted sensitive values into a K8s Secret for verification.
test/functional-portable/dynamicrp/noncloud/resources/testdata/testresourcetypes.yaml Adds sensitiveResource schema with x-radius-sensitive annotations.
test/functional-portable/dynamicrp/noncloud/resources/testdata/sensitive-resource.bicep Deploys env/app and the sensitiveResource instance wired to the new recipe.
test/functional-portable/dynamicrp/noncloud/resources/sensitive_fields_test.go New functional test validating GET/LIST redaction and recipe-time decryption on create/update.

@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from 4dd6e40 to 9799cc1 Compare March 3, 2026 01:10
@lakshmimsft lakshmimsft temporarily deployed to external-contributor-approval March 3, 2026 01:10 — with GitHub Actions Inactive
SkipKubernetesOutputResourceValidation: true,
SkipObjectValidation: true,
SkipResourceDeletion: true,
PostStepVerify: func(ctx context.Context, t *testing.T, ct rp.RPTest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to move this to a helper function between the put and update steps?

@lakshmimsft lakshmimsft requested a deployment to external-contributor-approval March 3, 2026 21:23 — with GitHub Actions Waiting
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
@lakshmimsft lakshmimsft force-pushed the lakshmimsft/e2etestssensitivedata branch from 7371e66 to 585f7fb Compare March 3, 2026 21:24
@lakshmimsft lakshmimsft deployed to external-contributor-approval March 3, 2026 21:24 — with GitHub Actions Active
@radius-functional-tests
Copy link

radius-functional-tests bot commented Mar 3, 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 585f7fb
Unique ID funca9ed15a0e5
Image tag pr-funca9ed15a0e5
  • 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-funca9ed15a0e5
  • 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-funca9ed15a0e5
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funca9ed15a0e5
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funca9ed15a0e5
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funca9ed15a0e5
  • 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E Tests

3 participants