Compare commits

..
Author SHA1 Message Date
Benjamin Lu 9c069c13c5 v4: Report desktop-linux form factor for Desktop installs on Linux
Desktop runs on Linux now, but get_form_factor mapped a Desktop install on
Linux to 'other', losing the platform in registry data.
2026-10-14 17:22:27 -07:00
3 changed files with 65 additions and 21 deletions
+5
View File
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/
## [Unreleased]
### Fixed
- Report the `desktop-linux` form factor to the registry for Desktop installs
on Linux, which previously reported `other`.
## [4.3] - 2026-09-19
### Security
+24 -21
View File
@@ -20,6 +20,29 @@ lock = asyncio.Lock()
is_cache_loading = False
def get_form_factor():
"""Form factor reported to the registry, based on environment and platform."""
is_desktop = bool(os.environ.get('__COMFYUI_DESKTOP_VERSION__'))
system = platform.system().lower()
if is_desktop:
if system == 'windows':
return 'desktop-win'
if system == 'darwin':
return 'desktop-mac'
if system == 'linux':
return 'desktop-linux'
return 'other'
if system == 'windows':
return 'git-windows'
if system == 'darwin':
return 'git-mac'
if system == 'linux':
return 'git-linux'
return 'other'
async def get_cnr_data(cache_mode=True, dont_wait=True):
try:
return await _get_cnr_data(cache_mode, dont_wait)
@@ -39,12 +62,7 @@ async def _get_cnr_data(cache_mode=True, dont_wait=True):
full_nodes = {}
# Determine form factor based on environment and platform
is_desktop = bool(os.environ.get('__COMFYUI_DESKTOP_VERSION__'))
system = platform.system().lower()
is_windows = system == 'windows'
is_mac = system == 'darwin'
is_linux = system == 'linux'
# Get ComfyUI version tag
if is_desktop:
@@ -53,22 +71,7 @@ async def _get_cnr_data(cache_mode=True, dont_wait=True):
else:
comfyui_ver = context.get_comfyui_tag() or 'unknown'
if is_desktop:
if is_windows:
form_factor = 'desktop-win'
elif is_mac:
form_factor = 'desktop-mac'
else:
form_factor = 'other'
else:
if is_windows:
form_factor = 'git-windows'
elif is_mac:
form_factor = 'git-mac'
elif is_linux:
form_factor = 'git-linux'
else:
form_factor = 'other'
form_factor = get_form_factor()
from comfyui_manager.glob import manager_core
verbose = manager_core.get_config().get('verbose', False)
+36
View File
@@ -0,0 +1,36 @@
"""Form factor the CNR client reports to the registry."""
import pytest
from _install_flags_testutil import import_context
@pytest.fixture
def cnr_utils():
import_context()
from comfyui_manager.common import cnr_utils
return cnr_utils
@pytest.mark.parametrize(
('system', 'desktop', 'expected'),
[
('Windows', True, 'desktop-win'),
('Darwin', True, 'desktop-mac'),
('Linux', True, 'desktop-linux'),
('FreeBSD', True, 'other'),
('Windows', False, 'git-windows'),
('Darwin', False, 'git-mac'),
('Linux', False, 'git-linux'),
('FreeBSD', False, 'other'),
],
)
def test_form_factor(cnr_utils, monkeypatch, system, desktop, expected):
monkeypatch.setattr(cnr_utils.platform, 'system', lambda: system)
if desktop:
monkeypatch.setenv('__COMFYUI_DESKTOP_VERSION__', '1.0.0')
else:
monkeypatch.delenv('__COMFYUI_DESKTOP_VERSION__', raising=False)
assert cnr_utils.get_form_factor() == expected