Skip to content

Migrate Queue private protocol layer to TypeSpec - #7510

Merged
JinmingHu (Jinming-Hu) merged 14 commits into
mainfrom
jinming-hu-queue-typespec-migration
Oct 30, 2026
Merged

JinmingHu (Jinming-Hu) merged 14 commits into
mainfrom
jinming-hu-queue-typespec-migration

Conversation

@Jinming-Hu

@Jinming-Hu JinmingHu (Jinming-Hu) commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Replaces Queue's AutoRest protocol layer with private TypeSpec-generated code and handwritten adapters. This is the Queue-only part of #7495; other Storage services are unchanged. Public client signatures, model layouts/defaults, and the default API version stay the same.

The old rest_client.hpp is removed. Code including it directly should use queue_responses.hpp or queues.hpp; code relying on response models through queue_options.hpp also needs one of those headers. Generated code now requires valid Date and x-ms-version success-response headers and rejects empty message IDs locally.

Adds a shared internal exception adapter in Storage Common, model tests, and updated Queue playback request headers. Common containing the new helper must ship before the dependent Queue release. Version and dependency updates are left to the release pipeline.

Uses the merged TypeSpec changes in Azure/azure-rest-api-specs#47555 and Azure/typespec-cpp#585. The additional documentation-generation fix is tracked separately in Azure/typespec-cpp#586 and does not block this PR.

Merged current main after #7483 and preserved its recordings in assets tag cpp/storage_a6149e4c39. Only Queue request headers were changed; responses, bodies, and other packages are unchanged. All five Storage suites passed against the clean published tag in PLAYBACK mode: 494 passed, 118 expected LIVE-only skips, zero failures (Queue: 33 passed). CI is rerunning for this merge update; the previous head passed Core and Storage CI.

Pull Request Checklist

Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:

See the detailed list in the contributing guide.

  • C++ Guidelines
  • Doxygen docs
  • Unit tests
  • No unwanted commits/changes
  • Descriptive title/description
    • PR is single purpose
    • Related issue listed
  • Comments in source
  • No typos
  • Update changelog
  • Not work-in-progress
  • External references or docs updated
  • Self review of PR done
  • Any breaking changes?

Extract only azure-storage-queues from the combined Storage migration. Preserve public headers and reuse the existing Storage pipeline and models.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Oct 23, 2026
@azure-pipelines

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

@Jinming-Hu JinmingHu (Jinming-Hu) changed the title [DO NOT MERGE] Migrate Queue private protocol layer to TypeSpec Migrate Queue private protocol layer to TypeSpec Oct 23, 2026
JinmingHu (Jinming-Hu) and others added 11 commits October 24, 2026 10:33
Remove historical Swagger configuration and repository generation instructions/configuration. Drop the transparent internal migration changelog entry; retain generated runtime code, adapters and tests unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve all 26 public model types and bitwise operators in queue_models.hpp. Remove obsolete private protocol declarations and relocate the unchanged default API version. Update public includes and packaging, and cover model defaults and enums.

The removal of azure/storage/queues/rest_client.hpp is an explicitly accepted source-breaking include-path change; no forwarding header is retained.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move preserved public model declarations and operators into queue_responses.hpp and remove queue_models.hpp. Define the unchanged ListQueuesOptions alongside its paged response to keep header dependencies one-way and preserve layout. Update public includes, build list, and direct-header tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add the missing terminal newline to queue_responses.hpp.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the standard Storage pipeline and retain generated XML headers. Update offline protocol assertions for the intended headers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the unchanged invocation helper to an installed Common internal header, add generic tests, and require the existing next Common version from Queue.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the Common helper and Queue runtime unchanged; leave vcpkg and dependency version updates to the release pipeline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add model-only coverage for Queue properties, service defaults, case-insensitive metadata, and explicit message result values.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pin header-only Queue recording updates: add XML Accept on XML-response operations and retain generated application/xml Content-Type for XML request bodies. Preserve bodies, responses and default proxy matching.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow numofmessages through the established package-local CSpell dictionary pattern without changing generated names, global dictionaries or exclusions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🔵 Needs a closer look

The protocol replacement and accepted header removal require maintainer compatibility review, broader platform validation, and coordinated Storage Common release availability.

No open issues 🎉

What changed in this PR

Migrates Queue’s private protocol layer from AutoRest to TypeSpec, independently of the broader Storage migration in #7495. Handwritten adapters retain public model behavior, while removal of rest_client.hpp is an explicitly accepted source-breaking change.

Changes:

  • Adds private generated protocol types and adapters, plus a shared Storage Common exception-conversion helper.
  • Relocates public models and flags, updates includes and build registration, and removes legacy protocol code and Swagger configuration.
  • Adds model regression tests, updates Queue playback assets, and introduces a package-local spelling entry.
File Description
sdk/​storage/​azure-storage-queues/​test/​ut/​queue_models_test.cpp Tests model defaults, metadata, message results, and enums.
sdk/​storage/​azure-storage-queues/​test/​ut/​CMakeLists.txt Registers model tests.
sdk/​storage/​azure-storage-queues/​swagger/​README.md Removes legacy AutoRest configuration.
sdk/​storage/​azure-storage-queues/​src/​rest_client.cpp Removes the legacy protocol implementation.
sdk/​storage/​azure-storage-queues/​src/​queue_service_client.cpp Routes service operations through generated code and adapters.
sdk/​storage/​azure-storage-queues/​src/​queue_sas_builder.cpp Replaces the deleted header include.
sdk/​storage/​azure-storage-queues/​src/​queue_responses.cpp Defines relocated public replication-status constants.
sdk/​storage/​azure-storage-queues/​src/​queue_client.cpp Adapts queue and message operations to generated protocols.
sdk/​storage/​azure-storage-queues/​src/​private/​queue_model_conversions.hpp Converts between public and private generated models.
sdk/​storage/​azure-storage-queues/​src/​generated/​queues.cpp Defines private generated enumeration constants.
sdk/​storage/​azure-storage-queues/​src/​generated/​queues_models.hpp Adds private protocol models and response headers.
sdk/​storage/​azure-storage-queues/​src/​generated/​queues_client.hpp Declares the private generated client.
sdk/​storage/​azure-storage-queues/​src/​generated/​queues_client_options.hpp Defines generated client and operation options.
sdk/​storage/​azure-storage-queues/​inc/​azure/​storage/​queues/​rest_client.hpp Removes the installed legacy protocol header without a shim.
sdk/​storage/​azure-storage-queues/​inc/​azure/​storage/​queues/​queue_responses.hpp Houses public models formerly in the legacy header.
sdk/​storage/​azure-storage-queues/​inc/​azure/​storage/​queues/​queue_options.hpp Houses listing flags and preserves the default API version.
sdk/​storage/​azure-storage-queues/​inc/​azure/​storage/​queues/​queue_client.hpp Adds explicit Core includes previously supplied transitively.
sdk/​storage/​azure-storage-queues/​inc/​azure/​storage/​queues.hpp Removes the legacy header from the umbrella include.
sdk/​storage/​azure-storage-queues/​cspell.json Allows the Queue-specific numofmessages spelling.
sdk/​storage/​azure-storage-queues/​CMakeLists.txt Registers generated sources and removes legacy files.
sdk/​storage/​azure-storage-common/​inc/​azure/​storage/​common/​internal/​storage_protocol.hpp Adds shared protocol exception conversion.
sdk/​storage/​azure-storage-common/​CMakeLists.txt Registers the installed internal helper header.
sdk/​storage/​assets.json Pins recordings updated for Queue request headers.

Review effort: Balanced

Regenerate private documentation with the scoped emitter documentation fix: use safe Markdown links and omit an empty class brief. Document the four public list flags operators without changing declarations or runtime tokens.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Jinming-Hu

Copy link
Copy Markdown
Member Author

/azp run cpp - storage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Preserve the recordings added by #7483 and update Queue request headers for the TypeSpec protocol, including the newly enabled playback tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Jinming-Hu

Copy link
Copy Markdown
Member Author

/azp run cpp - storage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Jinming-Hu
JinmingHu (Jinming-Hu) merged commit 4967deb into main Oct 30, 2026
138 checks passed
@Jinming-Hu
JinmingHu (Jinming-Hu) deleted the jinming-hu-queue-typespec-migration branch October 30, 2026 00:27
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.

3 participants