Skip to content

[Storage] Migrate azure-storage-queue to TypeSpec - #50082

Open
gunjansingh-msft wants to merge 15 commits into
feature/storage/typespecMigrationfrom
feature/storage/typespec
Open

[Storage] Migrate azure-storage-queue to TypeSpec#50082
gunjansingh-msft wants to merge 15 commits into
feature/storage/typespecMigrationfrom
feature/storage/typespec

Conversation

@gunjansingh-msft

Copy link
Copy Markdown
Member

Summary

Migrates azure-storage-queue from AutoRest/Swagger to TypeSpec code generation, targeting the feature/storage/typespecMigration integration branch. The hand-written public clients (QueueClient/QueueServiceClient + async variants) are preserved and delegate to a generated protocol implementation layer.

Scope: 66 files, all under sdk/storage/azure-storage-queue.

What's included

  • Generated protocol implementation from TypeSpec; hand-written convenience layer reconciled over it.
  • Customization (QueueStorageCustomizations) covering:
    • Collapse of the emitter's per-status-code @UnexpectedResponseExceptionType entries to a single QueueStorageExceptionInternal default, so all errors map to QueueStorageException (and XML error bodies deserialize via azure-xml, not Jackson).
    • exposeRawListQueuesResponse raw accessor for hand-written listQueues pagination, plus removeUnusedXmlNextLinkHelpers to drop the now-unused generated helpers.
  • Wire-behavior parity with AutoRest (URL shape, include= query handling, response header reads).
  • SpotBugs fix: BugInstance size is 0.

Validation

  • 323 playback tests pass (0 failures, 0 errors).
  • revapi clean against shipped 12.30.0 — no public API breaks.
  • SpotBugs clean.

Known follow-up

  • tsp-location.yaml currently pins a personal spec fork; must repoint to the merged Azure/azure-rest-api-specs commit once the "java" client.tsp customization block lands upstream.

🤖 Generated with Claude Code

Local Merge and others added 14 commits July 8, 2026 15:39
- Remove the unused generated getXmlNextLink helpers from ServicesImpl.
  exposeRawListQueuesResponse replaces the emitter's paginated path, so the
  private getXmlNextLink helpers are never called, tripping SpotBugs
  UPM_UNCALLED_PRIVATE_METHOD. Add removeUnusedXmlNextLinkHelpers to the
  customization so the removal is reproduced on regeneration.
- ModelHelper.transformQueueProperties: default approximate-messages-count to
  0L (was null) to avoid a null unboxed into the primitive QueueProperties
  field (SpotBugs null-dereference).

SpotBugs: BugInstance size is 0. All 323 playback tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019uaMNtk1vxEK8FSsfCUTwQ
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
35 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Adopts Weidong's typespec-java responseHeadersAsModel client option
(typespec#11420, emitter >= 0.45.11) for the two header-only queue
operations whose results the hand-written clients build from response
headers: Queue.getProperties and Queue.updateMessage. The spec option is
set in the pinned client.tsp (fork commit 21116d8bdd) and generates
QueuesGetPropertiesHeaders and MessageIdsUpdateHeaders.

ModelHelper now uses those generated header models instead of reading
HttpHeaders directly (typed getApproximateMessagesCount / getPopReceipt /
getTimeNextVisible). The x-ms-meta-* metadata map is still read manually
because the single-valued header model cannot represent it. Call sites are
unchanged.

Verified: clean tsp-client update reproduces the header classes; 323
playback tests pass; SpotBugs and revapi clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019uaMNtk1vxEK8FSsfCUTwQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant