ci: add automated SDK definition sync workflow#151
ci: add automated SDK definition sync workflow#151devin-ai-integration[bot] wants to merge 5 commits into
Conversation
Adds a GitHub Action that: - Runs daily at 08:00 UTC (also manual/repository_dispatch) - Downloads latest OpenAPI specs from sandbox and controlplane repos - Regenerates Python SDK clients via openapi-python-client with custom templates - Runs ruff format and lint on generated code - Creates a PR if definitions changed, no-op otherwise Tracks: ENG-2668 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Needs attention — 1 issue in 1 file
git diff --quiet only detects changes to already-tracked files — any net-new generated files from cp -r will be silently ignored, causing the workflow to no-op when it should create a PR.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<assessment>
`git diff --quiet` only detects changes to already-tracked files — any net-new generated files from `cp -r` will be silently ignored, causing the workflow to no-op when it should create a PR.
</assessment>
<file name=".github/workflows/update-sdk-definitions.yaml">
<issue location=".github/workflows/update-sdk-definitions.yaml:78">
`git diff --quiet` only checks tracked files; newly generated files copied in by `cp -r` are untracked and won't be detected, so the workflow silently skips PR creation on first-time additions.
</issue>
</file>
Tag @mendral-app with feedback or questions. View session
git diff --quiet only checks tracked files; newly generated files from cp -r would be missed. git status --porcelain catches both tracked modifications and untracked new files. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Needs attention
The P1 bug (git diff --quiet missing untracked files) was correctly addressed with git status --porcelain. The three action pinning comments (checkout, setup-uv, create-pull-request) remain unaddressed — these are still pinned to mutable tags.
Tag @mendral-app with feedback or questions. View session
|
DevinAI please update with mendral comments |
Pin actions/checkout, astral-sh/setup-uv, and peter-evans/create-pull-request to immutable commit SHAs for supply-chain security. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
No separate PAT needed since repos are in the same GitHub org. GITHUB_TOKEN has sufficient read access to blaxel-ai/sandbox and blaxel-ai/controlplane. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Sandbox: raw.githubusercontent.com (public repo) - Controlplane: api.blaxel.ai/v0/openapi/controlplane.yml (public API) No auth tokens needed for either download. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
LGTM
All previous comments have been addressed: SHA-pinned actions (964c41e), git status --porcelain for untracked files (c2be321), and cross-repo auth (123acd6) resolved by switching to public endpoints (raw.githubusercontent.com and api.blaxel.ai). No new issues found.
Tag @mendral-app with feedback or questions. View session
| run: | | ||
| echo "Downloading sandbox definition from blaxel-ai/sandbox" | ||
| curl -sf -o ./definition.yml \ | ||
| "https://raw.githubusercontent.com/blaxel-ai/sandbox/refs/heads/main/sandbox-api/docs/openapi.yml" |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: MEDIUM
The workflow consumes remote OpenAPI definitions directly from mutable endpoints and immediately uses them for code generation (raw.githubusercontent.com/.../refs/heads/main/... here, and api.blaxel.ai in the next regenerate step) before opening an automated PR with write permissions. Because there is no integrity pinning (immutable commit/tag digest or checksum verification), an upstream compromise can inject attacker-controlled schema changes into generated SDK code.
Impact: This creates a supply-chain path where compromised upstream specs can introduce malicious client code into an automated update PR, increasing the chance of trusted-but-poisoned changes being merged.
Reviewed by Cursor Security Reviewer for commit 123acd6. Configure here.
|
DevinAI can you check cursor? |
|
@Joffref Checked the Cursor Security Agent review. It found one MEDIUM severity finding: OpenAPI specs fetched from mutable endpoints without integrity pinning — The risk is low since:
To fully mitigate, you could pin the sandbox URL to a specific commit SHA instead of |


Summary
Adds a GitHub Action workflow that automates the manual
make sdkstep — downloading the latest OpenAPI specs from public endpoints and regenerating the Python SDK clients.workflow_dispatch,repository_dispatchraw.githubusercontent.com/blaxel-ai/sandbox/.../openapi.yml(public)api.blaxel.ai/v0/openapi/controlplane.yml(public)GITHUB_TOKENonly used bypeter-evans/create-pull-requestfor PR creationgit status --porcelain(catches both tracked and untracked files)ruff format+ruff check --fixon generated codeTracks ENG-2668
Review & Testing Checklist for Human
make sdkproduces locallyNotes
Link to Devin session: https://app.devin.ai/sessions/36c5aabea5864aa4a5d5393aedf3d479
Requested by: @Joffref