Skip to content

ci: add monorepo SDK test trigger on pull requests#176

Open
BrooksFlannery wants to merge 2 commits intomainfrom
BrooksFlannery/stainless-test-workflow
Open

ci: add monorepo SDK test trigger on pull requests#176
BrooksFlannery wants to merge 2 commits intomainfrom
BrooksFlannery/stainless-test-workflow

Conversation

@BrooksFlannery
Copy link
Collaborator

@BrooksFlannery BrooksFlannery commented Jan 15, 2026

Add a new GitHub Actions job that automatically triggers the monorepo test suite whenever a PR is opened in flowglad-node. This validates that Stainless-generated SDK versions don't break the monorepo before publishing to npm.

The job dispatches to flowglad/flowglad with the PR commit hash, which the test-stainless-sdk workflow uses to fetch the corresponding SDK tarball from Stainless and run the full test suite.

This requires setting up a MONOREPO_DISPATCH_TOKEN secret (a GitHub PAT with repo scope) in the flowglad-node repository secrets.

Summary by CodeRabbit

  • Chores
    • Added a CI job that triggers an external test workflow for pull requests.
    • Job configured with a short timeout and runs on a standard Linux runner.
    • Runs conditionally for pull requests and is independent of existing job dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

Add a new job that triggers the flowglad monorepo test suite whenever a PR is opened in flowglad-node. This ensures that generated SDK versions are validated against the monorepo before publishing to npm.

The job dispatches to the flowglad/flowglad repository with the PR commit hash, which the test-stainless-sdk workflow uses to fetch the corresponding SDK tarball from Stainless.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

Adds a GitHub Actions job trigger-monorepo-tests to .github/workflows/ci.yml that runs for pull requests in the public repository, has a 5-minute timeout, does not depend on other jobs, and dispatches a repository_dispatch event to trigger tests in the monorepo, sending the PR head SHA as payload.

Changes

Cohort / File(s) Summary
CI/CD Workflow Configuration
/.github/workflows/ci.yml
Added trigger-monorepo-tests job (runs on ubuntu-latest, 5m timeout) conditioned for public repo PRs; uses peter-evans/repository-dispatch to send event-type: "test-stainless-sdk" and client_payload containing PR head SHA to the target repository.

Sequence Diagram(s)

sequenceDiagram
  participant PR as "Pull Request (repo A)"
  participant CI as "GitHub Actions (ci.yml)"
  participant Dispatch as "repository-dispatch action"
  participant RepoB as "Monorepo (repo B) / Test Runner"

  PR->>CI: PR opened / updated (public repo)
  CI->>Dispatch: invoke repository-dispatch (event: test-stainless-sdk, payload: head SHA)
  Dispatch->>RepoB: send repository_dispatch event with payload
  RepoB->>RepoB: kickoff monorepo tests
  RepoB-->>CI: (optional) report results / status via GitHub APIs
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 In CI meadows I hop and cheer,
A tiny dispatch zips far and near.
SHA in paw, I send the call,
Tests awake and answer all. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: add monorepo SDK test trigger on pull requests' directly and clearly summarizes the main change: adding a GitHub Actions job to trigger monorepo tests on PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 90-96: The trigger-monorepo-tests job is skipped because it
declares needs: build while the build job’s if prevents it from running on
same-repo pull_request runs; either make the build job run for pull_request or
remove the dependency so the dispatch can run. Fix by updating the build job’s
conditional to include pull_request (e.g., ensure the build job’s if allows
github.event_name == 'pull_request') or remove/replace needs: build from the
trigger-monorepo-tests job so it does not depend on build; reference the job
names trigger-monorepo-tests and build when making the change.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1aa3b28 and 84edb8e.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

The build job only runs on push events or fork PRs, but Stainless PRs
are same-repo PRs. This caused the trigger job to be skipped.

Removed the dependency since the tarball is uploaded by Stainless's
internal CI (stainless-sdks/flowglad-typescript), not by this repo's
build job. By the time a PR is opened here, the tarball already exists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant