-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add Stainless CI for SDK codegen #1450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Greptile SummaryAdded GitHub Actions workflow to automate SDK codegen via Stainless CI. The workflow runs preview builds on PR updates and merge builds when PRs are merged, using OIDC authentication via the Stainless GitHub App.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant GH as GitHub PR
participant Preview as Preview Job
participant Merge as Merge Job
participant Stainless as Stainless API
participant SDK as SDK Repos
Dev->>GH: Opens/updates PR with OpenAPI changes
GH->>Preview: Triggers preview job
Preview->>Preview: Validates STAINLESS_ORG & STAINLESS_PROJECT vars
Preview->>Preview: Checks OpenAPI file exists
Preview->>Stainless: Uploads OpenAPI spec (OIDC auth)
Stainless->>Preview: Returns preview build status
Preview->>GH: Posts preview comment on PR
Dev->>GH: Merges PR
GH->>Merge: Triggers merge job
Merge->>Merge: Validates STAINLESS_ORG & STAINLESS_PROJECT vars
Merge->>Merge: Checks OpenAPI file exists
Merge->>Stainless: Uploads OpenAPI spec (OIDC auth)
Stainless->>SDK: Updates all client SDKs
Merge->>GH: Posts merge status
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant GHA as GitHub Actions
participant Stainless as Stainless API
Note over Dev,Stainless: NEW: Stainless CI Workflow
alt PR Opened / Updated (Preview Flow)
Dev->>GHA: Push changes to openapi.v3.yaml
GHA->>GHA: NEW: Validate Config (ORG, PROJECT vars)
alt Config Missing / Spec Missing
GHA-->>Dev: Fail Job (Exit 1)
else Config Valid
GHA->>Stainless: NEW: Authenticate (OIDC)
GHA->>Stainless: NEW: Upload Spec (preview@v1)
Note right of Stainless: Generates SDK previews<br/>without publishing
Stainless-->>GHA: Return Preview Result
GHA-->>Dev: Update PR Status
end
else PR Merged (Publish Flow)
Dev->>GHA: Merge Pull Request
GHA->>GHA: NEW: Validate Config
GHA->>Stainless: NEW: Authenticate (OIDC)
GHA->>Stainless: NEW: Upload Spec (merge@v1)
Note right of Stainless: Updates internal state<br/>Triggers SDK generation
Stainless-->>GHA: Success
end
why
Add Stainless CI for SDK codegen Keep all client SDKs in sync with packages/server/openapi.v3.yaml automatically, with safe previews before merge.
what changed
Adds the Stainless-recommended GitHub Actions workflow: run preview@v1 on PR updates and merge@v1 when the PR is merged, using OIDC via the Stainless GitHub App.
test plan
Summary by cubic
Sets up Stainless CI in GitHub Actions to auto-sync SDKs from packages/server/openapi.v3.yaml. Shows preview builds on PRs and runs a merge build when PRs are merged.
New Features
Migration
Written for commit 7533d03. Summary will update automatically on new commits.