Skip to content

ci(studio): add SDK gen check for OpenAPI spec changes (ASTD-218) - #245

Merged
marcusds merged 5 commits into
mainfrom
astd-218-add-studio-sdk-gen-ci-check-for-openapi-spec-changes/mschwab
Jun 10, 2026
Merged

ci(studio): add SDK gen check for OpenAPI spec changes (ASTD-218)#245
marcusds merged 5 commits into
mainfrom
astd-218-add-studio-sdk-gen-ci-check-for-openapi-spec-changes/mschwab

Conversation

@marcusds

@marcusds marcusds commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add web-sdk-gen CI job: force-regenerates the TypeScript SDK from all OpenAPI specs, then typechecks nemo-studio-ui against the result
  • Expand studio-ci.yaml trigger paths to include openapi/** and plugins/*/openapi/** so PRs that change OpenAPI specs outside web/ run Studio CI

Root cause

PR #66 broke main because 4 new add_job_routes() calls produced duplicate OpenAPI operationIds, generating duplicate TypeScript function names. studio-ci.yaml only triggered on web/** changes, so the Studio SDK failure was invisible until after merge. PR #219 was the 2-hour hotfix.

How this prevents recurrence

Any PR that changes plugins/*/openapi/** or openapi/** now triggers web-sdk-gen. The job fails if gen:all-force produces TypeScript that doesn't compile — catching duplicate operationIds, schema regressions, or any other OpenAPI change that breaks the Studio SDK.

Test plan

  • Verify web-sdk-gen job appears in CI on this PR
  • Confirm the job passes (current specs are clean)
  • Manually verify: introduce a duplicate operationId in a plugin OpenAPI spec, confirm web-sdk-gen fails

Fixes ASTD-218

Summary by CodeRabbit

  • Chores
    • CI now detects OpenAPI changes in plugin specifications and triggers relevant tasks.
    • CI added an automated workflow to regenerate and type-check the TypeScript SDK when API or web studio sources change; its result is included in overall CI status.
    • Pre-commit hook updated to validate the documentation file with the .mdx extension.

@marcusds
marcusds force-pushed the astd-218-add-studio-sdk-gen-ci-check-for-openapi-spec-changes/mschwab branch from d867dfa to 571be49 Compare June 9, 2026 21:35
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 19027/25079 75.9% 62.4%
Integration Tests 12035/23851 50.5% 25.7%

@marcusds
marcusds marked this pull request as ready for review June 9, 2026 21:41
@marcusds
marcusds requested review from a team as code owners June 9, 2026 21:42
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1906a0df-bfce-4994-99d1-bf037f8987ef

📥 Commits

Reviewing files that changed from the base of the PR and between 8ac4cb1 and eeb2c21.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yaml

📝 Walkthrough

Walkthrough

CI change detection now treats plugins/*/openapi/** as OpenAPI changes; a new web-sdk-gen job regenerates and typechecks @nemo/sdk when relevant paths change; a pre-commit hook is updated to reference docs/set-up/config-reference.mdx.

Changes

SDK Generation CI and Documentation Tooling

Layer / File(s) Summary
OpenAPI detection expansion and SDK generation CI job
.github/actions/changes/action.yaml, .github/workflows/ci.yaml
OpenAPI path filter extends to plugins/*/openapi/**. New web-sdk-gen job runs on workflow_dispatch or when OpenAPI/web-studio path changes to install web deps, run gen:all-force for @nemo/sdk, and typecheck the generated SDK. web-sdk-gen is added to ci-status needs.
Pre-commit hook documentation path alignment
.pre-commit-config.yaml
config-reference-docs hook updates both its files: glob and git diff --exit-code target from docs/set-up/config-reference.mddocs/set-up/config-reference.mdx.

Possibly related PRs

Suggested reviewers

  • mckornfield
  • svvarom
  • philipmattingly
🚥 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 Title directly describes the main change: adding an SDK generation CI check for OpenAPI spec changes, with an issue reference.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astd-218-add-studio-sdk-gen-ci-check-for-openapi-spec-changes/mschwab

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

@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: 2

🤖 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 @.github/workflows/studio-ci.yaml:
- Around line 118-137: For the web-sdk-gen job, harden the GitHub Actions usage
by pinning external actions and tightening permissions: replace uses:
actions/checkout@v6 and uses: actions/setup-node@v4 with fixed commit SHAs (pin
to specific tags/SHAs), add persist-credentials: false to the actions/checkout
step to avoid leaking GITHUB_TOKEN, and add a minimal job-level permissions
block (e.g., permissions: contents: read) to enforce least privilege for this
job; update the Install pnpm and other steps only if they reference action
versions so they are pinned as well. Ensure the referenced steps are the ones
named in the job (web-sdk-gen -> actions/checkout, actions/setup-node, Install
pnpm via corepack) so reviewers can locate the changes.

In `@web/packages/sdk/package.json`:
- Around line 28-29: Add a new CI-safe npm script named "test:ci" in
package.json so the SDK is run by the top-level web-test task; mirror the
existing "test" script but run Vitest in non-watch/CI mode (for example use the
same command as "test" with CI flags like --run, --coverage or --silent as your
CI prefers). Edit the package.json scripts block that currently contains "test"
and "typecheck" and add "test:ci" alongside them (referencing the "test" script
for the command shape) so web-test's --if-present invocation will include
`@nemo/sdk` in CI. Ensure the new script does not use watch mode and produces exit
codes/coverage compatible with CI.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c49e3d21-655f-4a22-88e4-f48af6c1e475

📥 Commits

Reviewing files that changed from the base of the PR and between fb08b43 and b73204c.

📒 Files selected for processing (3)
  • .github/workflows/studio-ci.yaml
  • web/packages/sdk/package.json
  • web/packages/sdk/tsconfig.json

Comment thread .github/workflows/studio-ci.yaml Outdated
Comment thread web/packages/sdk/package.json
marcusds added 4 commits June 10, 2026 10:10
Add web-sdk-gen CI job that force-regenerates the TypeScript SDK from all
OpenAPI specs and typechecks nemo-studio-ui against the result. Expand
studio-ci.yaml trigger paths to include openapi/** and plugins/*/openapi/**
so PRs that touch only OpenAPI specs (Python service PRs, plugin PRs) run
Studio CI.

Root cause: PR #66 broke main because new add_job_routes() calls produced
duplicate operationIds, generating duplicate TS function names. studio-ci.yaml
only triggered on web/** changes so the failure wasn't caught before merge.

Signed-off-by: mschwab <mschwab@nvidia.com>
Add tsconfig.json + typecheck script to @nemo/sdk so CI typechecks the
generated TypeScript files directly after gen:all-force, rather than
relying on nemo-studio-ui's transitive dependency resolution (which has
skipLibCheck:true and no guaranteed path through @nemo/sdk source).

This makes the web-sdk-gen check definitive: duplicate operationIds that
produce duplicate TS function names now fail at the SDK typecheck step.

Signed-off-by: mschwab <mschwab@nvidia.com>
nemo-studio-ui typecheck has pre-existing failures from evaluator/safe-
synthesizer SDK API renames unrelated to this change. @nemo/sdk typecheck
alone is sufficient to catch the duplicate operationId issue.

Signed-off-by: mschwab <mschwab@nvidia.com>
@marcusds
marcusds force-pushed the astd-218-add-studio-sdk-gen-ci-check-for-openapi-spec-changes/mschwab branch from 1c2bd61 to 8ac4cb1 Compare June 10, 2026 17:20

@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 @.github/workflows/ci.yaml:
- Around line 507-534: The ci job graph is missing the web-sdk-gen dependency so
failures in the Web SDK generation won't block merges; update the ci-status
job's needs array to include the web-sdk-gen job name (referencing the existing
job identifier "web-sdk-gen") ensuring ci-status depends on it, so CI
status/branch protection reflects SDK generation errors.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 37e2918e-28bf-4f10-a7e3-7122c7524233

📥 Commits

Reviewing files that changed from the base of the PR and between b73204c and 8ac4cb1.

📒 Files selected for processing (3)
  • .github/actions/changes/action.yaml
  • .github/workflows/ci.yaml
  • .pre-commit-config.yaml

Comment thread .github/workflows/ci.yaml
Signed-off-by: mschwab <mschwab@nvidia.com>
@marcusds
marcusds enabled auto-merge June 10, 2026 17:28

@crookedstorm crookedstorm 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

@marcusds
marcusds added this pull request to the merge queue Jun 10, 2026
Merged via the queue into main with commit c312237 Jun 10, 2026
41 checks passed
@crookedstorm
crookedstorm deleted the astd-218-add-studio-sdk-gen-ci-check-for-openapi-spec-changes/mschwab branch June 24, 2026 20:24
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.

3 participants