[PR #13] [CLOSED] feat(jobs): JobDetailDTO foundation for /api/jobs migration #17

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/13
Author: @mattmillerai
Created: 6/21/2026
Status: ❌ Closed

Base: main ← Head: feat/api-jobs-migration-foundation


📝 Commits (1)

  • 223c35d feat(jobs): add JobDetailDTO foundation for /api/jobs migration

📊 Changes

3 files changed (+208 additions, -0 deletions)

View changed files

➕ MIGRATION.md (+47 -0)
➕ Sources/ComfySwiftSDK/Internal/DTOs/JobDetailDTO.swift (+71 -0)
➕ Tests/ComfySwiftSDKTests/JobDetailDTOTests.swift (+90 -0)

📄 Description

Draft — first, conflict-free step of #12.

Adds the well-specified, fully-testable foundation for migrating the SDK's job-status read and cancel off the deprecated/legacy endpoints onto /api/jobs:

  • JobDetailDTO (GET /api/jobs/{job_id}) — decodes the JobDetailResponse shape and remaps its pending | in_progress | completed | failed | cancelled status onto the legacy queued/running/success/error/cancelled vocabulary the SDK's state machine already uses (legacyEquivalentStatus), so the cutover is a drop-in.
  • JobCancelDTO (POST /api/jobs/{job_id}/cancel) — the { "cancelled": boolean } response body.
  • MIGRATION.md — the plan, status remap table, and what's gated on a staging smoke test.

Why scoped this way

  • prompt_id == job_id, so JobHandle.id is already the correct path param — no id mapping needed.
  • outputs is unchanged ("Full outputs object from ComfyUI"), so the /api/view byte path doesn't move; this DTO reuses the existing NodeOutputPayload.
  • Additive / no behavior change. Nothing is wired into the live transport yet — these types are new files, so this PR is conflict-free with the in-flight purge PR #10 and the CI PR #11.
  • The runtime cutover (re-pointing Transport, updating PollingFallback / ReattachCoordinator / WebSocketSession + tests, moving the contract-manifest entries) rides on top once #10 lands, and is gated on a staging smoke test — the one acceptance criterion the unit suite can't prove. That's why this is a draft.

Verification

  • swift build clean
  • swift test — 140 tests (+6: decode of completed/failed/pending, the full status remap, the conservative-unknown fallback, and the cancel body)

Closes part of #12.

🤖 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/13 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 6/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/api-jobs-migration-foundation` --- ### 📝 Commits (1) - [`223c35d`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/223c35ddc352c1ab80d668a3146307f10fa69510) feat(jobs): add JobDetailDTO foundation for /api/jobs migration ### 📊 Changes **3 files changed** (+208 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `MIGRATION.md` (+47 -0) ➕ `Sources/ComfySwiftSDK/Internal/DTOs/JobDetailDTO.swift` (+71 -0) ➕ `Tests/ComfySwiftSDKTests/JobDetailDTOTests.swift` (+90 -0) </details> ### 📄 Description Draft — first, conflict-free step of #12. Adds the well-specified, fully-testable foundation for migrating the SDK's job-status read and cancel off the deprecated/legacy endpoints onto `/api/jobs`: - **`JobDetailDTO`** (`GET /api/jobs/{job_id}`) — decodes the `JobDetailResponse` shape and remaps its `pending | in_progress | completed | failed | cancelled` status onto the legacy `queued/running/success/error/cancelled` vocabulary the SDK's state machine already uses (`legacyEquivalentStatus`), so the cutover is a drop-in. - **`JobCancelDTO`** (`POST /api/jobs/{job_id}/cancel`) — the `{ "cancelled": boolean }` response body. - **`MIGRATION.md`** — the plan, status remap table, and what's gated on a staging smoke test. ### Why scoped this way - **`prompt_id` == `job_id`**, so `JobHandle.id` is already the correct path param — no id mapping needed. - **`outputs` is unchanged** ("Full outputs object from ComfyUI"), so the `/api/view` byte path doesn't move; this DTO reuses the existing `NodeOutputPayload`. - **Additive / no behavior change.** Nothing is wired into the live transport yet — these types are new files, so this PR is conflict-free with the in-flight purge PR #10 and the CI PR #11. - The runtime **cutover** (re-pointing `Transport`, updating `PollingFallback` / `ReattachCoordinator` / `WebSocketSession` + tests, moving the contract-manifest entries) rides on top once #10 lands, and is gated on a **staging smoke test** — the one acceptance criterion the unit suite can't prove. That's why this is a draft. ### Verification - `swift build` clean - `swift test` — **140 tests** (+6: decode of completed/failed/pending, the full status remap, the conservative-unknown fallback, and the cancel body) Closes part of #12. 🤖 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#17
No description provided.