[PR #11] [MERGED] CI: build/test workflow + OpenAPI contract drift check #16

Closed
opened 2026-10-26 22:33:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-swift-sdk/pull/11
Author: @mattmillerai
Created: 6/21/2026
Status: ✅ Merged
Merged: 6/21/2026
Merged by: @mattmillerai

Base: main ← Head: ci/openapi-contract-check


📝 Commits (6)

  • 08e7561 ci: add Swift build and test workflow
  • 37569d2 ci: add OpenAPI contract drift check against ComfyUI spec
  • 50fb1d4 docs(contract): note POST /api/queue deprecation and /api/jobs migration
  • e923aa4 fix(contract): point manifest at /api/jobs/{job_id} after #8 migration
  • ae6e31e fix(ci): build/test on macos-15 for the Swift Testing toolchain
  • 6105b3a fix(ci): run tests serially to avoid URLProtocol-stub deadlock

📊 Changes

4 files changed (+260 additions, -0 deletions)

View changed files

➕ .github/workflows/ci.yml (+36 -0)
➕ .github/workflows/openapi-contract.yml (+52 -0)
➕ Scripts/contract/check_contract.py (+117 -0)
➕ Scripts/contract/sdk-endpoints.yml (+55 -0)

📄 Description

Adds CI to the repo (there was none) and ties the SDK to the ComfyUI front-facing OpenAPI contract.

What's here

  1. ci: Swift build and test workflow — swift build + swift test on every PR and push to main (macos-14).
  2. ci: OpenAPI contract drift check — validates the endpoints the SDK calls against Comfy-Org/ComfyUI:openapi.yaml.

How the contract check behaves

Scripts/contract/sdk-endpoints.yml declares the endpoints the SDK depends on; Scripts/contract/check_contract.py validates them against the spec the workflow fetches.

Outcome Result
Required endpoint present ✅ ok
Required endpoint missing from contract ❌ fails the build
Endpoint marked deprecated: true ⚠️ non-blocking warning
Known legacy endpoint (required: false) missing ⚠️ non-blocking warning

It runs on PR, push to main, a weekly schedule (to catch drift introduced upstream rather than by an SDK change), and manual dispatch with a pinnable openapi_ref.

Real finding it already surfaces

The SDK reads job status via GET /api/prompt/{prompt_id}, which is not in the front-facing contract — the documented path is GET /api/jobs/{job_id}. Encoded as a non-blocking warning (so CI is green) with a migration note, rather than swept under the rug.

What's intentionally out of scope

The WebSocket /ws stream and the /oauth/* endpoints aren't in the OpenAPI contract (OpenAPI can't model WS; OAuth is a separate authorization-server surface). They're listed in the manifest's excluded: block for transparency and skipped by the checker.

Verified locally against the current spec

5 ok, 1 warning(s), 0 error(s) → exit 0

Negative test (a required endpoint absent from the spec) correctly exits 1.

Suggested merge order: this PR first, then rebase #10 so the cleanup PR also gets a CI run.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-swift-sdk/pull/11 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 6/21/2026 **Status:** ✅ Merged **Merged:** 6/21/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `ci/openapi-contract-check` --- ### 📝 Commits (6) - [`08e7561`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/08e7561eb6aa10d054d0ca1663fb34b63c5df6d7) ci: add Swift build and test workflow - [`37569d2`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/37569d2d577ef04203fc53daafba0e5fea754cef) ci: add OpenAPI contract drift check against ComfyUI spec - [`50fb1d4`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/50fb1d4ac38d14787cf831f53d8fa299f453a7b9) docs(contract): note POST /api/queue deprecation and /api/jobs migration - [`e923aa4`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/e923aa46cecf6bf0e7bb5c33bbbdb5219d3f9651) fix(contract): point manifest at /api/jobs/{job_id} after #8 migration - [`ae6e31e`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/ae6e31e26ce35a6f35146177ddadcedf6d8383ee) fix(ci): build/test on macos-15 for the Swift Testing toolchain - [`6105b3a`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/6105b3ada6c767f8594eaee0f747b4a89df94914) fix(ci): run tests serially to avoid URLProtocol-stub deadlock ### 📊 Changes **4 files changed** (+260 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/ci.yml` (+36 -0) ➕ `.github/workflows/openapi-contract.yml` (+52 -0) ➕ `Scripts/contract/check_contract.py` (+117 -0) ➕ `Scripts/contract/sdk-endpoints.yml` (+55 -0) </details> ### 📄 Description Adds CI to the repo (there was none) and ties the SDK to the ComfyUI front-facing OpenAPI contract. ### What's here 1. **`ci: Swift build and test workflow`** — `swift build` + `swift test` on every PR and push to `main` (macos-14). 2. **`ci: OpenAPI contract drift check`** — validates the endpoints the SDK calls against `Comfy-Org/ComfyUI:openapi.yaml`. ### How the contract check behaves `Scripts/contract/sdk-endpoints.yml` declares the endpoints the SDK depends on; `Scripts/contract/check_contract.py` validates them against the spec the workflow fetches. | Outcome | Result | |---|---| | Required endpoint present | ✅ ok | | Required endpoint **missing** from contract | ❌ **fails the build** | | Endpoint marked `deprecated: true` | ⚠️ non-blocking warning | | Known legacy endpoint (`required: false`) missing | ⚠️ non-blocking warning | It runs on PR, push to `main`, a **weekly schedule** (to catch drift introduced upstream rather than by an SDK change), and manual dispatch with a pinnable `openapi_ref`. ### Real finding it already surfaces The SDK reads job status via **`GET /api/prompt/{prompt_id}`**, which is **not in the front-facing contract** — the documented path is `GET /api/jobs/{job_id}`. Encoded as a non-blocking warning (so CI is green) with a migration note, rather than swept under the rug. ### What's intentionally out of scope The WebSocket `/ws` stream and the `/oauth/*` endpoints aren't in the OpenAPI contract (OpenAPI can't model WS; OAuth is a separate authorization-server surface). They're listed in the manifest's `excluded:` block for transparency and skipped by the checker. ### Verified locally against the current spec ``` 5 ok, 1 warning(s), 0 error(s) → exit 0 ``` Negative test (a required endpoint absent from the spec) correctly exits 1. > Suggested merge order: this PR first, then rebase #10 so the cleanup PR also gets a CI run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:33:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-swift-sdk#16
No description provided.