Skip to content

chore: pass OpenAPI generator config via --opt flags - #1743

Merged
gpunto merged 4 commits into
developfrom
chore/openapi-generation-opt-flags
Jul 28, 2026
Merged

chore: pass OpenAPI generator config via --opt flags#1743
gpunto merged 4 commits into
developfrom
chore/openapi-generation-opt-flags

Conversation

@gpunto

@gpunto gpunto commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Part of AND-1306

Goal

The backend Kotlin OpenAPI generator was refactored so it takes its configuration through the generic --opt key=value flag (the Configurable interface master already uses for Swift) instead of a set of bespoke named flags. This keeps the shared chat generator command free of language-specific flags. This PR updates the video client generation script to match the new interface.

The chat-side generator changes are merged to GetStream/chat master (#14637), so this PR is unblocked. The script clones master (REFERENCE_VALUE=master).

Implementation

  • Convert the generate-client invocation to --opt key=value form.
  • The SDK selector is passed as --opt android-sdk=<video|feeds|chat> (kebab-case; the generator validates it).
  • Drop --model-dir: the generator hardcodes the models directory, so the flag was a no-op. Removed the flag, its MODEL_DIR variable, and its argument handling.
  • classes-to-skip is now space-separated — the --opt slice flag splits comma-separated values, so a comma list would be mangled.
  • Point REFERENCE_VALUE at master.

🎨 UI Changes

N/A — build/tooling script only.

Testing

Ran the full script end-to-end against current master: it clones master, builds chat-manager, generates the video spec, and generates the Kotlin client — exit 0, valid output (apis/ + models/ + infrastructure/). Output matches the previous generator for the same spec; this is a tooling/invocation change with no generator behavior change.

☑️Contributor Checklist

General

  • PR targets the develop branch
  • Assigned a person / code owner group
  • Thread with the PR link started in a respective Slack channel

Code & documentation

  • Script verified end-to-end against current master

@gpunto gpunto added the pr:internal Internal or infra-only changes label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.27 MB 12.27 MB 0.00 MB 🟢
stream-video-android-ui-xml 5.68 MB 5.68 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.20 MB 6.20 MB 0.00 MB 🟢

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has been inactive for 14 days. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions Bot added the Stale label Jul 27, 2026
@gpunto gpunto removed the Stale label Jul 28, 2026
@gpunto
gpunto marked this pull request as ready for review July 28, 2026 07:34
@gpunto
gpunto requested a review from a team as a code owner July 28, 2026 07:34
gpunto added 2 commits July 28, 2026 07:40
The chat-side Kotlin generator now takes its configuration through the generic
`--opt key=value` flag (via the Configurable interface) instead of bespoke named
flags. Update the generation script accordingly:

- Convert the generate-client invocation to `--opt key=value` form.
- Drop `--model-dir` (the generator hardcodes the models directory; the flag was
  a no-op) and its now-unused MODEL_DIR variable / argument.
- classes-to-skip is space-separated (the --opt slice flag splits comma lists).
- Point REFERENCE_VALUE at `master`, since the generator changes land there.

Generated output is unchanged (byte-identical vs the previous generator).
The backend generator's SDK option was renamed androidSdk -> android-sdk during
review before landing on master. Update the invocation to match, otherwise
generate-client fails with `kotlin: unknown option "androidSdk"`.
@gpunto
gpunto force-pushed the chore/openapi-generation-opt-flags branch from c16aff8 to c2f670e Compare July 28, 2026 07:40
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The OpenAPI generation script updates its defaults, removes model-directory CLI configuration, and changes client generator arguments to --opt key=value assignments with revised option names.

Changes

OpenAPI generation workflow

Layer / File(s) Summary
Generation defaults and argument parsing
generate_openapi_v2.sh
Updates default generation values, changes the classes-to-skip format, and removes support for the --model-dir= argument.
Client generation option wiring
generate_openapi_v2.sh
Passes client generation settings through --opt key=value arguments, updates option names, and stops forwarding model-dir.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: aleksandar-apostolov, andremion

Poem

A rabbit hops through scripts so neat,
With options lined in key=value feet.
“Master” guides the generator’s way,
While model-dir quietly fades away.
The client blooms from specs anew—
Hop, hop, generated just for you!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: passing OpenAPI generator config via --opt flags.
Description check ✅ Passed The description covers the required Goal, Implementation, UI Changes, and Testing sections, with only non-critical checklist/gif items missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 chore/openapi-generation-opt-flags

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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
Contributor

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 `@generate_openapi_v2.sh`:
- Around line 191-198: The generate_openapi_v2.sh option handling must remain
aligned with scripts/open-api-code-gen.gradle.kts: restore parsing and
forwarding of the model-dir argument, or remove the Gradle caller’s modelsDir
configuration and argument if model directories are intentionally retired.
Ensure configured model directories are neither silently ignored nor rejected
unexpectedly.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 855af949-c3bf-482d-bd59-1125a3b408cf

📥 Commits

Reviewing files that changed from the base of the PR and between 8fbaea4 and c16aff8.

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

Comment thread generate_openapi_v2.sh
gpunto added 2 commits July 28, 2026 08:33
generate_openapi_v2.sh no longer accepts --model-dir (the backend generator
hardcodes the models directory and never honored the flag), so the Gradle
caller passing it would fail with "Unknown argument". Remove the argument and
the now-unused modelsDir property.
The Gradle task's default refValue still pointed at the merged (now-deleted)
feature branch, so `generateOpenApiClient` would fail at `git clone --branch`.
Default to master, matching the script's own default and the intended source.
@sonarqubecloud

Copy link
Copy Markdown

@rahul-lohra rahul-lohra 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.

lgtm

@gpunto
gpunto merged commit 0600b65 into develop Jul 28, 2026
17 checks passed
@gpunto
gpunto deleted the chore/openapi-generation-opt-flags branch July 28, 2026 09:49
@stream-public-bot stream-public-bot added the released Included in a release label Aug 5, 2026
@stream-public-bot

Copy link
Copy Markdown
Collaborator

🚀 Available in v1.30.0

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

Labels

pr:internal Internal or infra-only changes released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants