fix(typespec): fix TypeSpec 1.9.0 compatibility after npm-dependencies bump#11467
fix(typespec): fix TypeSpec 1.9.0 compatibility after npm-dependencies bump#11467
Conversation
There was a problem hiding this comment.
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. |
...applications/resource-manager/Applications.Messaging/preview/2023-10-01-preview/openapi.json
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
brooke-hamilton
left a comment
There was a problem hiding this comment.
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>
c5a64f1 to
ee0d344
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
Description
The dependabot bump in #11223 updated
@typespec/httpto 1.9.0 and@azure-tools/typespec-azure-resource-managerto 0.65.0. This brokemake generatewith three categories of TypeSpec compilation errors:1.
Http.Private.includeInapplicableMetadataInPayload—invalid-refIn
@typespec/http1.9.0, the decorator is defined inTypeSpec.Http.Private(notHttp.Private). Additionally, the bare form@includeInapplicableMetadataInPayloadis not resolvable from within theAzure.ResourceManagernamespace context. The fix uses the fully qualified@TypeSpec.Http.Private.includeInapplicableMetadataInPayload(false)intypespec/radius/v1/trackedresource.tsp.2.
missing-paging-itemsin UCP operationsTypeSpec 1.9.0 enforces that paged operations (
@list) must have@pageItemson their return type. In ARM 0.65.0,ResourceListResultextendsAzure.Core.Pagewhich has@pageItems, so@listworks correctly. All list operations retain@list; theUcpResourceListtemplate uses@list(not@listsResource).3.
using-versioned-library/Azure.ResourceManager.Versions—invalid-refIn
@azure-tools/typespec-azure-resource-manager0.65.0, theAzure.ResourceManager.Versionsenum 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 allVersionsenums.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
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: