Commit Graph

106 Commits

Author SHA1 Message Date
Dr.Lt.Data
2b778fd42c fix: resolve API parameter mismatch and cross-type package matching
Fix two critical issues causing test failures in test_installed_api_enabled_priority.py:

1. API Parameter Mismatch (Primary Issue):
   - Tests were using outdated parameter names (node_name, install_type)
   - Server expects: id, version, selected_version
   - Fixed all 6+ parameter usages in test file
   - Impact: test_installed_api_shows_only_enabled_when_both_exist now passes

2. Cross-Type Package Matching (manager_core.py:1861-1873):
   - API incorrectly returned both enabled CNR and disabled Nightly packages
   - Root cause: Logic only checked same-type matches (CNR→CNR, Nightly→Nightly)
   - Added cross-type matching: disabled Nightly aux_id ↔ enabled CNR cnr_id
   - Extract package name from aux_id, compare with cnr_id
   - Impact: Disabled packages correctly excluded when enabled version exists

Infrastructure Improvements:
- Added monitor_test.sh for background process monitoring
- Updated run_automated_tests.sh to use tee for output forwarding
- Added test_installed_api_shows_disabled_when_no_enabled_exists to skip list

Test Results:
- Before: 60/63 tests passing (95.2%), 7/10 environments
- After: 61/63 tests passing (96.8%), 8/10 environments
- Improvement: +1.6% pass rate, +14.3% environment success rate

Remaining Issues (test-specific, not code bugs):
- test_installed_api_cnr_priority_when_both_disabled: Nightly installation issue
- test_installed_api_shows_disabled_when_no_enabled_exists: Session fixture interference

Documentation:
- Complete troubleshooting session documented in .claude/livecontext/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 14:47:20 +09:00
Dr.Lt.Data
05e13e7233 fix: correct enabled state detection and improve test isolation
This commit includes two fixes that improve test suite reliability
and fix a production bug:

1. Production Fix (manager_core.py:1819):
   - Fixed enabled state detection in get_installed_nodepacks()
   - Changed from `is_enabled = not y.endswith('.disabled')` to `is_enabled = True`
   - Packages in custom_nodes/ (not in .disabled/) are always enabled
   - This was a real bug causing incorrect API responses

2. Test Isolation Fix (test_case_sensitivity_integration.py:299):
   - Added cleanup_test_env() at end of test_case_sensitivity_full_workflow
   - Prevents disabled packages from polluting subsequent tests
   - Fixes test_disable_package failure in parallel test execution

Test Results:
- Pass rate improved from 93.2% to 96.6%
- Fixed 2 test failures
- Remaining 2 failures are due to enable operation bugs (separate issue)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 11:31:48 +09:00
Dr.Lt.Data
43647249cf refactor: remove package-level caching to support dynamic installation
Remove package-level caching in cnr_utils and node_package modules to enable
proper dynamic custom node installation and version switching without ComfyUI
server restarts.

Key Changes:
- Remove @lru_cache decorators from version-sensitive functions
- Remove cached_property from NodePackage for dynamic state updates
- Add comprehensive test suite with parallel execution support
- Implement version switching tests (CNR ↔ Nightly)
- Add case sensitivity integration tests
- Improve error handling and logging

API Priority Rules (manager_core.py:1801):
- Enabled-Priority: Show only enabled version when both exist
- CNR-Priority: Show only CNR when both CNR and Nightly are disabled
- Prevents duplicate package entries in /v2/customnode/installed API
- Cross-match using cnr_id and aux_id for CNR ↔ Nightly detection

Test Infrastructure:
- 8 test files with 59 comprehensive test cases
- Parallel test execution across 5 isolated environments
- Automated test scripts with environment setup
- Configurable timeout (60 minutes default)
- Support for both master and dr-support-pip-cm branches

Bug Fixes:
- Fix COMFYUI_CUSTOM_NODES_PATH environment variable export
- Resolve test fixture regression with module-level variables
- Fix import timing issues in test configuration
- Register pytest integration marker to eliminate warnings
- Fix POSIX compliance in shell scripts (((var++)) → $((var + 1)))

Documentation:
- CNR_VERSION_MANAGEMENT_DESIGN.md v1.0 → v1.1 with API priority rules
- Add test guides and execution documentation (TESTING_PROMPT.md)
- Add security-enhanced installation guide
- Create CLI migration guides and references
- Document package version management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 09:07:09 +09:00
Dr.Lt.Data
d3906e3cbc bump version 2025-10-21 07:25:56 +09:00
Dr.Lt.Data
079ac254ce
fixed: Bug fix in glob/manager_server.py that prevented cache updates when installed via pip. (#2237)
Until the cacheless implementation is fully applied, the cache must always be updated — otherwise, various parts of the system will malfunction.
2025-10-21 07:16:57 +09:00
Dr.Lt.Data
e0640e7014
fixed: more complete uv support (#2230)
* Previously, only `uv` installed inside a venv was properly handled. Now `uv` installed outside the venv is also supported.
* Even if `use_uv=False`, `uv` is used as a fallback when `pip` is unavailable.
* Even if `use_uv=True`, `pip` is used as a fallback when `uv` is unavailable.

https://github.com/Comfy-Org/ComfyUI-Manager/issues/2125
2025-10-18 08:15:14 +09:00
Dr.Lt.Data
1ab2b1aeb3 modified: Reflection of changing --disable-manager to --enable-manager 2025-09-19 11:58:04 +09:00
Dr.Lt.Data
6cc1ad4cc0 Merge branch 'main' into draft-v4 2025-09-13 08:06:45 +09:00
Dr.Lt.Data
d7799964de fixed: Issue where an invalid channel exception occurred when using the default channel
- Mismatch issue between ltdrdata/ and Comfy-Org/
modified: /v2/customnode/installed – cnr_id was being returned in a normalized form
modified: /v2/customnode/installed – when both an enabled nodepack and a disabled nodepack existed, modified to report only the enabled nodepack
fixed: Removed unnecessary warning messages printed during nodepack installation
2025-09-06 03:35:43 +09:00
Jin Yi
e13bf68775
Fix JSON serialization error in bulk import fail info API (#2119)
* fix: import failed info bulk api bug fix

* fix: Remove unused ImportFailInfoBulkResponse import
2025-09-04 08:36:46 +09:00
Dr.Lt.Data
d970fe68ea Merge branch 'main' into draft-v4 2025-09-03 01:24:47 +09:00
Jin Yi
b9a7d2a78c Revert "As a temporary measure, the new UI will use the legacy/... backend structure."
This reverts commit 121a5a1888.
2025-08-26 10:07:32 +09:00
Dr.Lt.Data
bdfb70a58a bump version 2025-08-24 15:58:23 +09:00
Dr.Lt.Data
00fb9c88e1 modified: remove matrix-nio dependency from the requirements.txt
modified: The matrix share feature is now only available when the `matrix-nio` dependency is installed.

If `matrix-nio` is not installed:
1. Apply a strikethrough to the matrix checkbox text in the share UI and display a tooltip.
2. A warning is logged at startup indicating that `matrix-nio` is missing, along with the installation command.

fixed: Corrected an issue where PR #2025 was merged into draft-v4 but applied only to `legacy/..` and not to `glob/..`
2025-08-22 20:46:32 +09:00
Dr.Lt.Data
648d7e73c6 Merge branch 'main' into draft-v4 2025-08-11 12:51:34 +09:00
Jin Yi
300c6e7406 feat: Add Pydantic validation to import_fail_info_bulk endpoint
- Regenerated Pydantic models from updated OpenAPI specification
- Updated import_fail_info_bulk route handler to use ImportFailInfoBulkRequest/Response models
- Replaced manual JSON validation with Pydantic model validation
- Added proper error handling with ValidationError
- Updated data_models/__init__.py to export new models

Following the process outlined in data_models/README.md for type safety and consistency.
2025-07-31 14:15:21 +09:00
Dr.Lt.Data
9c4d6a0773 Merge branch 'main' into draft-v4 2025-07-31 12:44:02 +09:00
Jin Yi
60746c6253
[feat] Add bulk import failure info API endpoint (#2035)
* [feat] Add bulk import failure info API endpoint

- Add import_fail_info_bulk endpoint to both glob and legacy manager servers
- Supports bulk processing of cnr_ids and urls arrays in single request
- Maintains same error handling pattern as original import_fail_info API
- Reduces API calls from N to 1 for conflict detection optimization
- Validates input parameters and provides proper error responses

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* modified: remove manager button completely. Now, even when using the legacy UI, it must always be accessed through the menu.

* chore(api): Add temporary cache reload for import_fail_info_bulk

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Dr.Lt.Data <dr.lt.data@gmail.com>
2025-07-30 07:57:19 +09:00
Dr.Lt.Data
121a5a1888 As a temporary measure, the new UI will use the legacy/... backend structure.
The glob/... version will be applied later after the cacheless implementation is completed.
2025-07-30 01:13:17 +09:00
Dr.Lt.Data
6867616973 Merge branch 'main' into draft-v4 2025-07-25 12:26:42 +09:00
Dr.Lt.Data
cf8029ecd4 Merge branch 'main' into draft-v4 2025-07-24 12:41:48 +09:00
Dr.Lt.Data
59264c1fd9 Merge branch 'main' into draft-v4 2025-07-20 19:23:24 +09:00
Dr.Lt.Data
22725b0188 add missing file 2025-07-15 18:52:17 +09:00
Dr.Lt.Data
a0b0c2b963 feat: initial implementation of middleware-based security policy 2025-07-12 11:31:07 +09:00
Dr.Lt.Data
f4ce0fd5f1 Merge branch 'main' into draft-v4 2025-07-08 12:21:47 +09:00
Dr.Lt.Data
adbeb527d6 added: middleware manager for security policy 2025-07-01 12:54:29 +09:00
Dr.Lt.Data
43041cebed modified: Do not modify generated_models.py directly; use openapi.yaml instead. 2025-06-28 07:54:17 +09:00
Dr.Lt.Data
002e549a86 modified: security policy
- Strengthened the default security policy
- Subdivided the risky levels high and middle into high+, high, middle+, and middle
- Added support for personal_cloud network mode
- Updated README.md

fixed: invalid security message
fixed: legacy - crash when security policy violation occurred

modified: default 'use_uv' is now True
2025-06-27 01:38:38 +09:00
Dr.Lt.Data
89530fc4e7 Merge branch 'main' into draft-v4 2025-06-25 12:58:50 +09:00
Dr.Lt.Data
223d6dad51 Merge branch 'main' into draft-v4 2025-06-25 00:46:12 +09:00
Christian Byrne
cb0fa5829d
Merge pull request #1915 from Comfy-Org/feat/implement-batch-tracking-clean
[feat] Implement comprehensive batch tracking and OpenAPI-driven data models
2025-06-21 19:46:23 -07:00
bymyself
a66f86d4af cleanup records older than 16 days 2025-06-21 16:57:54 -07:00
bymyself
35d98dcea8 add batch_id to history task items 2025-06-21 16:45:50 -07:00
bymyself
38fefde06d add embedded python to system state 2025-06-21 16:29:40 -07:00
bymyself
75ecb31f8c add frontend version to system state capture 2025-06-21 16:28:00 -07:00
bymyself
77133375ad [fix] Ensure batch history is written when queue becomes empty 2025-06-21 16:01:25 -07:00
bymyself
d1ca6288a3 apply formatting 2025-06-19 16:41:16 -07:00
bymyself
624ad4cfe6 remove debug comments 2025-06-19 16:39:14 -07:00
bymyself
d912fb0f8b [fix] Remove unused imports to fix Ruff linting errors 2025-06-17 15:27:21 -07:00
bymyself
e8fc053a32 [fix] Update data models to Pydantic v2 syntax to fix TypeError 2025-06-17 15:12:25 -07:00
bymyself
ce3b2bab39 refactor 2025-06-17 14:58:34 -07:00
bymyself
15e3699535 [cleanup] Remove outdated temp_queue_batch comment 2025-06-17 14:44:58 -07:00
bymyself
a4bf6bddbf [refactor] Use Pydantic models for query parameter validation
- Added query parameter models to OpenAPI spec for GET endpoints
- Regenerated data models to include new query param models
- Replaced manual validation with Pydantic model validation
- Removed obsolete validate_required_params helper function
- Provides better error messages and type safety for API endpoints

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 14:42:25 -07:00
bymyself
f1b3c6b735 [refactor] Move model utility functions to model_utils module 2025-06-17 14:24:31 -07:00
bymyself
e923434d08 [fix] Update client filtering to handle tuple structure in pending_tasks 2025-06-17 13:52:00 -07:00
bymyself
ddc9cd0fd5 [fix] Use tuples in TaskQueue heap for proper comparison support 2025-06-17 13:42:47 -07:00
bymyself
d081db0c30 [cleanup] Remove dead code do_update_all function
- Removed do_update_all function that was never called and only returned an error
- Removed "update-all" from OperationType enum as it's no longer used
- Regenerated data models to reflect the enum change

The update_all functionality now properly creates individual update tasks through the API endpoint rather than being a single monolithic task.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 13:27:51 -07:00
bymyself
14298b0859 [fix] Remove unused imports to fix linting errors 2025-06-17 13:08:52 -07:00
bymyself
03ecda3cfe [feat] Implement comprehensive system state capture for batch records 2025-06-17 13:08:35 -07:00
bymyself
350cb767c3 [feat] Regenerate data models with enhanced ComfyUISystemState
- Add SecurityLevel and RiskLevel enums to generated models
- Enhance ComfyUISystemState with additional system information fields:
  - comfyui_root_path: ComfyUI installation directory
  - model_paths: Map of model types to configured paths
  - manager_version: ComfyUI Manager version
  - security_level: Current security configuration
  - network_mode: Network mode (online/offline/private)
  - cli_args: Selected CLI arguments
  - custom_nodes_count: Total number of custom nodes
  - failed_imports: List of failed imports
  - pip_packages: Installed pip packages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 13:06:14 -07:00