Generalize frontend version warning to all comfy* requirements.txt entries#13875
Conversation
…tries The frontend is itself a comfy* package, so check_frontend_version() is folded into check_comfy_packages_versions(), removing the duplication. /system_stats gains a comfy_package_versions list (purely additive).
The backend PR (Comfy-Org/ComfyUI#13875) emits comfy_package_versions entries straight from importlib.metadata, which can be PEP 440 (e.g. "0.3.0.post1", "1.0.0rc1", "0.4.0.dev0"). semver.valid() rejects those, so the previous filter silently dropped them. Replace the two valid()+gt() comparisons with a small isOutdated helper that uses semver.coerce (strips the suffix to the nearest X.Y.Z) and gt. Applied to both the frontend check and the per-package list so behavior is consistent.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors frontend version checking to scan all required 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
Acknowledged — no actionable comments to address. Thanks for the review. |
|
Not a blocker, but I'd prefer the result of (This was written by amp at my request) |
Mirrors the PACKAGE_VERSIONS cache in utils/install_util.py. Installed package versions don't change over the lifetime of the process, so a one-shot module-level cache makes /system_stats polling effectively free instead of doing N importlib.metadata.version() lookups per call.
Good call — done in 5777d75. Mirrored the exact |
|
lgtm. cc: @guill |
|
Thanks @Kosinkadink! Standing by for @guill's review before flipping out of draft. |
rattus128
left a comment
There was a problem hiding this comment.
LGTM. Did original back and forth with glary offline.
|
Thanks @rattus128! PR is out of draft and has both approvals — ready to merge whenever. |
…omfy-Org#12167) *PR Created by the Glary-Bot Agent* --- ## Summary Extend the existing frontend version-mismatch warning UI to consume the new `comfy_package_versions` array now exposed by ComfyUI's `/system_stats` endpoint. The backend ships installed/required versions for every `comfy*` package pinned in `requirements.txt` (frontend, workflow-templates, embedded-docs, kitchen, aimdo, …); the frontend now surfaces one toast per outdated package, reusing the existing N=1 frontend-version warning shape. Backend PR: Comfy-Org/ComfyUI#13875 ## Changes - `src/schemas/apiSchema.ts` — add `comfy_package_versions: Array<{name, installed, required}>` to the `SystemStats` schema and export a `ComfyPackageVersion` type. The field is `.optional()` so older backends remain compatible. - `src/platform/updates/common/versionCompatibilityStore.ts` — new `outdatedComfyPackages` / `packageWarningMessages` computeds that mirror the existing semver `gt` comparison (same `valid` guard). Skip `comfyui-frontend-package` because the dedicated frontend warning above already covers it (and uses the running bundle's version rather than the installed pip version). Outdated packages are sorted by `name`/`installed`/`required` before being folded into the dismissal storage key so the key is stable across response orderings — a fresh package bump re-shows the warning, but the same outdated set in a different order does not. - `src/platform/updates/common/useFrontendVersionMismatchWarning.ts` — emit one toast per outdated package in addition to the existing frontend toast, reusing the same i18n wrapper and the existing `hasShownWarning` once-per-session guard. - `src/locales/en/main.json` — new `g.comfyPackageOutdated` string. - Unit tests — added coverage for outdated/skip/invalid-version paths, dismissal-key inclusion, and stable ordering. Existing 21 store + 8 composable tests untouched and still passing. CI suppression is unchanged: warnings still gate on `versionCompatibilityStore.shouldShowWarning` (which respects the `Comfy.VersionCompatibility.DisableWarnings` setting and the 7-day dismissal cache), and unit tests continue to mock the store the same way. ## Verification - `pnpm vitest run` for the version-warning module: **31/31** passing. - Targeted sweep across `src/platform/updates`, `src/stores/systemStatsStore.test.ts`, `src/schemas`: **160/160** passing. - `pnpm typecheck`: clean. - `pnpm lint`: 0 errors (3 pre-existing warnings in unrelated 3D test files). - `pnpm format`: applied, no incidental changes. - **Manual Playwright run** against the real dev server with `/api/system_stats` intercepted to return outdated package data — produced exactly the expected toasts and correctly skipped `comfyui-frontend-package` and the up-to-date `comfy-kitchen` entry. Same run with all-up-to-date data produced zero toasts. ### Toasts produced (manual verification) The fixture used: `required_frontend_version=99.99.99`, plus `comfy_package_versions=[frontend-package (outdated, skipped), workflow-templates 0.9.0→0.9.5 (outdated), embedded-docs 0.4.0→0.5.0 (outdated), comfy-kitchen 0.2.8→0.2.8 (up to date)]`. ## Screenshots   ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12167-feat-extend-version-warning-to-all-comfy_package_versions-entries-35e6d73d365081e7b993d0f06c9e5c98) by [Unito](https://www.unito.io) --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com>
|
Thanks @Kosinkadink! |
PR Created by the Glary-Bot Agent
Frontend PR: Comfy-Org/ComfyUI_frontend#12167. These can go in any order, purely additive change to the API.
Summary
Generalizes the startup version check so every
comfy*package pinned inrequirements.txt(currentlycomfyui-frontend-package,comfyui-workflow-templates,comfyui-embedded-docs,comfy-kitchen,comfy-aimdo) gets the same console warning that previously only fired for the frontend, and exposes the discovered list via the existing/system_statsendpoint so the frontend can render a toast.Changes
app/frontend_management.py—check_frontend_version()andget_installed_frontend_version()are folded into a single generalizedcheck_comfy_packages_versions(). The frontend is itself acomfy*package, so there is no skip in the loop. Newget_comfy_package_versions()returns[{name, installed, required}, ...]for everycomfy*line inrequirements.txt, andFrontendManager.get_comfy_package_versions()is the thin classmethod wrapper matching the existingget_required_frontend_version/get_required_templates_versionpattern. Version comparison usespackaging.version.parse(already present incomfy_api/internal/api_registry.py) so PEP 440 versions like0.3.0.post1and1.0.0rc1compare correctly instead of throwing. Warning remediation uses the genericget_missing_requirements_message()so the text no longer mentions "frontend" when it fires for a non-frontend package.server.py—/system_statsgains one additive field,comfy_package_versions: [{name, installed, required}, ...]. Every existing field (required_frontend_version,installed_templates_version,required_templates_version) is preserved.openapi.yaml— schema for the new field.tests-unit/app_test/frontend_manager_test.py— the two existing tests that patchedcheck_frontend_versionare retargeted mechanically tocheck_comfy_packages_versions. No new test cases.Behavior
<pkg> version: <x.y.z>info log, no warnings.comfy*packages outdated → existing per-packageWARNING WARNING WARNING / Installed <name> version X is lower than the recommended version Yblock fires once per outdated package./system_statsalways returns the full list so the frontend can show a toast for any mismatch without re-querying.Verification
9.99.99, bothcomfyui-frontend-packageandcomfy-kitchenemit the existing WARNING block once each; remediation text is now the genericpip install -r requirements.txtmessage;/system_statsreturns the new list with correctinstalled/requiredper entry.parse_versionexported fromapp/frontend_management.pyis unchanged (still used byserver.py:1078).Drafted from Slack discussion in #dev-core-engine.