Skip to content

fix(typespec): fix TypeSpec 1.9.0 compatibility after npm-dependencies bump#11467

Open
sylvainsf wants to merge 6 commits intomainfrom
fix/typespec-http-private-decorator
Open

fix(typespec): fix TypeSpec 1.9.0 compatibility after npm-dependencies bump#11467
sylvainsf wants to merge 6 commits intomainfrom
fix/typespec-http-private-decorator

Conversation

@sylvainsf
Copy link
Copy Markdown
Contributor

@sylvainsf sylvainsf commented Mar 22, 2026

Description

The dependabot bump in #11223 updated @typespec/http to 1.9.0 and @azure-tools/typespec-azure-resource-manager to 0.65.0. This broke make generate with three categories of TypeSpec compilation errors:

1. Http.Private.includeInapplicableMetadataInPayloadinvalid-ref

In @typespec/http 1.9.0, the decorator is defined in TypeSpec.Http.Private (not Http.Private). Additionally, the bare form @includeInapplicableMetadataInPayload is not resolvable from within the Azure.ResourceManager namespace context. The fix uses the fully qualified @TypeSpec.Http.Private.includeInapplicableMetadataInPayload(false) in typespec/radius/v1/trackedresource.tsp.

Investigation note: An earlier version of this fix used @includeInapplicableMetadataInPayload (bare form), which worked with the packages cached locally (@typespec/compiler@0.66.0, @azure-tools/typespec-azure-resource-manager@0.52.0) but failed in CI because the lockfile pins @typespec/compiler@1.9.0 and @azure-tools/typespec-azure-resource-manager@0.65.0. After pnpm install --frozen-lockfile reproduced the CI error, the correct fully qualified form was identified.

2. missing-paging-items in UCP operations

TypeSpec 1.9.0 enforces that paged operations (@list) must have @pageItems on their return type. In ARM 0.65.0, ResourceListResult extends Azure.Core.Page which has @pageItems, so @list works correctly. All list operations retain @list; the UcpResourceList template uses @list (not @listsResource).

3. using-versioned-library / Azure.ResourceManager.Versionsinvalid-ref

In @azure-tools/typespec-azure-resource-manager 0.65.0, the Azure.ResourceManager.Versions enum no longer exists — the ARM library is no longer a versioned library itself. This means @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) is invalid and the decorator can simply be removed from all Versions enums.

Investigation note: An earlier version of this fix added @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) to satisfy a using-versioned-library warning. This worked locally with stale packages but failed in CI because Azure.ResourceManager.Versions does not exist in ARM 0.65.0. The fix is to remove the @useDependency entirely.

Regenerated OpenAPI specs and Go client code. Minor cosmetic changes in generated output reflect the new compiler version (e.g. removal of x-ms-identifiers: [] on array properties).

Type of change

  • 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).

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

@sylvainsf sylvainsf requested review from a team as code owners March 22, 2026 09:39
Copilot AI review requested due to automatic review settings March 22, 2026 09:39
@sylvainsf sylvainsf requested a deployment to external-contributor-approval March 22, 2026 09:39 — with GitHub Actions Waiting
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

Fixes Radius TypeSpec sources and regenerated artifacts to restore compatibility after the TypeSpec 1.9.0 / Azure TypeSpec library bumps (unblocking make generate).

Changes:

  • Updated TypeSpec decorators/usages for TypeSpec 1.9.0 stricter validation (paging + versioned-library dependency declarations).
  • Adjusted UCP list operation annotations to satisfy new paging enforcement.
  • Regenerated OpenAPI specs and Go SDK code with updated emitter/compiler behavior.

Reviewed changes

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

Show a summary per file
File Description
typespec/UCP/ucp-operations.tsp Switches UCP list helper to @listsResource for TypeSpec 1.9 paging rules.
typespec/UCP/resourceproviders.tsp Removes @list from provider summaries to avoid new paging validation failures.
typespec/UCP/radius-plane.tsp Removes @list from explicit-route list op; relies on ARM list metadata.
typespec/UCP/main.tsp Adds @useDependency(...) for versioned library compliance.
typespec/UCP/azure-plane.tsp Removes @list from explicit-route list op; relies on ARM list metadata.
typespec/UCP/aws-plane.tsp Removes @list from explicit-route list op; relies on ARM list metadata.
typespec/radius/v1/trackedresource.tsp Updates moved HTTP decorator to public @includeInapplicableMetadataInPayload.
typespec/Radius.Core/main.tsp Adds @useDependency(...) for versioned library compliance.
typespec/Applications.Messaging/main.tsp Adds @useDependency(...) for versioned library compliance.
typespec/Applications.Datastores/main.tsp Adds @useDependency(...) for versioned library compliance.
typespec/Applications.Dapr/main.tsp Adds @useDependency(...) for versioned library compliance.
typespec/Applications.Core/main.tsp Adds @useDependency(...) for versioned library compliance.
swagger/specification/ucp/resource-manager/UCP/preview/2023-10-01-preview/openapi.json Regenerated spec; includes new emitter outputs (e.g., x-ms-identifiers).
swagger/specification/radius/resource-manager/Radius.Core/preview/2025-08-01-preview/openapi.json Regenerated spec; cosmetic schema metadata changes.
swagger/specification/applications/resource-manager/Applications.Messaging/preview/2023-10-01-preview/openapi.json Regenerated spec; operationId casing changes + example-linking changes.
swagger/specification/applications/resource-manager/Applications.Datastores/preview/2023-10-01-preview/openapi.json Regenerated spec; cosmetic schema metadata changes.
swagger/specification/applications/resource-manager/Applications.Dapr/preview/2023-10-01-preview/openapi.json Regenerated spec; cosmetic schema metadata changes.
swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json Regenerated spec; includes new emitter outputs (e.g., x-ms-identifiers).
pkg/messagingrp/api/v20231001preview/zz_generated_responses.go Regenerated Go responses reflecting operationId/group casing normalization.
pkg/messagingrp/api/v20231001preview/zz_generated_rabbitmqqueues_client.go Regenerated Go client with RabbitMqQueues* casing updates.
pkg/messagingrp/api/v20231001preview/zz_generated_options.go Regenerated Go options types with updated client/type casing.
pkg/messagingrp/api/v20231001preview/zz_generated_client_factory.go Regenerated factory method/type casing for the RabbitMQ queues client.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 22, 2026

Unit Tests

    2 files  ±0    416 suites  ±0   6m 45s ⏱️ +9s
4 878 tests ±0  4 876 ✅ ±0  2 💤 ±0  0 ❌ ±0 
5 793 runs  ±0  5 791 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit a9748be. ± Comparison against base commit 16a8721.

♻️ This comment has been updated with latest results.

@sylvainsf sylvainsf requested a deployment to external-contributor-approval March 22, 2026 09:58 — with GitHub Actions Waiting
@sylvainsf sylvainsf requested a deployment to external-contributor-approval March 22, 2026 10:13 — with GitHub Actions Waiting
@sylvainsf sylvainsf temporarily deployed to external-contributor-approval March 22, 2026 10:17 — with GitHub Actions Inactive
@sylvainsf sylvainsf temporarily deployed to external-contributor-approval March 22, 2026 10:25 — with GitHub Actions Inactive
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.06%. Comparing base (16a8721) to head (a9748be).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11467      +/-   ##
==========================================
- Coverage   51.07%   51.06%   -0.01%     
==========================================
  Files         699      699              
  Lines       44316    44316              
==========================================
- Hits        22633    22629       -4     
- Misses      19517    19519       +2     
- Partials     2166     2168       +2     

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

Copy link
Copy Markdown
Member

@brooke-hamilton brooke-hamilton left a comment

Choose a reason for hiding this comment

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

I think this may be an environment issue rather than a break in the npm dependencies bump. The lint.yaml check is currently not reporting any errors or generated code diffs on main, which means that make generate is running successfully. (I manually ran lint.yaml on main. Logs are here.)

Also, the dev container runs make generate without errors and without changes to any generated files.

I can help with debugging the environment if that helps.

…s bump

After the dependabot bump to @typespec/http@1.9.0 and
@azure-tools/typespec-azure-resource-manager@0.65.0 (PR #11223),
several TypeSpec compilation errors broke 'make generate':

1. Http.Private.includeInapplicableMetadataInPayload: the decorator moved
   out of the Private namespace in @typespec/http 1.9.0; use the top-level
   @includeInapplicableMetadataInPayload form instead.

2. missing-paging-items: TypeSpec 1.9.0 enforces @pageItems on paged
   operation return types when @list is used. Replace @list with
   @listsResource for auto-routed UCP template ops, and remove @list
   from explicitly-routed plane/provider ops where @armResourceList
   already provides the x-ms-pageable extension.

3. using-versioned-library: TypeSpec 1.9.0 requires namespaces using
   versioned libraries to declare the dependency via @useDependency.
   Add @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
   to all TypeSpec package Versions enums.

Regenerated OpenAPI specs and Go client code with the new compiler output.

Signed-off-by: Sylvain Afchain <sylvain@afchain.fr>
…0 and ARM 0.65.0

- Use fully qualified `@TypeSpec.Http.Private.includeInapplicableMetadataInPayload`
  since bare form is not resolvable in Azure.ResourceManager namespace context with 1.9.0
- Remove `@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)` from all
  Versions enums since Azure.ResourceManager.Versions no longer exists in ARM 0.65.0
  (the ARM library is no longer a versioned library itself in this version)
- Regenerate swagger output with TypeSpec 1.9.0

Signed-off-by: Sylvain Niles <sylvainniles@microsoft.com>
…CP swagger

In ARM 0.65.0, ResourceListResult extends Azure.Core.Page which has @pageItems,
so @list works without triggering the missing-paging-items error in TypeSpec 1.9.0.

Restore @list to the 5 custom-routed UCP list operations and revert from
@listsResource(TResource) back to @list in the UcpResourceList template.
Regenerate UCP swagger to restore x-ms-pageable on all list operations.

Signed-off-by: Sylvain Niles <sylvainniles@microsoft.com>
…s casing

The swagger operationId was fixed back to RabbitMQQueues_* in 7daf434 but the
Go client was not regenerated at that point. Re-run autorest to restore the
correct RabbitMQQueuesClient type and method names.

Signed-off-by: Sylvain Niles <sylvainniles@microsoft.com>
…s enum

Signed-off-by: Sylvain Niles <sylvainniles@microsoft.com>
@sylvainsf sylvainsf force-pushed the fix/typespec-http-private-decorator branch from c5a64f1 to ee0d344 Compare March 23, 2026 08:38
@sylvainsf sylvainsf temporarily deployed to external-contributor-approval March 23, 2026 08:38 — with GitHub Actions Inactive
@radius-functional-tests
Copy link
Copy Markdown

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

3 participants