Skip to content

chore: build the generator from chat's tools/openapi - #297

Merged
Acconut merged 1 commit into
mainfrom
chore/cha-5625-build-openapi
Sep 28, 2026
Merged

Acconut merged 1 commit into
mainfrom
chore/cha-5625-build-openapi

Conversation

@Acconut

@Acconut Acconut commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Ticket

CHA-5625

Summary

GetStream/chat#17426 moved the OpenAPI generator out of chat-manager into its own module, tools/openapi. generate.sh now builds it with make -C tools/openapi build and calls ./build/openapi generate-client and ./build/openapi generate-webhook-fixtures instead of ./build/chat-manager openapi .... The subcommands and flags are unchanged. chat-manager openapi is only a compatibility path and will be removed in CHA-5626. make openapi stays for now because it still generates the specs. A follow-up switches it to the new tool too, and after that it no longer builds ./build/chat-manager.

Verification

Both scripts ran end to end, including ruff check --fix and ruff format, against the same chat commit (75d154f053, latest master). make openapi generated releases/v2/serverside-api.yaml each time, and both runs got the same file (sha256 831a2dfa…c7267):

  1. I ran the new generate.sh under bash -x. build/openapi did not exist before this run. The trace shows make -C tools/openapi build creating it, then ./build/openapi generate-client --language python ... and ./build/openapi generate-webhook-fixtures ... --time-format=unix-ns running. I copied every file the run changed: 14 files, all modified.
  2. I reset the working tree and ran the original generate.sh, which uses ./build/chat-manager openapi .... It changed the same 14 files.
  3. I compared the two runs file by file with cmp. All 14 files are byte-identical.

make openapi does not produce exactly the same spec every time. This is a separate problem in chat: AsyncExportErrorEvent is registered under several event types, and its type default switches between them from one run to the next. So I also ran a check against one fixed spec. I ran the raw generate-client --language python and generate-webhook-fixtures --time-format=unix-ns commands on a frozen copy of the spec into two clean worktrees, once with ./build/chat-manager openapi and once with ./build/openapi. Both changed the same 17 paths before ruff, and diff -rq found no differences.

A note on running this locally: with uv 0.9.9, a plain uv run re-resolves uv.lock (it rewrites the exclude-newer-span options block and upgrades packages) and installs ruff 0.16.9. That ruff version fails ruff check with 256 errors on existing code, so set -e stops the script before ruff format. That happens with the original script too. I ran both scripts with UV_FROZEN=1 so they used the locked ruff 0.15.5, which passes on master. A newer uv is probably fine.

I then reverted the regenerated output. This PR contains only the generate.sh change. Regenerating shows unrelated spec drift, which is not part of this PR.

Summary by CodeRabbit

  • Chores
    • OpenAPI client and webhook fixture generation now use a dedicated OpenAPI build tool. Generated fixture locations and timestamp formatting remain unchanged; no end-user behavior changes are noted.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: dcb6751d-8fa2-41fe-9b48-8a8493de659f

📥 Commits

Reviewing files that changed from the base of the PR and between 13320db and 07ce80c.

📒 Files selected for processing (1)
  • generate.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The generation script now builds tools/openapi and invokes ./build/openapi for client generation and webhook fixture generation. The webhook fixture output path and time format remain unchanged.

Changes

OpenAPI Generation

Layer / File(s) Summary
Switch generation commands to the OpenAPI tool
generate.sh
Client generation builds tools/openapi and invokes ./build/openapi. Webhook fixture generation invokes ./build/openapi; its output path and unix-ns time format remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 07ce8

The change redirects OpenAPI generation to a dedicated tool. No concrete generation failure or downstream impact is established by the available evidence, so no specific merge-blocking risk is supported.

Architecture Summary

Architecture risk: 🔵 Low · up to 07ce8

The change affects 1 system.

Changed systems: generate.sh

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — generate.sh (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in generate.sh: Client generation now builds tools/openapi and uses ./build/openapi instead of ./build/chat-manager. Webhook fixture generation likewise switches from ./build/chat-manager openapi to ./build/openapi; its output path and time format are unchanged.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: build and use the OpenAPI generator from chat's tools/openapi module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@Acconut
Acconut marked this pull request as ready for review September 28, 2026 09:47
@Acconut
Acconut merged commit 95152c2 into main Sep 28, 2026
20 checks passed
@Acconut
Acconut deleted the chore/cha-5625-build-openapi branch September 28, 2026 11:09
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