Skip to content

feat!: add GetChannel endpoint#271

Merged
mogita merged 1 commit into
mainfrom
feat/cha-3741-add-getchannel-endpoint
Jul 15, 2026
Merged

feat!: add GetChannel endpoint#271
mogita merged 1 commit into
mainfrom
feat/cha-3741-add-getchannel-endpoint

Conversation

@mogita

@mogita mogita commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Regenerates the SDK from the current API spec. Adds the read-only GetChannel endpoint:

  • client.chat.get_channel(type, id, state=..., messages_limit=..., members_limit=..., watchers_limit=...) fetches a channel by CID without creating it (404 if it does not exist). Returns ChannelStateResponse. Sync and async variants, plus a channel.get_channel(...) wrapper.

Breaking changes

Regeneration also syncs accumulated spec drift. Two ModerationSettings fields are removed because they are no longer in the API spec:

  • analyze_max_image_size_bytes
  • webhook_header_client_request_id_key

These had no server-side binding and were non-functional, so removing them has no runtime impact, but it is source-breaking for code referencing them. Warrants a major version bump at release.

Test plan

  • import getstream OK; ruff check/ruff format clean.
  • Non-integration tests: +2 passing (the new get_channel tests), no new failures vs base (pre-existing local-only failures are env/CI-dependent).
  • Integration tests run in CI.

Summary by CodeRabbit

  • New Features
    • Added channel retrieval (get) with optional state and limits for messages, members, and watchers.
    • Added feeds APIs for batch reaction queries, activity share queries, and batch comment reaction queries.
    • Added reaction targeting (target_feeds) and new translation endpoints for activities and comments.
    • Added moderation queue management (list, create, retrieve, update, delete).
    • Added support for review-queue export webhook event types.
  • Enhancements
    • Added feed_audit_logs_enabled to app updates.
    • Added language and translate_text options to multiple feeds/comment retrieval methods.
    • Added ai_audio_config to moderation config upserts.
  • Tests
    • Added webhook parsing coverage for review-queue export events.

Update (CHA-3386): Regenerated against current chat master. This PR now also renames the shadowed moderation CallResponse schema to ModerationCallResponse (video CallResponse unchanged) — an additional intentional breaking change.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds chat channel retrieval, feed reactions, shares, translations, moderation queue management, expanded configuration and response models, and review-queue export webhook parsing for synchronous and asynchronous clients.

Changes

Chat channel retrieval

Layer / File(s) Summary
Channel retrieval flow
getstream/chat/channel.py, getstream/chat/async_channel.py, getstream/chat/rest_client.py, getstream/chat/async_rest_client.py
Adds synchronous and asynchronous channel retrieval methods with optional state and limit query parameters.

Feed reactions, shares, and translations

Layer / File(s) Summary
Feed contracts and endpoint wiring
getstream/models/__init__.py, getstream/feeds/rest_client.py, getstream/feeds/feeds.py
Adds reaction queries, activity shares, translation endpoints, target-feed reaction fields, and language/translation query propagation across feed and comment retrieval methods.

Configuration and moderation

Layer / File(s) Summary
Configuration and moderation schemas
getstream/models/__init__.py, getstream/common/*rest_client.py, getstream/moderation/*rest_client.py
Adds AI audio, audit-log, OCR, moderation payload, permission, dashboard, rule, and settings fields, including request forwarding for application and moderation configuration.
Moderation queue management
getstream/moderation/*rest_client.py, getstream/models/__init__.py
Adds queue request/response models and list, create, get, update, and delete client methods.
Review-queue export events
getstream/webhook.py, getstream/models/__init__.py, getstream/tests/test_webhook.py
Adds review-queue export event models, discriminator constants, parser mappings, and conformance tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ModerationRestClient
  participant ModerationQueueAPI
  Client->>ModerationRestClient: create_queue(name, type, filters)
  ModerationRestClient->>ModerationQueueAPI: POST /moderation/queues
  ModerationQueueAPI-->>ModerationRestClient: QueueResponse
  ModerationRestClient-->>Client: StreamResponse
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.17% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the new GetChannel endpoint added in the SDK.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cha-3741-add-getchannel-endpoint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@getstream/chat/async_channel.py`:
- Around line 34-52: Expose the promised get_channel API on both Channel
wrappers: rename or alias the async Channel.get method in
getstream/chat/async_channel.py lines 34-52 and the sync Channel.get method in
getstream/chat/channel.py lines 34-52 as get_channel, while preserving existing
get compatibility if needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7e79265-4d27-4eae-95ef-4c03c1827bc5

📥 Commits

Reviewing files that changed from the base of the PR and between f552d7e and 7892480.

📒 Files selected for processing (12)
  • getstream/chat/async_channel.py
  • getstream/chat/async_rest_client.py
  • getstream/chat/channel.py
  • getstream/chat/rest_client.py
  • getstream/common/async_rest_client.py
  • getstream/common/rest_client.py
  • getstream/feeds/rest_client.py
  • getstream/models/__init__.py
  • getstream/moderation/async_rest_client.py
  • getstream/moderation/rest_client.py
  • getstream/tests/test_webhook.py
  • getstream/webhook.py

Comment on lines +34 to +52
@attach_channel_cid_async
async def get(
self,
state: Optional[bool] = None,
messages_limit: Optional[int] = None,
members_limit: Optional[int] = None,
watchers_limit: Optional[int] = None,
) -> StreamResponse[ChannelStateResponse]:
response = await self.client.get_channel(
type=self.channel_type,
id=self.channel_id,
state=state,
messages_limit=messages_limit,
members_limit=members_limit,
watchers_limit=watchers_limit,
)
self._sync_from_response(response.data)
return response

@coderabbitai coderabbitai Bot Jul 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Align both channel wrappers with the promised get_channel API.

The REST clients correctly expose get_channel, but both public Channel wrappers are named get, so channel.get_channel(...) is unavailable.

  • getstream/chat/async_channel.py#L34-L52: rename the async get method to get_channel, or add a compatibility alias.
  • getstream/chat/channel.py#L34-L52: rename the sync get method to get_channel, or add a compatibility alias.
📍 Affects 2 files
  • getstream/chat/async_channel.py#L34-L52 (this comment)
  • getstream/chat/channel.py#L34-L52
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getstream/chat/async_channel.py` around lines 34 - 52, Expose the promised
get_channel API on both Channel wrappers: rename or alias the async Channel.get
method in getstream/chat/async_channel.py lines 34-52 and the sync Channel.get
method in getstream/chat/channel.py lines 34-52 as get_channel, while preserving
existing get compatibility if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • The REST client correctly has get_channel (client.chat.get_channel(type, id, …)) — that's the endpoint method.
  • The bound Channel wrapper is get() by design — the channel's type/id are already bound to the object, so you don't repeat "channel". This matches go's channel.Get() wrapper, and it's exactly what CHA-3741 proposed ("likely channel.get(options)"). Renaming it to get_channel would be redundant (channel.get_channel()) and inconsistent with the other SDKs.
  • It's generated code anyway — if the team ever wanted a different wrapper name, that's a template decision, not a py hand-edit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@mogita Fair points, and looking at the existing wrapper methods in this same file (delete, update, hide, truncate, etc.) that also use unqualified verbs since the type/id are already bound to the instance, get() is indeed consistent with the established convention here. Thanks for the context on the Go SDK parity and CHA-3741 — withdrawing this one.

Regenerate from chat at the CHA-3386 commit. Adds the read-only get_channel
endpoint (sync and async) and renames the shadowed moderation CallResponse to
ModerationCallResponse.

BREAKING CHANGE: renames moderation CallResponse to ModerationCallResponse (video CallResponse keeps its name); drops non-functional internal ModerationSettings fields no longer in the spec.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
getstream/common/async_rest_client.py (1)

52-68: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Avoid inserting new optional parameters into the middle of the public signature.

Because update_app accepts positional arguments, existing callers that pass arguments after enforce_unique_usernames or reminders_max_members will now bind values to different parameters. Append new parameters at the end of the signature, or explicitly treat this as a breaking API change and update the major-version plan. Apply the same compatibility decision to getstream/common/rest_client.py.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getstream/common/async_rest_client.py` around lines 52 - 68, Preserve
positional compatibility in update_app by moving the newly added optional
parameters out of the middle of its public signature and appending them after
all existing parameters. Apply the same parameter-ordering change to the
corresponding update_app signature in rest_client.py, keeping existing arguments
bound exactly as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@getstream/common/async_rest_client.py`:
- Around line 52-68: Preserve positional compatibility in update_app by moving
the newly added optional parameters out of the middle of its public signature
and appending them after all existing parameters. Apply the same
parameter-ordering change to the corresponding update_app signature in
rest_client.py, keeping existing arguments bound exactly as before.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 571d7a83-1023-4294-99bf-a4647b54d144

📥 Commits

Reviewing files that changed from the base of the PR and between 35b3720 and 62fb98d.

📒 Files selected for processing (13)
  • getstream/chat/async_channel.py
  • getstream/chat/async_rest_client.py
  • getstream/chat/channel.py
  • getstream/chat/rest_client.py
  • getstream/common/async_rest_client.py
  • getstream/common/rest_client.py
  • getstream/feeds/feeds.py
  • getstream/feeds/rest_client.py
  • getstream/models/__init__.py
  • getstream/moderation/async_rest_client.py
  • getstream/moderation/rest_client.py
  • getstream/tests/test_webhook.py
  • getstream/webhook.py
🚧 Files skipped from review as they are similar to previous changes (10)
  • getstream/tests/test_webhook.py
  • getstream/feeds/feeds.py
  • getstream/chat/rest_client.py
  • getstream/webhook.py
  • getstream/chat/async_channel.py
  • getstream/moderation/async_rest_client.py
  • getstream/chat/async_rest_client.py
  • getstream/common/rest_client.py
  • getstream/moderation/rest_client.py
  • getstream/models/init.py

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.

1 participant