Skip to content

ci: add Stainless SDK build workflow#221

Merged
declan-scale merged 3 commits intomainfrom
declan-scale/stainless-ci
May 5, 2026
Merged

ci: add Stainless SDK build workflow#221
declan-scale merged 3 commits intomainfrom
declan-scale/stainless-ci

Conversation

@declan-scale
Copy link
Copy Markdown
Collaborator

@declan-scale declan-scale commented May 5, 2026

Summary

Adds a Stainless SDK build workflow that runs whenever agentex/openapi.yaml changes. The committed spec is the source of truth (kept fresh by the openapi-spec CI job and the agentex-openapi-spec pre-commit hook from #220), so the workflow reads it directly via git history at PR base and head SHAs — no in-CI spec generation, no submodule gymnastics.

Why here instead of scaleapi/agentex

SDK preview comments now land on the PR that actually changed the API, so contributors see "did this break the SDK?" before merging — not after a downstream submodule bump. Replaces the more complex workflow proposed in scaleapi/agentex#342, which I'll close in favor of this.

Test plan

  • Trigger a no-op spec change on this PR (or a follow-up) to confirm Stainless posts a preview build comment
  • After merge, confirm pushes that change agentex/openapi.yaml produce a Stainless merge build

Greptile Summary

  • Adds a new .github/workflows/stainless.yml workflow that triggers Stainless SDK preview builds on PRs touching agentex/openapi.yaml and merge builds on pushes to main, using a sparse full-history checkout so the action can compare base and head spec versions without submodule complexity.
  • The concurrency block uses cancel-in-progress: true with a github.ref-based group; for push events to main this can silently drop intermediate merge builds (already flagged in an existing review thread).
  • fail_on: fatal means only fatal Stainless validation errors will fail the job — schema warnings and non-fatal issues pass silently.

Confidence Score: 4/5

Safe to merge with minor concerns; the concurrency issue on main was already flagged and the workflow is otherwise well-structured.

No new P0/P1 issues beyond the already-flagged cancel-in-progress concern. The workflow is minimal, uses a pinned action SHA, appropriate OIDC permissions, and efficient sparse checkout. Score capped at 4 due to the outstanding P1 in the existing thread.

No files require special attention beyond the concurrency block in .github/workflows/stainless.yml.

Important Files Changed

Filename Overview
.github/workflows/stainless.yml New CI workflow for Stainless SDK builds; concurrency cancel-in-progress issue on main already flagged; fail_on: fatal may silently pass non-fatal SDK schema issues.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub
    participant WF as stainless.yml workflow
    participant Checkout as actions/checkout@v6
    participant Stainless as stainless-api/build action

    GH->>WF: pull_request (openapi.yaml changed)
    WF->>Checkout: sparse-checkout agentex/openapi.yaml, fetch-depth: 0
    Checkout-->>WF: full history + sparse tree
    WF->>Stainless: org=sgp, project=agentex-sdk, oas_path, fail_on=fatal
    Stainless-->>GH: Post SDK preview comment on PR

    GH->>WF: push to main (openapi.yaml changed)
    WF->>Checkout: sparse-checkout agentex/openapi.yaml, fetch-depth: 0
    Checkout-->>WF: full history + sparse tree
    WF->>Stainless: org=sgp, project=agentex-sdk, oas_path, fail_on=fatal
    Stainless-->>GH: Trigger Stainless merge build (SDK publish)
Loading

Reviews (3): Last reviewed commit: "remove dummy commit" | Re-trigger Greptile

@declan-scale declan-scale requested a review from a team as a code owner May 5, 2026 19:33
Triggers on PRs and pushes to main that touch agentex/openapi.yaml.
The committed spec is the source of truth (kept fresh by the
openapi-spec CI job and the agentex-openapi-spec pre-commit hook), so
the workflow can read it directly via git history at base/head SHAs —
no in-CI generation needed.
@declan-scale declan-scale force-pushed the declan-scale/stainless-ci branch from a5848ae to 08abdb4 Compare May 5, 2026 19:35
Comment thread .github/workflows/stainless.yml
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✱ Stainless preview builds

No changes were made to the SDKs.


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-05-05 19:42:20 UTC

Comment thread agentex/src/api/routes/spans.py Outdated
@declan-scale declan-scale merged commit b3ea63a into main May 5, 2026
15 checks passed
@declan-scale declan-scale deleted the declan-scale/stainless-ci branch May 5, 2026 19:45
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