Skip to content

Match chat test parity codegen#219

Open
daksh-r wants to merge 15 commits intocha-1578_openapi-refactor-codegenfrom
match-chat-test-parity-codegen
Open

Match chat test parity codegen#219
daksh-r wants to merge 15 commits intocha-1578_openapi-refactor-codegenfrom
match-chat-test-parity-codegen

Conversation

@daksh-r
Copy link

@daksh-r daksh-r commented Mar 2, 2026

Note

Medium Risk
Medium risk due to CI workflow changes (new chat env vars, test suite split) and a small Feeds API surface change (query_comments adds id_around). Main risk is increased CI runtime/flakiness from extensive new end-to-end chat tests and reliance on separate credentials.

Overview
Adds a large end-to-end Chat test suite (channels, members, messages, drafts, moderation, polls, reminders/live locations, usage stats, users) plus new pytest fixtures for creating/cleaning up temporary users and channels.

Updates CI to inject separate STREAM_CHAT_* credentials and split pytest into non-video (run with chat creds and ignoring video paths) vs video tests.

Extends Feeds query_comments to support the id_around request field, updates the generated QueryCommentsRequest model accordingly, and tweaks an async export error event default type constant.

Written by Cursor Bugbot for commit ead8884. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Breaking Changes

    • v3 naming and type model changes (Request/Response suffixes), event renames, and cursor-based pagination.
  • New Features

    • Single SDK covering Chat, Feeds, Video, Moderation.
    • Webhooks: signature verification, event type extraction and parsing.
    • Video: start/stop recording with type, participant session metrics.
    • Feeds: pinned activities, friend-reactions options, restore actions.
    • User groups, reminders, live locations, team usage stats.
  • Documentation

    • Migration guide and 3.0.0b1 changelog added.
  • Tests

    • Extensive end-to-end test suites across chat, video, feeds, moderation, and webhooks.

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

Large v2→v3 migration: request/response payloads standardized to generated Request/.to_dict() and Response types; many new endpoints and optional parameters across Chat, Common, Feeds, Moderation, Video; new webhook module; expanded tests and CI/release workflow tweaks. Several method signatures extended or added.

Changes

Cohort / File(s) Summary
Release workflow
\.github/workflows/release.yml
Version extraction now derives VERSION from the first dist/getstream-*.tar.gz filename instead of invoking uvx -q hatch version.
Changelog & Migration docs
CHANGELOG.md, MIGRATION_v2_to_v3.md
Add v3.0.0b1 release notes and a detailed migration guide describing naming conventions, type suffix changes, and v2→v3 mapping.
Chat clients
getstream/chat/rest_client.py, getstream/chat/async_rest_client.py
Replaced ad‑hoc build_body_dict/build_query_param with Request model constructors + .to_dict(); renamed schedule_campaignstop_campaign; added query_future_channel_bans; expanded query_channels and many endpoints with new optional params (predefined_filter, filter_values, sort_values, push_level, skip_push); some return types adjusted.
Common clients
getstream/common/rest_client.py, getstream/common/async_rest_client.py
Migrated payload construction to Request models; added user‑group APIs and many user management endpoints; update_app accepts moderation_analytics_enabled; upsert_push_provider uses PushProviderRequest.
Feeds client & wrapper
getstream/feeds/rest_client.py, getstream/feeds/feeds.py
Standardized to Request models; added optional flags (copy_custom_to_notification, create_notification_activity, skip_push, include_expired_activities, visibility_tag, friend_reactions_options); added update_activities_partial_batch, restore_activity, query_pinned_activities; Feed.get_or_create accepts friend_reactions_options.
Moderation clients
getstream/moderation/rest_client.py, getstream/moderation/async_rest_client.py
Switched to Request/Payload DTOs for bodies; parameter types changed to Payload/Request variants; upsert_moderation_rule gains action_sequences and optional action; submit_action and related endpoints accept structured payloads and an added flag field.
Video clients & call wrappers
getstream/video/rest_client.py, getstream/video/async_rest_client.py, getstream/video/call.py, getstream/video/async_call.py
Added recording endpoints requiring recording_type (start/stop), participant session metrics and queries; SIP inbound paths refactored to inbound_trunks/inbound_routing_rules; migrated payloads to Request models; call wrappers forward new methods.
Video RTC & utils
getstream/video/rtc/coordinator/ws.py, getstream/video/rtc/track_util.py
WebSocket client type changed to ClientConnection with a post-connection assertion; refined AudioFormat.validate return typing using typing.cast.
Webhooks & utilities
getstream/webhook.py, getstream/utils/__init__.py
New webhook module with 100+ EVENT_TYPE_* constants, get_event_type, parse_webhook_event, and verify_webhook_signature; build_query_param improved to handle datetimes and lists via internal _serialize_query_value.
Tests & fixtures
tests/conftest.py, tests/test_*.py, tests/base.py
Extensive test additions/updates: new fixtures (random_user, random_users, server_user, channel) and many integration tests for chat (channels, messages, moderation, polls, reminders), users, feeds, moderation, video; test harness tweaks (task wait behavior) and video tests updated to call recordings with recording_type="composite".
CI test workflow
\.github/workflows/run_tests.yml
Test job split into non‑video and video steps; added STREAM_CHAT_API_KEY/SECRET/BASE_URL env vars and separate runs for video/non-video suites.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰 From dicts we hop to Request models bright,
Responses wear suffixes and types take flight,
Webhooks now listen, feeds and calls extend,
Tests bloom wide — new paths on every bend,
A v3 spring hops in, nimble through the night. 🌙

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.06% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Match chat test parity codegen' clearly summarizes the main change: aligning chat test coverage with code generation updates. It accurately reflects the primary objective of the PR.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch match-chat-test-parity-codegen

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 and usage tips.

Add comprehensive test coverage for chat functionality matching
the old stream-chat-python SDK. Includes tests for channels,
messages, moderation, users, misc operations, reminders/locations,
and team usage stats. Also updates codegen for team usage stats
endpoint and undelete message fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_add_moderators: check is_moderator is not True (API returns None, not False)
- test_mute_user/test_mute_with_timeout: use mutes[0] not mute (MuteResponse has mutes list)
- test_create_reminder: response is ReminderResponseData directly, not wrapped
- test_update_reminder: use response.data.reminder (UpdateReminderResponse wraps it)
- skip test_delete_message_for_me: delete_for_me needs body param not query param
- skip test_query_message_flags: V2 moderation.flag() doesn't populate chat-level flags

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GetChannelTypeResponse.commands returns List[Command] objects, but
update_channel_type expects List[str]. Extract .name from each command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add draft tests (create/get/delete/thread/query), enhance channel tests
(members $in query, filter tags, hide/show hidden filter, invite error
handling), enhance message tests (replies pagination, reactions offset),
and add user custom field filter+sort test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Free Tier Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

while True:
response = client.get_task(id=task_id)
if response.data.status == "completed":
if response.data.status in ("completed", "failed"):
Copy link

Choose a reason for hiding this comment

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

wait_for_task silently returns on task failure

Low Severity

wait_for_task now returns successfully when status is "failed", treating it the same as "completed". While current callers happen to assert status == "completed" afterward, any future caller that simply uses the return value without checking the status will silently accept a failed task. The function name and docstring imply it waits for successful completion, creating a subtle contract mismatch.

Fix in Cursor Fix in Web

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