Skip to content

Add Web PubSub Chat topics, collections and lifecycle request models - #49450

Open
yzt (Y-Sindo) wants to merge 23 commits into
Azure:mainfrom
Y-Sindo:chatserviceclient
Open

yzt (Y-Sindo) wants to merge 23 commits into
Azure:mainfrom
Y-Sindo:chatserviceclient

Conversation

@Y-Sindo

@Y-Sindo yzt (Y-Sindo) commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

Update azure-messaging-webpubsubchatservice to 2026-08-01-preview, adding topic lifecycle APIs and room, user, and user-room collection APIs.

Compared with the previous preview (1.0.0b1), request models are now split by HTTP method instead of reusing resource response models:. See APIView Diff against previous preview.

  • PUT: dedicated Chat*CreateOrReplace models exclude service-assigned fields. ChatTopicCreateOrReplace requires title and accepts optional state for replacement.
  • PATCH: ChatMessageUpdate and ChatTopicUpdate have optional fields for partial updates.
  • Responses: existing resource model names remain unchanged.

Why: generated shared models do not consistently reflect lifecycle visibility and PATCH requiredness. For example, the shared ChatTopic constructor requires both title and state, preventing typed title-only creation or state-only updates. See Azure/typespec-azure#5721.

This intentionally changes request input types from the previous preview; the customization lives in TypeSpec rather than handwritten generated Python code.

TypeSpec changes: Azure/azure-rest-api-specs#46545 (new APIs) and Azure/azure-rest-api-specs#47311 (lifecycle request models).

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Y-Sindo
yzt (Y-Sindo) marked this pull request as ready for review October 9, 2026 05:17
Copilot AI balanced review requested due to automatic review settings October 9, 2026 05:17
@azure-pipelines

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

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.

🟡 Changes recommended

Default-version rollout, paging and model contracts, documentation, and package-version metadata have unresolved issues.

5 open findings
What changed in this PR

Updates the Web PubSub Chat SDK to the 2026-08-01-preview API, adding topic lifecycle and collection operations.

Changes:

  • Adds sync/async topic and paged collection APIs with models and validation.
  • Adds unit, live, generated tests, and samples.
  • Refreshes README, APIView, recordings, and generation metadata.

Paths below are relative to sdk/webpubsub/azure-messaging-webpubsubchatservice/.

File Description
tsp-location.yaml Updates the TypeSpec source commit.
tests/​testcase.py Allows client configuration overrides.
tests/​test_topics.py Tests topic lifecycle and paging.
tests/​test_topics_live.py Adds synchronous live scenarios.
tests/​test_topics_live_async.py Adds asynchronous live scenarios.
tests/​test_client.py Covers new collections and API version.
samples/​sample_roles_and_permissions.py Simplifies the synchronous role sample.
samples/​sample_roles_and_permissions_async.py Simplifies the asynchronous role sample.
samples/​sample_readme_snippets.py Supplies README snippet sources.
samples/​sample_message_history.py Removes the standalone sync sample.
samples/​sample_message_history_async.py Removes the standalone async sample.
samples/​sample_logging.py Adds a logging sample.
samples/​sample_errors.py Adds error-handling guidance.
samples/​sample_client_access.py Narrows the documented snippet.
samples/​sample_client_access_async.py Adds an async snippet region.
README.md Documents topics, collections, and samples.
pyproject.toml Updates package-discovery exclusions.
generated_tests/​test_web_pub_sub_chat_service.py Adds generated sync operation tests.
generated_tests/​test_web_pub_sub_chat_service_async.py Adds generated async operation tests.
generated_samples/​update_topic.py Adds a topic-update sample.
generated_samples/​update_message.py Refreshes example provenance.
generated_samples/​list_users.py Adds a user-list sample.
generated_samples/​list_topics.py Adds a topic-list sample.
generated_samples/​list_rooms.py Adds a room-list sample.
generated_samples/​list_rooms_for_user.py Adds a user-room sample.
generated_samples/​list_room_members.py Refreshes example provenance.
generated_samples/​list_roles.py Refreshes example provenance.
generated_samples/​list_messages.py Refreshes example provenance.
generated_samples/​get_user.py Refreshes example provenance.
generated_samples/​get_topic.py Adds a topic-get sample.
generated_samples/​get_room.py Refreshes example provenance.
generated_samples/​get_role.py Refreshes example provenance.
generated_samples/​get_conversation.py Refreshes example provenance.
generated_samples/​delete_user.py Refreshes example provenance.
generated_samples/​delete_topic.py Adds a topic-delete sample.
generated_samples/​delete_room.py Refreshes example provenance.
generated_samples/​delete_room_member.py Refreshes example provenance.
generated_samples/​delete_role.py Refreshes example provenance.
generated_samples/​delete_message.py Refreshes example provenance.
generated_samples/​create_or_replace_user.py Refreshes example provenance.
generated_samples/​create_or_replace_topic.py Adds a topic-create sample.
generated_samples/​create_or_replace_room.py Refreshes example provenance.
generated_samples/​create_or_replace_room_member.py Refreshes example provenance.
generated_samples/​create_or_replace_role.py Refreshes example provenance.
azure/​messaging/​webpubsubchatservice/​types.py Adds the topic dictionary type.
azure/​messaging/​webpubsubchatservice/​models/​_models.py Adds topic and user-room models.
azure/​messaging/​webpubsubchatservice/​models/​_enums.py Adds topic lifecycle states.
azure/​messaging/​webpubsubchatservice/​models/​__init__.py Exports the new models and enum.
azure/​messaging/​webpubsubchatservice/​_operations/​_operations.py Adds generated synchronous operations.
azure/​messaging/​webpubsubchatservice/​aio/​_operations/​_operations.py Adds generated asynchronous operations.
azure/​messaging/​webpubsubchatservice/​aio/​_configuration.py Changes the async default API version.
azure/​messaging/​webpubsubchatservice/​aio/​_client.py Updates async API-version documentation.
azure/​messaging/​webpubsubchatservice/​_validation.py Adds API-version availability checks.
azure/​messaging/​webpubsubchatservice/​_configuration.py Changes the sync default API version.
azure/​messaging/​webpubsubchatservice/​_client.py Updates sync API-version documentation.
assets.json Updates test recording assets.
apiview-properties.json Maps the new public APIs.
api.metadata.yml Refreshes API snapshot metadata.
api.md Updates the public API snapshot.
_metadata.json Records the new generated API version.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 9, 2026 05:44

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.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:08

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.

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.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 10:18

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 default API version remains region-dependent, and the PR also introduces repository policy outside the canonical guidance file.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Avoid duplicating repository policy in the adapter

.github/​copilot-instructions.md:26

This introduces repository-wide policy in a file that AGENTS.md:3-5,21 defines as a thin adapter to the canonical guidance. Keeping policy here creates a second source of truth that can drift; move this rule to AGENTS.md or the appropriate linked skill and leave this adapter unchanged.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 15, 2026 01:20
@Y-Sindo yzt (Y-Sindo) changed the title Add Web PubSub Chat topics and collection APIs Add Web PubSub Chat topics, collections and lifecycle request models Oct 15, 2026

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.

🟡 Changes recommended

Package discovery can include previous build output, producing duplicate or stale SDK artifacts on subsequent builds.

1 open finding

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 15, 2026 01:39
Copilot AI balanced review requested due to automatic review settings November 6, 2026 08: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.

🔵 Needs a closer look

The default API-version change affects all Chat operations, but routing succeeded only in Central US EUAP and failed in East US 2 EUAP, requiring human confirmation of regional rollout and release readiness.

No open issues 🎉

Review effort: Balanced

yzt (Y-Sindo) and others added 21 commits November 11, 2026 20:12
Report missing live configuration without failing the samples runner, and cover exit status and setup guidance in subprocess regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the default API version for all inherited and new Chat test operations, refresh the published recordings, and clean up WebSocket-created access users. Document the default service API-version change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate from Python-only TypeSpec customization, preserving resource responses and wire behavior. Update samples, API documentation, and sync/async request-shape coverage. Pin the published specs fork commit for reproducible generation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Lint individual test files, including nested helpers, without assuming tests is a regular package. Add regression coverage and clean test imports, empty collection assertions, and unused test arguments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain build output exclusions and prevent local TypeSpec caches or stale wheel artifacts from being discovered as Python packages. Verified two successive wheel builds contain exactly the 27 SDK Python files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Let Pylint recursively discover namespace-directory tests inside its child process instead of expanding every file path into the command line. Cover nested helpers, empty directories, and a 620-file test tree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore engineering test-discovery behavior and its tests to the PR baseline. Keep the Web PubSub Chat SDK changes scoped to this package; the general tooling issue requires a separate PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generate ChatTopicCreateOrReplace from the pinned Python TypeSpec customization, update samples and API artifacts, and cover lifecycle request typing and partial updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document model and dictionary request bodies, automatic user discriminators, and all operation samples. Correct conversation terminology and remove stale Pylint discovery guarantees.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate role, room, membership and user request models with CreateOrReplace names matching their operations. Update docs, samples and tests, and cover sync/async model and TypedDict signatures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pair all 25 generated operation examples with runnable model-based samples and regression coverage. Simplify the README, regenerate the corrected topic example, and fix documentation links and spelling checks without engineering-tool changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate from CreateOrUpdate projections and keep topic state optional on the combined request. Restore the original JSON example and test lifecycle visibility, requiredness, and sync/async model and dictionary serialization rather than fixed API field snapshots.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Recommend model-based usage in the package README and describe all three input styles in the sample guide. Remove duplicate bodyless operation examples and their environment-variable runner, add a three-style comparison, and retain focused sample and lifecycle tests. Clarify runtime versus static tests and strip generated API whitespace without changing its normalized content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate sync and async listing methods from TypeSpec customizations while preserving next-link paging and by_page resume support. Update API snapshots and paging regression tests, and pin the rebased specification including its shared customization module rename.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate from the published TypeSpec configuration, preserve resource-specific request parameters and room_id, and replace standalone generated samples with validated handwritten examples.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fix Verify Links failures by following repository absolute-link guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Regenerate from the latest published TypeSpec customization revision and refresh APIView source mappings. Python SDK code and tests are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Y-Sindo yzt (Y-Sindo) added the auto-release When merged to main, release pipelines for this PR's changed packages trigger automatically. label Nov 13, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-release When merged to main, release pipelines for this PR's changed packages trigger automatically. WebPubSub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants