feat: add Ingest API codegen with Zod schema generation#9932
feat: add Ingest API codegen with Zod schema generation#9932dante01yoon merged 7 commits intomainfrom
Conversation
- Add packages/ingest-types/ with generated TypeScript types and Zod schemas from the Ingest OpenAPI spec (cloud-only endpoints) - Filter out overlapping endpoints (/prompt, /queue, /history, etc.) that are shared with ComfyUI Python backend - Add CI workflow to auto-regenerate types when Ingest spec changes - Generate 493 TypeScript types and 256 Zod schemas covering workspaces, billing, secrets, assets, tasks, and more Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 556 passed, 0 failed · 7 flaky📊 Browser Reports
|
📝 WalkthroughWalkthroughA new package Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
📦 Bundle: 4.99 MB gzip 🟢 -24 BDetailsSummary
Category Glance App Entry Points — 21.7 kB (baseline 21.7 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.08 MB (baseline 1.08 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 75.3 kB (baseline 75.3 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 460 kB (baseline 460 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed User & Accounts — 16.6 kB (baseline 16.6 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed Editors & Dialogs — 81.8 kB (baseline 81.8 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 59 kB (baseline 59 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 3.17 MB (baseline 3.17 MB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 15 added / 15 removed Utilities & Hooks — 68.9 kB (baseline 68.9 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 12 added / 12 removed Vendor & Third-Party — 9.78 MB (baseline 9.78 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 8.21 MB (baseline 8.21 MB) • ⚪ 0 BBundles that do not match a named category
Status: 52 added / 52 removed |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/api-update-ingest-api-types.yaml (1)
10-16: Consider adding workflow concurrency to avoid duplicate update runs.Multiple dispatches close together can produce redundant generation/PR attempts.
⚙️ Suggested hardening
jobs: update-ingest-types: + concurrency: + group: ingest-api-types-update + cancel-in-progress: true runs-on: ubuntu-latest🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/api-update-ingest-api-types.yaml around lines 10 - 16, The workflow can trigger duplicate runs; add a top-level concurrency stanza to prevent overlapping executions by defining concurrency: with a stable group (e.g., "update-ingest-types-${{ github.ref }}") and cancel-in-progress: true so only the newest run proceeds; place this top-level (not inside steps) to apply to the update-ingest-types job and other jobs if needed.packages/ingest-types/package.json (1)
11-11: Make the post-generation Zod import rewrite more resilient.Current replacement only handles one exact string occurrence.
♻️ Suggested update
- "generate": "openapi-ts && node -e \"const fs=require('fs'); ['src/zod.gen.ts'].forEach(f => fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace(\\\"from 'zod/v3'\\\", \\\"from 'zod'\\\")));\"" + "generate": "openapi-ts && node -e \"const fs=require('fs');const f='src/zod.gen.ts';const s=fs.readFileSync(f,'utf8');fs.writeFileSync(f,s.replace(/from ['\\\"]zod\\/v3['\\\"]/g, \\\"from 'zod'\\\"));\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ingest-types/package.json` at line 11, The post-generation rewrite in the "generate" npm script currently does a single exact string replacement of "from 'zod/v3'" in 'src/zod.gen.ts' which misses other quote styles or multiple occurrences; update the Node one-liner in the "generate" script to perform a global, regex-based replacement (e.g., match from\s+['"]zod\/v3['"] with the global flag) and write back the file so all occurrences and quote variations are replaced with from 'zod'; keep it applied to the same target files (e.g., 'src/zod.gen.ts') so the generated output is robust.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/api-update-ingest-api-types.yaml:
- Around line 10-16: The workflow can trigger duplicate runs; add a top-level
concurrency stanza to prevent overlapping executions by defining concurrency:
with a stable group (e.g., "update-ingest-types-${{ github.ref }}") and
cancel-in-progress: true so only the newest run proceeds; place this top-level
(not inside steps) to apply to the update-ingest-types job and other jobs if
needed.
In `@packages/ingest-types/package.json`:
- Line 11: The post-generation rewrite in the "generate" npm script currently
does a single exact string replacement of "from 'zod/v3'" in 'src/zod.gen.ts'
which misses other quote styles or multiple occurrences; update the Node
one-liner in the "generate" script to perform a global, regex-based replacement
(e.g., match from\s+['"]zod\/v3['"] with the global flag) and write back the
file so all occurrences and quote variations are replaced with from 'zod'; keep
it applied to the same target files (e.g., 'src/zod.gen.ts') so the generated
output is robust.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 10d9b780-f630-4765-ae9e-00b60d78528c
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
.github/workflows/api-update-ingest-api-types.yamlknip.config.tspackages/ingest-types/.gitignorepackages/ingest-types/openapi-ts.config.tspackages/ingest-types/package.jsonpackages/ingest-types/src/index.tspackages/ingest-types/src/types.gen.tspackages/ingest-types/src/zod.gen.tspackages/ingest-types/tsconfig.json
⚡ Performance ReportNo regressions detected. All metrics
Historical variance (last 2 runs)
Raw data{
"timestamp": "2026-03-15T12:50:29.046Z",
"gitSha": "6339bae6282784197ae6367492ece7e5b08e7861",
"branch": "feat/ingest-api-codegen",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2021.3219999999978,
"styleRecalcs": 13,
"styleRecalcDurationMs": 9.667,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 340.74199999999996,
"heapDeltaBytes": -5056940,
"domNodes": 25,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 20.389999999999997,
"eventListeners": 6
},
{
"name": "canvas-idle",
"durationMs": 2028.3620000000155,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.022,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 345.479,
"heapDeltaBytes": 1059952,
"domNodes": 22,
"jsHeapTotalBytes": 19922944,
"scriptDurationMs": 20.528,
"eventListeners": 6
},
{
"name": "canvas-idle",
"durationMs": 2033.871999999974,
"styleRecalcs": 13,
"styleRecalcDurationMs": 11.301,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 359.33899999999994,
"heapDeltaBytes": 1118628,
"domNodes": 25,
"jsHeapTotalBytes": 15728640,
"scriptDurationMs": 25.685000000000002,
"eventListeners": 6
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2027.1040000000085,
"styleRecalcs": 82,
"styleRecalcDurationMs": 44.42400000000001,
"layouts": 12,
"layoutDurationMs": 3.698,
"taskDurationMs": 1015.6500000000002,
"heapDeltaBytes": 20178496,
"domNodes": 68,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 141.815,
"eventListeners": 6
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1793.9839999999663,
"styleRecalcs": 74,
"styleRecalcDurationMs": 33.89300000000001,
"layouts": 12,
"layoutDurationMs": 3.042,
"taskDurationMs": 722.5509999999999,
"heapDeltaBytes": -3338836,
"domNodes": 57,
"jsHeapTotalBytes": 19398656,
"scriptDurationMs": 126.79499999999999,
"eventListeners": 4
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1800.235999999984,
"styleRecalcs": 74,
"styleRecalcDurationMs": 35.751,
"layouts": 12,
"layoutDurationMs": 3.501,
"taskDurationMs": 709.1379999999999,
"heapDeltaBytes": -3163040,
"domNodes": 58,
"jsHeapTotalBytes": 20447232,
"scriptDurationMs": 125.67200000000001,
"eventListeners": 4
},
{
"name": "dom-widget-clipping",
"durationMs": 582.4530000000436,
"styleRecalcs": 16,
"styleRecalcDurationMs": 14.123000000000001,
"layouts": 1,
"layoutDurationMs": 0.32500000000000007,
"taskDurationMs": 362.078,
"heapDeltaBytes": 13319012,
"domNodes": 68,
"jsHeapTotalBytes": 16515072,
"scriptDurationMs": 64.548,
"eventListeners": 19
},
{
"name": "dom-widget-clipping",
"durationMs": 574.8669999999834,
"styleRecalcs": 14,
"styleRecalcDurationMs": 10.139,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 350.40500000000003,
"heapDeltaBytes": 12950600,
"domNodes": 24,
"jsHeapTotalBytes": 15466496,
"scriptDurationMs": 67.69,
"eventListeners": 2
},
{
"name": "dom-widget-clipping",
"durationMs": 544.6230000000014,
"styleRecalcs": 14,
"styleRecalcDurationMs": 10.207,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 332.664,
"heapDeltaBytes": 12639784,
"domNodes": 24,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 61.693999999999996,
"eventListeners": 2
},
{
"name": "large-graph-idle",
"durationMs": 2012.9860000000122,
"styleRecalcs": 14,
"styleRecalcDurationMs": 14.395999999999999,
"layouts": 1,
"layoutDurationMs": 0.19800000000000004,
"taskDurationMs": 485.394,
"heapDeltaBytes": 16935584,
"domNodes": 69,
"jsHeapTotalBytes": 9437184,
"scriptDurationMs": 89.333,
"eventListeners": 23
},
{
"name": "large-graph-idle",
"durationMs": 2002.6740000000132,
"styleRecalcs": 13,
"styleRecalcDurationMs": 10.33,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 474.42699999999996,
"heapDeltaBytes": 16406972,
"domNodes": 26,
"jsHeapTotalBytes": 8245248,
"scriptDurationMs": 88.84700000000001,
"eventListeners": 6
},
{
"name": "large-graph-idle",
"durationMs": 2002.4760000000015,
"styleRecalcs": 13,
"styleRecalcDurationMs": 10.769999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 469.201,
"heapDeltaBytes": 15493400,
"domNodes": 26,
"jsHeapTotalBytes": 9056256,
"scriptDurationMs": 87.96300000000001,
"eventListeners": 4
},
{
"name": "large-graph-pan",
"durationMs": 2102.4509999999736,
"styleRecalcs": 70,
"styleRecalcDurationMs": 16.083,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 981.1270000000001,
"heapDeltaBytes": 2614256,
"domNodes": 20,
"jsHeapTotalBytes": 9756672,
"scriptDurationMs": 373.603,
"eventListeners": 6
},
{
"name": "large-graph-pan",
"durationMs": 2103.7660000000074,
"styleRecalcs": 71,
"styleRecalcDurationMs": 17.183,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1048.381,
"heapDeltaBytes": 4010188,
"domNodes": 24,
"jsHeapTotalBytes": 8712192,
"scriptDurationMs": 431.464,
"eventListeners": 6
},
{
"name": "large-graph-pan",
"durationMs": 2094.196000000011,
"styleRecalcs": 71,
"styleRecalcDurationMs": 16.929,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 999.7510000000001,
"heapDeltaBytes": 2528160,
"domNodes": 22,
"jsHeapTotalBytes": 7921664,
"scriptDurationMs": 392.989,
"eventListeners": 6
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 588.4200000000419,
"styleRecalcs": 49,
"styleRecalcDurationMs": 12.435,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 360.62899999999996,
"heapDeltaBytes": 12721592,
"domNodes": 24,
"jsHeapTotalBytes": 16515072,
"scriptDurationMs": 123.16800000000002,
"eventListeners": 8
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 564.91299999999,
"styleRecalcs": 51,
"styleRecalcDurationMs": 16.559,
"layouts": 1,
"layoutDurationMs": 0.304,
"taskDurationMs": 364.738,
"heapDeltaBytes": 13293064,
"domNodes": 68,
"jsHeapTotalBytes": 16777216,
"scriptDurationMs": 120.37499999999999,
"eventListeners": 25
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 533.1600000000094,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.652999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 344.6979999999999,
"heapDeltaBytes": 13016552,
"domNodes": 22,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 116.97900000000001,
"eventListeners": 8
},
{
"name": "subgraph-idle",
"durationMs": 1994.8969999999804,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.591,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 332.037,
"heapDeltaBytes": 314624,
"domNodes": 23,
"jsHeapTotalBytes": 18350080,
"scriptDurationMs": 17.706999999999997,
"eventListeners": 6
},
{
"name": "subgraph-idle",
"durationMs": 2019.8519999999576,
"styleRecalcs": 12,
"styleRecalcDurationMs": 10.735999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 337.54300000000006,
"heapDeltaBytes": 952004,
"domNodes": 24,
"jsHeapTotalBytes": 18087936,
"scriptDurationMs": 16.532999999999998,
"eventListeners": 6
},
{
"name": "subgraph-idle",
"durationMs": 1998.0259999999817,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.618,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 337.233,
"heapDeltaBytes": 352904,
"domNodes": 24,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 17.522999999999996,
"eventListeners": 6
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1685.7380000000148,
"styleRecalcs": 77,
"styleRecalcDurationMs": 34.992,
"layouts": 16,
"layoutDurationMs": 4.2589999999999995,
"taskDurationMs": 617.713,
"heapDeltaBytes": 14793136,
"domNodes": 64,
"jsHeapTotalBytes": 12320768,
"scriptDurationMs": 92.72899999999998,
"eventListeners": 4
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1712.2719999999845,
"styleRecalcs": 77,
"styleRecalcDurationMs": 35.916,
"layouts": 16,
"layoutDurationMs": 4.263,
"taskDurationMs": 617.789,
"heapDeltaBytes": -7687504,
"domNodes": 64,
"jsHeapTotalBytes": 18612224,
"scriptDurationMs": 90.548,
"eventListeners": 6
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1723.263999999972,
"styleRecalcs": 80,
"styleRecalcDurationMs": 41.391,
"layouts": 17,
"layoutDurationMs": 4.38,
"taskDurationMs": 656.712,
"heapDeltaBytes": -6697144,
"domNodes": 109,
"jsHeapTotalBytes": 17039360,
"scriptDurationMs": 92.894,
"eventListeners": 23
}
]
} |
Instead of cloning the private cloud repo from the frontend CI (security risk), the workflow now receives the OpenAPI spec via repository_dispatch payload or workflow_dispatch URL input. The cloud repo should push the spec to this workflow, not the other way around. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/api-update-ingest-api-types.yaml (1)
59-62: Hardencurlwith timeout/retry controls.The spec download currently has no timeout or retry policy, so transient network failures can fail or hang the job unnecessarily.
🌐 Proposed resilient download command
- name: Download OpenAPI spec run: | - curl -fSL "${{ steps.resolve.outputs.spec_url }}" -o packages/ingest-types/openapi.yaml + curl --fail --show-error --silent --location \ + --retry 3 --retry-delay 2 --retry-all-errors \ + --connect-timeout 15 --max-time 120 \ + "${{ steps.resolve.outputs.spec_url }}" \ + --output packages/ingest-types/openapi.yaml echo "Downloaded OpenAPI spec from cloud@${{ steps.resolve.outputs.commit }}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/api-update-ingest-api-types.yaml around lines 59 - 62, The "Download OpenAPI spec" step currently runs curl without any timeout or retry controls; update that command in the workflow to harden the download by adding sensible curl retry and timeout flags (e.g., --retry, --retry-delay, --connect-timeout, --max-time) while keeping -fSL/-s behavior; ensure the step still fails on non-2xx responses (keep --fail/-f) and document the chosen values in a comment or step name so transient network errors are retried but the job won't hang indefinitely.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/api-update-ingest-api-types.yaml:
- Around line 27-29: The permissions block currently grants broad write scopes
("contents: write" and "pull-requests: write"); tighten it to least privilege by
replacing those with minimal read or none values and rely on the external secret
token for elevated operations—e.g., change "contents: write" to "contents: read"
(or remove if not needed) and remove or set "pull-requests" to "none" since PR
creation uses secrets.PR_GH_TOKEN; update the permissions stanza in the workflow
to only include the specific permissions required for the ingest job.
- Around line 48-57: In the "Resolve inputs" step (id: resolve) validate and
sanitize the incoming repository_dispatch payload and inputs before writing to
$GITHUB_OUTPUT: trim and remove any newlines/whitespace from spec_url and
commit, enforce spec_url starts with "https://" and contains no
whitespace/newlines, and validate commit against a SHA pattern (e.g.
^[0-9a-fA-F]{7,40}$); if validation fails, exit non‑zero with a clear error.
After sanitizing, write outputs using a safe write (e.g. printf '%s\n'
"$spec_url" >> $GITHUB_OUTPUT and printf '%s\n' "$commit" >> $GITHUB_OUTPUT) so
injected newlines or special chars cannot break downstream curl or branch-name
construction. Ensure this logic runs for both repository_dispatch and normal
input branches.
---
Nitpick comments:
In @.github/workflows/api-update-ingest-api-types.yaml:
- Around line 59-62: The "Download OpenAPI spec" step currently runs curl
without any timeout or retry controls; update that command in the workflow to
harden the download by adding sensible curl retry and timeout flags (e.g.,
--retry, --retry-delay, --connect-timeout, --max-time) while keeping -fSL/-s
behavior; ensure the step still fails on non-2xx responses (keep --fail/-f) and
document the chosen values in a comment or step name so transient network errors
are retried but the job won't hang indefinitely.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 789db585-967a-4e41-9c59-97f686c28a8e
📒 Files selected for processing (1)
.github/workflows/api-update-ingest-api-types.yaml
The cloud repo will push generated types to this repo instead. See: Comfy-Org/cloud push-ingest-types-to-frontend.yml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
christian-byrne
left a comment
There was a problem hiding this comment.
This is really nice.
- Add generated files to .gitattributes (linguist-generated) - Use replaceAll for robust zod/v3 import rewrite Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/ingest-types/package.json (1)
11-11: Harden Line 11 import rewrite against generator formatting drift.The current
replaceAll("from 'zod/v3'", ...)only matches single-quoted imports. If codegen emitsfrom "zod/v3"with double quotes, the replacement is skipped and imports remain incompatible.Proposed patch
- "generate": "openapi-ts && node -e \"const fs=require('fs'); ['src/zod.gen.ts'].forEach(f => fs.writeFileSync(f, fs.readFileSync(f,'utf8').replaceAll(\\\"from 'zod/v3'\\\", \\\"from 'zod'\\\")));\"" + "generate": "openapi-ts && node -e \"const fs=require('fs'); const f='src/zod.gen.ts'; const s=fs.readFileSync(f,'utf8').replace(/from\\s+[\\\"']zod\\/v3[\\\"']/g, \\\"from 'zod'\\\"); fs.writeFileSync(f, s);\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ingest-types/package.json` at line 11, The generate script's post-processing replaceAll only matches single-quoted imports and can miss double-quoted outputs; update the "generate" script that writes 'src/zod.gen.ts' to use a regex-based replace that matches both single and double quotes (e.g., a pattern like from ['"]zod\/v3['"] with global flag) so all occurrences are rewritten to the desired import form, and ensure the regex is correctly escaped for the JSON string in the package.json "generate" value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/ingest-types/package.json`:
- Line 11: The generate script's post-processing replaceAll only matches
single-quoted imports and can miss double-quoted outputs; update the "generate"
script that writes 'src/zod.gen.ts' to use a regex-based replace that matches
both single and double quotes (e.g., a pattern like from ['"]zod\/v3['"] with
global flag) so all occurrences are rewritten to the desired import form, and
ensure the regex is correctly escaped for the JSON string in the package.json
"generate" value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 19a60d6e-4a8a-47c2-8d91-781add5e7bae
📒 Files selected for processing (2)
.gitattributespackages/ingest-types/package.json
✅ Files skipped from review due to trivial changes (1)
- .gitattributes
|
@dante01yoon @christian-byrne feedback on @hey-api is always welcome! |
Summary
packages/ingest-types/package that auto-generates TypeScript types and Zod schemas from the Ingest service OpenAPI spec@hey-api/openapi-tswith built-in Zod plugin (Zod v3 compatible)CI automation
The cloud repo pushes generated types to this repo (push model, no private repo cloning).
See: Comfy-Org/cloud#2858
How endpoint filtering works
Codegen targets are controlled by the exclude list in
packages/ingest-types/openapi-ts.config.ts. Everything in the Ingestopenapi.yamlis included except overlapping endpoints that also exist in the local ComfyUI Python backend:Excluded (overlapping with ComfyUI Python):
/prompt,/queue,/history,/object_info,/features,/settings,/system_stats,/interrupt,/upload/*,/view,/jobs,/userdata,/webhooks/*,/internal/*Included (cloud-only, codegen targets):
/workspaces/*,/billing/*,/secrets/*,/assets/*,/tasks/*,/auth/*,/workflows/*,/workspace/*,/user,/settings/{key},/tags,/feedback,/invite_code/*,/experiment/models/*,/global_subgraphs/*Follow-up: replace manual types with generated ones
This PR only sets up the codegen infrastructure. A follow-up PR should replace manually maintained types with imports from
@comfyorg/ingest-types:src/platform/workspace/api/workspaceApi.tsimport type { ... } from '@comfyorg/ingest-types'src/platform/secrets/types.tsimport type { ... } from '@comfyorg/ingest-types'src/platform/assets/schemas/assetSchema.tsimport { ... } from '@comfyorg/ingest-types/zod'src/platform/assets/schemas/mediaAssetSchema.tsimport { ... } from '@comfyorg/ingest-types/zod'src/platform/tasks/services/taskService.tsimport { ... } from '@comfyorg/ingest-types/zod'src/platform/workspace/workspaceTypes.tsexport type { ... } from '@comfyorg/ingest-types'Test plan
pnpm generateinpackages/ingest-types/producestypes.gen.tsandzod.gen.tspnpm typecheckpasses