mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-06 07:51:07 +00:00
Two reviewer-requested improvements to GET /node_startup_errors:
1. Emit the pyproject metadata in the same {project: {...}, tool_comfy: {...}}
shape that comfy_config.config_parser.extract_node_configuration already
returns, instead of inventing a flat {pack_id, display_name, ...} bag.
API consumers can now parse the pyproject block straight through the
shared PyProjectConfig pydantic model. Empty / default-valued leaves
are pruned by a small recursive _prune_empty helper so the payload
stays compact, but nesting and field names match the source-of-truth.
2. Add optional source, module_name, and pack_id query parameters
(combined with AND) so a frontend / Manager can ask ?pack_id=foo
instead of grep'ing through the whole grouped response. pack_id
resolves against pyproject.project.name; entries without a parsed
pyproject are naturally excluded from a pack_id query.
The grouping + filtering + module_path stripping moves into
odes.filter_node_startup_errors so the route handler is a one-liner and
the helper is unit-testable without spinning up an aiohttp app.
Tests: 5 new unit tests covering each filter branch, AND-combination, and
empty-result behaviour, plus an updated pyproject-metadata assertion that
checks the nested PyProjectConfig shape, plus a focused test for the
_prune_empty helper.
Pytest Unit Tests
Install test dependencies
pip install -r tests-unit/requirements.txt
Run tests
pytest tests-unit/