Skip to content

Comments

[CHA-1578] refactor: code generated from openapi specs#71

Open
mogita wants to merge 30 commits intomainfrom
cha-1578_openapi-refactor-codegen
Open

[CHA-1578] refactor: code generated from openapi specs#71
mogita wants to merge 30 commits intomainfrom
cha-1578_openapi-refactor-codegen

Conversation

@mogita
Copy link

@mogita mogita commented Dec 16, 2025

Submit a pull request

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Copilot AI review requested due to automatic review settings December 16, 2025 07:08
@mogita mogita requested a review from tbarbugli as a code owner December 16, 2025 07:08
@mogita mogita had a problem deploying to feeds-enabled-shard December 16, 2025 07:08 — with GitHub Actions Failure
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR represents a comprehensive refactoring of the GetStream SDK, with code regenerated from refactored OpenAPI specifications. The changes primarily focus on improving type consistency, documentation, and API design across the feeds, chat, and video domains.

Key Changes

  • Type System Refactoring: Separation of request/response types with consistent naming patterns (e.g., *Request, *Response, *Payload suffixes)
  • Model Consolidation: Removal of duplicate or deprecated types (e.g., Channel, Message, User, Poll, Ban replaced with dedicated response types)
  • API Method Updates: Renamed batch operations methods (OwnCapabilitiesBatchOwnBatch) and added new delete operations
  • Enhanced Documentation: Added comprehensive comments to events, request types, and response types

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
requests.go Renamed request types with consistent *Request and *Payload suffixes; added new fields and types for batch operations
models.go Major refactoring: removed ~30 deprecated types, added ~50 new response types, enhanced event documentation, separated feeds/chat reaction types
feeds.go Minor change with an unprofessional comment that needs removal
feeds-v3.go Renamed OwnCapabilitiesBatch to OwnBatch, added DeleteFeedsBatch, updated DeleteFeedUserData endpoint from DELETE to POST
feeds_test.go Updated tests to match renamed methods and added new test for DeleteFeedsBatch
common_test.go Removed test skip statements for upload tests
chat_test.go Removed test skip statements for upload tests
chat.go Minor documentation update (duplicate event comment)
call.go Reformatted imports to use grouped style

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mogita mogita had a problem deploying to feeds-enabled-shard December 16, 2025 07:36 — with GitHub Actions Failure
@mogita mogita had a problem deploying to feeds-enabled-shard December 16, 2025 07:44 — with GitHub Actions Failure
@mogita mogita temporarily deployed to feeds-enabled-shard December 16, 2025 08:30 — with GitHub Actions Inactive
@mogita mogita temporarily deployed to feeds-enabled-shard January 11, 2026 15:38 — with GitHub Actions Inactive
@mogita mogita temporarily deployed to feeds-enabled-shard January 12, 2026 09:46 — with GitHub Actions Inactive
@mogita mogita force-pushed the cha-1578_openapi-refactor-codegen branch from 89c3330 to 05dad50 Compare February 13, 2026 11:06
@mogita mogita had a problem deploying to feeds-enabled-shard February 13, 2026 11:06 — with GitHub Actions Failure
@mogita mogita temporarily deployed to feeds-enabled-shard February 13, 2026 11:25 — with GitHub Actions Inactive
@mogita mogita changed the title refactor: code generated from refactored openapi specs [CHA-1578] refactor: code generated from openapi specs Feb 16, 2026
@mogita mogita had a problem deploying to feeds-enabled-shard February 17, 2026 13:03 — with GitHub Actions Failure
@mogita mogita had a problem deploying to feeds-enabled-shard February 17, 2026 13:06 — with GitHub Actions Failure
@mogita mogita temporarily deployed to feeds-enabled-shard February 17, 2026 13:15 — with GitHub Actions Inactive
Daksh and others added 6 commits February 19, 2026 12:49
- GetReplies: pass empty Sort slice to avoid nil→"null" serialization
- DeleteChannelType: sleep 6s + retry 5x (matching stream-chat-go)
- QueryThreads: filter by channel_cid, fix CreatedByUserID assertion
- UpdateApp: toggle EnforceUniqueUsernames instead of WebhookUrl
- CreateGuest: handle disabled guest access with early return

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…issions, export, and more

Tests cover: bans (global + channel), user mutes (with/without timeout),
channel mutes, flagging (v2 moderation API), roles/permissions CRUD,
channel export with async task, custom events, user restore after soft
delete, member partial update, pending messages, and message history.
All assertions match stream-chat-go test patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Messages need time to be indexed before they can be fetched in batch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mogita mogita temporarily deployed to feeds-enabled-shard February 19, 2026 14:45 — with GitHub Actions Inactive
Daksh and others added 2 commits February 23, 2026 10:02
Add comprehensive integration tests matching every implementable test from
stream-chat-go, covering channels, messages, users, polls, bans, mutes,
flags, permissions, threads, event hooks, delivery receipts, reminders,
live location, shadow bans, and more. Also documents 7 codegen gaps where
APIs exist in stream-chat-go but not in the generated SDK.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…te, and permission tests

- Regenerate all SDK files from chat backend with Ignore/Beta/ClientSideOnly
  flags removed (branch feature/cha-0-remove-openapi-ignore-flags)
- New SDK methods: ChannelBatchUpdate, CreateDraft, QueryDrafts, QueryFlagReports,
  FlagReportReview, QueryTeamUsageStats, CreatePermission
- Add TestChatDraftsIntegration (5 subtests: CRUD, thread, query, pagination)
- Add TestChatChannelBatchUpdateIntegration (3 subtests: AddMembers,
  RemoveMembers, Archive) matching stream-chat-go polling/verification pattern
- Add TestChatCreatePermissionIntegration (ListAndGetPermission passing,
  CreatePermission skipped due to codegen bug with path tag)
- Fix multipart upload for UploadChannelFile/Image requests
- Fix UndeleteMessageRequest usage after struct change (UndeletedBy field)
- Update CODEGEN_GAPS.md documenting remaining codegen bugs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Daksh and others added 14 commits February 23, 2026 11:32
Regenerate the full SDK from the backend spec that includes:
- CreatePermissionRequest now has `id` field (was missing due to
  path:"id" tag causing spec generator to drop it from body)
- FlagReportReview now takes `id` as path parameter (was missing
  because field was uuid.UUID without path:"id" tag)

Test changes:
- TestChatCreatePermissionIntegration: remove skip, add ID field,
  matches stream-chat-go TestPermissions_PermissionEndpoints
- TestChatQueryFlagReportsAndReviewIntegration: new test matching
  stream-chat-go TestClient_QueryFlagReportsAndReview

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ePermission

Regenerate SDK from updated backend spec:
- QueryFlagReports and FlagReportReview moved from ChatClient to
  ModerationClient (now at /api/v2/moderation/reports)
- FlagReportReview now takes id path parameter
- CreatePermission reverted (id field stays hidden from spec)

Test changes:
- TestChatQueryFlagReportsAndReviewIntegration: use
  client.Moderation().QueryFlagReports/FlagReportReview
- TestChatCreatePermissionIntegration: restore skip for CreateAndList,
  keep ListAndGetPermission passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…in spec)

Regenerate from backend with CreatePermission, QueryFlagReports, and
FlagReportReview restored to Ignore: true. These endpoints need
discussion with the moderation team before exposing.

Removes:
- TestChatQueryFlagReportsAndReviewIntegration (endpoints hidden)
- TestChatCreatePermissionIntegration (endpoint hidden)
- CreatePermission, QueryFlagReports, FlagReportReview from SDK

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tests

Regenerate from backend with CreateDraft restored to ClientSideOnly.

Removes:
- TestChatDraftsIntegration (CreateDraft is ClientSideOnly, not in
  server-side SDK)
- TestChatCreatePermissionIntegration (CreatePermission hidden from spec)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Skip device test when push providers not configured
- Retry DeleteUsers on rate limit (429) with exponential backoff
- Skip ChannelBatchUpdate tests when feature flag not enabled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use context.Background() for individual HTTP calls so the client's own
timeout governs each request. Poll up to 30 times with 1s sleep instead
of relying on a caller-provided deadline context that would kill in-flight
HTTP requests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
stream-chat-go uses synchronous DELETE /users/{id} which isn't
rate-limited. Our SDK only has the batch POST /users/delete endpoint
which is limited to ~6 calls/min. Increase retry to 10 attempts with
3s multiplied backoff to survive CI where many tests call DeleteUsers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Match the same 10 attempts / 3s multiplier pattern used in RestoreUsers
to handle CI rate limiting on the batch DeleteUsers endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract deleteUsersWithRetry helper and use it in all t.Cleanup
calls that invoke DeleteUsers. This prevents rate limit failures
when multiple test cleanups fire concurrently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers all subtests from stream-chat-go: valid responses with
no params/month/date range/pagination, input validation errors
(invalid month, wrong length, bad dates, over max limit), and
past month empty results. Skips gracefully on apps where the
endpoint isn't deployed yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers all subtests from stream-chat-go:
- Basic API tests (10 subtests): valid responses with no params/month/
  date range/pagination, input validation errors, past month empty.
  Skips gracefully on apps where the endpoint isn't deployed yet.
- Multi-tenant integration tests (9 subtests): verifies teams data,
  pagination with cursor, limit correctness, metric field access,
  non-negative totals. Requires STREAM_MULTI_TENANT_KEY/SECRET env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eam/getstream-go into cha-1578_openapi-refactor-codegen
@daksh-r daksh-r had a problem deploying to feeds-enabled-shard February 23, 2026 13:40 — with GitHub Actions Failure
The merge of match-chat-test-parity-codegen into this branch introduced
duplicate QueryPinnedActivities declarations (request, response, method)
from both sides adding the same generated code. Removed the duplicates
and ran go fmt + gofumpt to fix formatting across all generated files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@daksh-r daksh-r temporarily deployed to feeds-enabled-shard February 23, 2026 14:14 — with GitHub Actions Inactive
@mogita mogita temporarily deployed to feeds-enabled-shard February 23, 2026 16:01 — with GitHub Actions Inactive
@mogita mogita had a problem deploying to feeds-enabled-shard February 23, 2026 16:13 — with GitHub Actions Failure
@mogita mogita deployed to feeds-enabled-shard February 23, 2026 16:30 — with GitHub Actions Active
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.

2 participants