Skip to content

add resource specific property bag to graph#12138

Open
nithyatsu wants to merge 7 commits into
radius-project:mainfrom
nithyatsu:addpropertybag
Open

add resource specific property bag to graph#12138
nithyatsu wants to merge 7 commits into
radius-project:mainfrom
nithyatsu:addpropertybag

Conversation

@nithyatsu

@nithyatsu nithyatsu commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request introduces a new properties field to the ApplicationGraphResource model across multiple API versions and layers (Go structs, OpenAPI specs, TypeSpec definitions, and JSON output). The properties field contains resource-type-specific properties as returned by the resource provider, with sensitive information redacted and redundant fields omitted. The implementation includes logic to deduplicate these properties, updates serialization and deserialization, and adds comprehensive tests and documentation updates.

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).

Fixes: #12124

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.32%. Comparing base (f5b720a) to head (30f1675).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12138      +/-   ##
==========================================
+ Coverage   52.30%   52.32%   +0.01%     
==========================================
  Files         738      738              
  Lines       47301    47313      +12     
==========================================
+ Hits        24743    24755      +12     
  Misses      20192    20192              
  Partials     2366     2366              

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

@nithyatsu nithyatsu force-pushed the addpropertybag branch 2 times, most recently from b15e66d to 6a8353d Compare June 18, 2026 17:35
@nithyatsu nithyatsu requested a review from Copilot June 18, 2026 19:31
@nithyatsu nithyatsu marked this pull request as ready for review June 18, 2026 19:34
@nithyatsu nithyatsu requested review from a team as code owners June 18, 2026 19:34

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 extends the Application Graph response model by adding an optional properties map on each ApplicationGraphResource, intended to expose resource-type-specific property bags (with duplicates omitted) across Applications.Core and Radius.Core API surfaces.

Changes:

  • Add properties?: Record<unknown> to ApplicationGraphResource TypeSpec models and propagate to Swagger/OpenAPI.
  • Populate ApplicationGraphResource.Properties in graph computation, with deduplication logic to omit fields already surfaced elsewhere.
  • Update graph JSON fixtures and add/extend unit + functional tests to validate the new properties output.

Doc impact (advisory):

  • docs/architecture/application-graph.md documents the graph data model and currently omits diffHash/properties; it likely needs an update to reflect the expanded response shape.

Reviewed changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
typespec/Radius.Core/applications.tsp Adds properties field (free-form map) to the Radius.Core graph resource model.
typespec/Applications.Core/applications.tsp Adds properties field (free-form map) to the Applications.Core graph resource model.
swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json Reflects the new properties field in the Radius.Core OpenAPI schema.
swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json Reflects the new properties field in the Applications.Core OpenAPI schema.
pkg/corerp/api/v20250801preview/zz_generated_models.go Adds Properties map[string]any to the generated Radius.Core graph resource Go model.
pkg/corerp/api/v20250801preview/zz_generated_models_serde.go Updates JSON marshal/unmarshal to include properties for Radius.Core graph resources.
pkg/corerp/api/v20231001preview/zz_generated_models.go Adds Properties map[string]any to the generated Applications.Core graph resource Go model.
pkg/corerp/api/v20231001preview/zz_generated_models_serde.go Updates JSON marshal/unmarshal to include properties for Applications.Core graph resources.
pkg/corerp/frontend/controller/applications/graph_util.go Populates graph resource Properties and introduces filtering/deduplication helper.
pkg/corerp/frontend/controller/applications/graph_util_test.go Adds unit tests for property projection/deduplication behavior.
pkg/corerp/frontend/controller/applications/testdata/graph-app-gw-out.json Updates expected graph JSON output to include properties.
pkg/corerp/frontend/controller/applications/testdata/graph-app-directroute-out.json Updates expected graph JSON output to include properties.
test/functional-portable/corerp/noncloud/resources/application_test.go Extends functional test to validate properties presence/shape for container resources.
Files not reviewed (4)
  • pkg/corerp/api/v20231001preview/zz_generated_models.go: Generated file
  • pkg/corerp/api/v20231001preview/zz_generated_models_serde.go: Generated file
  • pkg/corerp/api/v20250801preview/zz_generated_models.go: Generated file
  • pkg/corerp/api/v20250801preview/zz_generated_models_serde.go: Generated file

Comment thread pkg/corerp/frontend/controller/applications/graph_util.go
Comment thread pkg/corerp/frontend/controller/applications/graph_util.go
Comment thread pkg/corerp/frontend/controller/applications/graph_util_test.go
@radius-functional-tests

radius-functional-tests Bot commented Jun 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 nithyatsu/radius
Commit ref 30f1675
Unique ID funcc181cb60c5
Image tag pr-funcc181cb60c5
  • 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-funcc181cb60c5
  • 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-funcc181cb60c5
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcc181cb60c5
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcc181cb60c5
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcc181cb60c5
  • 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

@brooke-hamilton brooke-hamilton self-requested a review June 18, 2026 22:33

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 9 out of 13 changed files in this pull request and generated 7 comments.

Files not reviewed (4)
  • pkg/corerp/api/v20231001preview/zz_generated_models.go: Generated file
  • pkg/corerp/api/v20231001preview/zz_generated_models_serde.go: Generated file
  • pkg/corerp/api/v20250801preview/zz_generated_models.go: Generated file
  • pkg/corerp/api/v20250801preview/zz_generated_models_serde.go: Generated file

Comment on lines +119 to +120
@doc("Resource-type-specific properties of the resource as returned by its resource provider, with secrets redacted. The shape of this map varies by `type` (e.g. an `Applications.Core/containers` resource exposes different keys than `Applications.Datastores/redisCaches` or any user-defined resource type) and matches the `properties` returned by that resource's GET response. Fields already represented elsewhere in this model (id, type, name, provisioningState, status.outputResources, connections, routes) are omitted. Use `diffHash` rather than a byte-wise compare of this map to detect change.")
properties?: Record<unknown>;
Comment on lines +113 to +114
@doc("Resource-type-specific properties of the resource as returned by its resource provider, with secrets redacted. The shape of this map varies by `type` (e.g. a `Radius.Compute/containers` resource exposes different keys than `Radius.Datastores/redisCaches` or any user-defined resource type) and matches the `properties` returned by that resource's GET response. Fields already represented elsewhere in this model (id, type, name, provisioningState, status.outputResources, connections, routes) are omitted. Use `diffHash` rather than a byte-wise compare of this map to detect change.")
properties?: Record<unknown>;
Comment on lines +450 to +452
// existingKeys lists property keys whose value is surfaced as a
// first-class field on ApplicationGraphResource and therefore omitted from the projected
// Properties bag to avoid duplication.
@@ -260,3 +260,67 @@ func Test_getAPIVersionForResourceType_Validation(t *testing.T) {
})
}
}

func Test_projectGraphProperties(t *testing.T) {
Comment on lines +142 to +148
// Graft the actual Properties onto the expected resource
// so the struct-level equality check below succeeds for
// the rest of the fields without having to encode the
// environment-specific property bag in the fixture.
if i < len(expected) {
expected[i].Properties = r.Properties
}
Comment on lines +1341 to 1345
"properties": {
"type": "object",
"description": "Resource-type-specific properties of the resource as returned by its resource provider, with secrets redacted. The shape of this map varies by `type` (e.g. a `Radius.Compute/containers` resource exposes different keys than `Radius.Datastores/redisCaches` or any user-defined resource type) and matches the `properties` returned by that resource's GET response. Fields already represented elsewhere in this model (id, type, name, provisioningState, status.outputResources, connections, routes) are omitted. Use `diffHash` rather than a byte-wise compare of this map to detect change.",
"additionalProperties": {}
}
Comment on lines +2330 to 2334
"properties": {
"type": "object",
"description": "Resource-type-specific properties of the resource as returned by its resource provider, with secrets redacted. The shape of this map varies by `type` (e.g. an `Applications.Core/containers` resource exposes different keys than `Applications.Datastores/redisCaches` or any user-defined resource type) and matches the `properties` returned by that resource's GET response. Fields already represented elsewhere in this model (id, type, name, provisioningState, status.outputResources, connections, routes) are omitted. Use `diffHash` rather than a byte-wise compare of this map to detect change.",
"additionalProperties": {}
}

@brooke-hamilton brooke-hamilton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is looking good. These two things are in addition to the Copilot findings above.

// Properties bag to avoid duplication.
var existingKeys = map[string]struct{}{
"provisioningState": {},
"connections": {},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The routes and status doc mismatches flagged above share one root cause: existingKeys and the documented "omitted" list were never reconciled. Please make a single, consistent decision and apply it everywhere:

  • status is dropped entirely here (confirmed intentional for sensitivity), but every doc says only status.outputResources is omitted.
  • routes is documented as omitted but is not in existingKeys, so it stays in the bag.

Reconcile existingKeys with the doc text and fix all six occurrences of the "omitted fields" sentence together — both Go struct comments (v20231001preview, v20250801preview), both .tsp files, and both openapi.json files — so the API contract is internally consistent.


applicationGraphResource.Connections = connections
applicationGraphResource.OutputResources = outputResourcesFromAPIData(resource)
applicationGraphResource.Properties = getResourceTypeSpecificProperties(resource.Properties)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docs for the new properties field say "with secrets redacted," but getResourceTypeSpecificProperties performs no redaction here — it relies on upstream LIST redaction (e.g. ListResourcesWithRedaction for dynamic-rp). For user-defined types this holds, and the graph caller can already GET these same properties, so this is not a new disclosure. Could you confirm the core-RP container/gateway LIST payloads carry no inline secret values? If so, no code change is needed — just a note so the "secrets redacted" claim is backed by where redaction actually happens.

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.

Include all properties in the graph

3 participants