mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 22:58:08 +00:00
Extract workflow zod schemas, link topology validator, and link repair into a new `@comfyorg/workflow-validation` package under `packages/`. The package has zero litegraph coupling — it operates on plain serialised JSON shapes — so it can be consumed by Node.js CI scripts and a future backend validator. Behaviour changes: - Replace the four `'Error. Expected node to match patched data.'` invariant throws in the link fixer with `LinkRepairAbortedError`, which carries a structured `TopologyError` describing the offending `[linkId, src, srcSlot, tgt, tgtSlot]`. - Add a pure `validateLinkTopology(graph)` that walks the link table and reports out-of-bounds slots, missing nodes, and endpoint mismatches as a structured `TopologyError[]`. This catches the seedance-style breakage (links targeting slots that don't exist on the node) which the schema cannot detect. - Surface topology errors via toast when `Comfy.Validation.Workflows` is enabled, instead of swallowing them with `console.error`. Unrepairable workflows raise an `error` toast with structured details and `useWorkflowValidation` returns `null` so the caller falls back to the original graph. Migration is via tsconfig + vite path aliases mirroring the existing `@/utils/formatUtil` precedent, so the 76 importers of `workflowSchema` and the lone importer of `linkFixer` continue to compile without changes. Adds `release-npm-workflow-validation.yaml`, a `workflow_dispatch` publisher mirroring the existing `release-npm-types` pattern, so a follow-up PR on Comfy-Org/workflow_templates can pin the published package for per-template topology CI.
GitHub Workflows
Naming Convention
Workflow files follow a consistent naming pattern: <prefix>-<descriptive-name>.yaml
Category Prefixes
| Prefix | Purpose | Example |
|---|---|---|
ci- |
Testing, linting, validation | ci-tests-e2e.yaml |
release- |
Version management, publishing | release-version-bump.yaml |
pr- |
PR automation (triggered by labels) | pr-claude-review.yaml |
api- |
External Api type generation | api-update-registry-api-types.yaml |
i18n- |
Internationalization updates | i18n-update-core.yaml |
Documentation
Each workflow file contains comments explaining its purpose, triggers, and behavior. For specific details about what each workflow does, refer to the comments at the top of each .yaml file.
For GitHub Actions documentation, see Events that trigger workflows.