Repository navigation
feat(website): Run form from the catalog run contract, with the static fallback - #21552
MaanilVerma wants to merge 10 commits into
Conversation
…inding Cloud's runnable workflow example sets control media on a plain string input and gives no urlUpload. The website rejected that input, so the record dropped out of the catalog read and its page returned 404. The input now takes urlUpload from the mediaKind of its cloud-asset binding.
…run contract A catalog record for one of the 30 Workshop workflows has no inputs until the run data moves into the catalog. Its page now uses the Run form from content/workshop-display.json. A record with its own inputs, or with mismatched inputs, keeps them. Tests cover a v2 run contract, a download-only record, and both cases for a Workshop slug.
📦 Bundle Size
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
Findings and check detailsThe matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. Findings and check detailsNo new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since cfcff3a504815861c835bdb52cee50ca1d0f9d6a
Full docs: ADR-DEVEX-LINT-0015 🏛️ Architecture: ✅ PassedFindings and check detailsWarnings (132)
Reproduce locallypnpm architecture:checkFull docs: Frontend domain catalog 🌐 Website E2ETip All tests passed. Test results
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-21552.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. Deployment detailsThis commit: https://website-frontend-1o1gw5u1c-comfyui.vercel.app Last updated: 2026-10-21T17:43:10Z for |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
The fallback read the derived catalogDetails.runnable. That value is also false for a record with workflow_versions and no API graph, which must keep the fallback. catalogDetails now carries runnableSetting, the raw runnable value of the record, and the fallback skips a record only when runnableSetting is false.
uploadKind now reads the binding through the exported bindingSchema, so one schema owns the media-kind contract.
…vailability switch The shared fixture moves to catalog-run-form-fixture.ts. New cases cover a Workshop record with versions and no API graph, with an input schema and no input settings, and with runnable false. Other cases cover the page form, video and audio upload kinds, an input's own urlUpload, and a slug that the availability switch disables.
This comment has been minimized.
This comment has been minimized.
benjcooley
left a comment
There was a problem hiding this comment.
Review: Run form from the catalog run contract (#21552)
| Severity | Count |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 2 |
| TRIVIAL | 3 |
What I checked and found OK:
- Same form on every path.
withStaticRunFormruns on all three paths: SSR (detail-page-server),page.json(client navigation and refetch), andLegacyDetailPage(not touched). This means no hydration mismatch. - Slug lookup works. Catalog
workflows/<slug>matches the static key. - Availability switch works.
workflowPagesFordrops disabled slugs when the module loads, so the fallback is skipped for them. - Media kinds are valid. The
cloud-assetmediaKindvalues (image,video,audio) are a subset of theurlUploadenum, souploadKindadds no new 404 risk. runnableSettingis needed. Keeping the raw value separate from the derivedrunnableis correct.- Test isolation is fine. The vitest config has
mockReset,restoreMocksandunstubEnvs.
Main issues:
- The static fallback runs the static workflow but keeps the record's examples and defaults. All 30 static pages lose their prefilled example, and required image inputs open empty (inline).
- The
runnableSetting === falseandinputMismatchguards fail open. WhencatalogDetailsfails to parse, both are skipped (inline).
Noted, not blocking:
- On the fallback path, the API JSON download (
apiWorkflowFile) andoutputTypestill come from the record, while Run uses the static graph. Fine if that is intended; a line in thestatic-run-form.tscomment would help. - The fallback only affects non-production (
[slug].astrouses the catalog path only whenVERCEL_ENV !== 'production').
I reviewed by reading the code and did not run the tests: the local node_modules is from another branch.
…sed without catalog details
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## work/ccc-mar-integration-20261014 #21552 +/- ##
=====================================================================
- Coverage 86.45% 86.34% -0.11%
=====================================================================
Files 4030 3926 -104
Lines 184642 181417 -3225
Branches 50825 49725 -1100
=====================================================================
- Hits 159627 156653 -2974
+ Misses 22316 22221 -95
+ Partials 2699 2543 -156
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 122 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…alog details The fallback now takes examples and defaults from the static page, so the page opens with its prefilled example. It skips a record whose catalog details do not parse, and a static page of a different workflow type.
benjcooley
left a comment
There was a problem hiding this comment.
Re-review (7909883): all 5 round-1 findings are fixed
| Severity | Open |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 0 |
| TRIVIAL | 1 (follow-up, not this PR) |
I checked each fix against the code, not just the replies:
- Prefilled example: the fallback now also takes
examplesanddefaultsfrom the static page.- The new test fails without the fix:
values.promptonly comes from the static page. - The static example shape passes
modelsPageDataSchema, so the SSR and page.json round trip staysok. - The OG image and JSON-LD read only
thumbnail, so they are unaffected.
- The new test fails without the fix:
- Fail closed: the fallback now does nothing when
catalogDetailsis missing.script_code: 'print()'really fails the details parse, becausescriptCodeisz.object().optional().- So the test exercises the missing-details branch.
- Type mismatch: the
legacy.type !== model.typeskip is fine as a defensive guard. All 30 static pages are CLOUD. uploadKindtests: the three negative rows are sound.uploadKindreturns{}, andnot.toHavePropertywould also catch anurlUpload: undefinedkey.- Disabled-slug test:
- Its mock only matters at module load, when
workflowDetailsBySlugis built. That happens beforemockReset, so the test is not vacuous. - Not using
vi.importActualis fine because of the lint rule.
- Its mock only matters at module load, when
Follow-up, not blocking: with fail-closed, a static slug whose details don't parse now shows a Run footer over an empty form. The cause is in the base branch: WorkflowPage.vue's !model.catalogDetails counts as runnable. Every catalog record with unparseable details already has the same gap. A small separate change would fix it: runnable = model.catalogDetails?.runnable !== false && Object.keys(model.workflow.inputs).length > 0. Static pages always have inputs, so they keep working.
What I verified: I read the code, and three review passes reasoned through mutations against the new tests. I did not run vitest locally. CI is green on this head: 55 checks pass (website-unit, typecheck, build, e2e shards) and the rest are skipped.
|
Moved to Comfy-Org/comfy-website#22 (the website now lives there). This PR stays open for its review history. |
|
Closing: the website moved; this change lives in Comfy-Org/comfy-website#22. |
Summary
A catalog workflow page now shows a Run form when its record carries the schema v2 run contract from cloud #14719. A record without run fields shows no form. The 30 static Workshop workflows are the exception: when the catalog record for one of their slugs has no run fields, the page keeps the static Run form, with its examples and defaults, until the catalog holds its run data (RUN1c).
Changes
inputContractincatalog-presentation.tsnow gives amediainput theurlUploadkind of itscloud-assetbinding when the input has none. Before this change, a record written from cloud's runnable workflow example did not passdetailSchema, so its page returned 404.uploadKindreads the binding through the exportedbindingSchema, so one schema owns the media-kind contract. It sets no upload kind on a text control, a scalar binding or a missing binding.withStaticRunForminstatic-run-form.tsgives a catalog workflow with no inputs the workflow, form, examples and defaults of its static page incontent/workshop-display.json. The API JSON download and the output type still come from the record.withStaticRunFormskips a record that has nocatalogDetails, a record whose ownrunnableis false, and a record with an input mismatch.withStaticRunFormalso skips a record when the static page has a different type (CLOUDorSERVERLESS) from the record.catalogDetails.runnableSettingcarries the rawrunnablevalue, because the derivedcatalogDetails.runnableis also false for a record withworkflow_versionsand no API graph, and that record keeps the fallback.pageModelinmodel-page.tsapplieswithStaticRunFormto the catalog detail, so the server HTML andpage.jsonshow the same form.catalog-run-form.test.tsandcatalog-run-form.disabled.test.tsload each record throughloadCatalogDetailPageand renderCatalogDetailPageon the server. The shared record and loader are incatalog-run-form-fixture.ts.QA Focus
pnpm exec vitest run src/routes/models/catalog-run-form.test.tsinapps/website. Expected: 17 tests pass. Author: tested at790988368d.vitest run src/routes/models/catalog-run-formpasses 18 of 18 across both files.pnpm exec vitest run src/routes/models/catalog-run-form.disabled.test.ts. Expected: 1 test passes, the page titleCatalog workflowrenders, and a Workshop slug that the availability switch disables shows no Run form. Author: tested, 1 pass in 1554 ms. With the disabled slug changed toworkflows/none, the test does not pass.opens with the prefilled example of the static page. Expected: the page opens with the values of the static page example. Author: tested. At the red commitc45411bf60, it got{ image1: undefined, …(5) }. It passes atddda195459.keeps the record workflow when its catalog details do not parse. Expected:catalogDetailsis undefined andworkflow.inputsstays empty. Author: tested. Atc45411bf60, the fallback filled the inputs. It passes atddda195459.uploadKind, change each guard totrueone at a time (hints.control === 'media',binding.success, thenbinding.data.encoding === 'cloud-asset'tobinding.success). Expected: the matchingsets no upload kind on ...row does not pass. Author: tested ataa8f90e96f, each mutation makes its row red.runnableSetting === falsecheck inwithStaticRunForm. Expected: therunnable set to falserow does not pass. Author: tested in the first review round, 1 red. Before the fix, this row was red on the branch.catalogDetails.runnablein place ofrunnableSetting. Expected: thedownload versions without an API graphrow does not pass. Author: tested in the first review round, 1 red.imagefromuploadKind, then ignore the input's ownurlUpload. Expected: the video and audio rows, then the own-kind test, do not pass. Author: tested in the first review round, 2 red, then 1 red.form: legacy.forminwithStaticRunForm. Expected:builds the page form from the static workflow it runsdoes not pass. Author: tested in the first review round, 1 red.uploadKindspread ininputContractand run the same file. Expected: the two run-contract tests do not pass. Author: tested in the first review round, 2 red with "record missing".withStaticRunForminpageModeland run the same file. Expected: the Workshop fallback test does not pass. Author: tested in the first review round, 1 red.runnablecomputed inWorkflowPage.vueto ignore empty inputs and run the same file. Expected: the download-only test does not pass. Author: tested in the first review round, 1 red. This test pins behavior that existed before this PR.SERVERLESStype against aCLOUDrecord. Expected: the record model stays. Author: not tested, because all 30 staticworkflows/entries inworkshop-display.jsonareCLOUD, and no test can reach this branch without a mock ofworkshop-page-content.pnpm exec vitest run src/routes/models src/lib/cms. Expected: all pass. Author: tested in the first review round, 45 files and 718 tests pass, withsrc/config/workshop-workflow-catalog.test.tsadded to the run. Not run again after the second round.pnpm typecheck:website,pnpm knipand eslint on the changed files. Expected: no errors. Author: tested in the first review round, 0 errors. In the second round,oxlintran on the disabled-slug test.renders a Run form from the record run contract that submits to its API graphshows no Run form for a record without run fieldschange-materialwithout run fields keeps the static formkeeps the static Run form for a Workshop workflow whose record has no run fields3 pass, 0 fail, 0 escalated, 0 inconclusive. Not covered here: a real Run submission to Cloud, because the mock catalog has no Cloud backend.
Risky areas
withStaticRunFormreplaces the record's workflow, form, examples and defaults with the static page values, and setscatalogDetails.runnableto true. Thus an author's examples and defaults on such a record do not show until the record has its own run fields.withStaticRunFormdoes not apply the static form to a record withoutcatalogDetails, a record that setsrunnable: false, a record with an input mismatch, a static page of a different type, or a slug that theworkshop-model-availabilityswitch disables.catalogDetailsstill shows a Run footer with an empty form, becauseWorkflowPage.vuetreats missing details as runnable. That is base behavior, and static pages also have nocatalogDetails, so this PR does not change it.catalogDetails.runnableSettingis a new optional field inworkflowCatalogDetailsSchema, so it is part of thepage.jsonpayload.uploadKindchanges the presentation of every catalog workflowmediainput that has acloud-assetbinding and nourlUpload. Inputs that seturlUploadkeep their value.catalog-presentation.ts, in the thumbnail functions. This PR edits onlyinputContract,uploadKindandworkflowDetails, so a merge conflict is not expected.Follow-up, not in this PR: one bad input binding still makes the whole workflow page return 404, because
detailSchemarejects the record. Base #21204 has the same behavior. TheinputMismatchcomment incatalog-presentation.tssays the page must show a notice instead. An author who makes one typo in a binding loses the whole page until the fix. The fix belongs next toinputMismatch, so I did not add it to this Run-form PR.PR dependency map
main(base)main)main)Merge #21204 before this PR. Cloud #14719 is already merged.