Skip to content

refactor: keep DynamicGroup internal while stabilizing - #16811

Merged
jaeone94 merged 1 commit into
masterfrom
jaeone94/dynamic-group-private
Oct 6, 2026
Merged

jaeone94 merged 1 commit into
masterfrom
jaeone94/dynamic-group-private

Conversation

@jaeone94

@jaeone94 jaeone94 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Keep DynamicGroup out of the public node-authoring API while it is being stabilized. Built-in nodes and contract tests can still use the internal implementation, and registered nodes keep the same input and execution format.

Summary

  • Rename the implementation to _DynamicGroup and remove its public export. io.DynamicGroup / IO.DynamicGroup are no longer available through latest or its versioned adapter; no public compatibility alias is retained.
  • Preserve COMFY_DYNAMICGROUP_V3, schema expansion, validation, row reconstruction and execution behavior. This does not hide registered nodes from /object_info or block prompt submission by CLI, MCP or other clients.
  • Move the existing contract and execution tests to the internal class and verify both public API entry points omit it. The internal API is explicitly unstable; this is an API boundary, not access control against deliberate private imports.

Companion changes

Provenance

  • Authored by: interactive session
  • Verified: the two public-export regression cases failed before the change. python -m pytest tests-unit/comfy_api_test/io_dynamic_group_test.py tests-unit/execution_test/dynamic_group_test.py tests-unit/execution_test/dynamic_inputs_test.py -q: 120 passed with Python 3.12 on CPU. Ruff passed for all three changed Python files.
  • Deviations: none in the requested API-visibility scope. Complete agent/CLI integration and native LoRA rollout remain separate work.

@coderabbitai

ghost commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 94c703ba-6ac7-41bf-b4f9-947b5517ac2f
📥 Commits

Reviewing files that changed from the base of the PR and between 7c8fbc6 and 73867fd.

📒 Files selected for processing (3)
  • comfy_api/latest/_io.py
  • tests-unit/comfy_api_test/io_dynamic_group_test.py
  • tests-unit/execution_test/dynamic_group_test.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (windows-2022)
  • GitHub Check: test
  • GitHub Check: test (windows-latest)
  • GitHub Check: test (macos-latest)
  • GitHub Check: Run Pylint
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (macos-latest)
  • GitHub Check: Run Pylint
🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — configured
📓 Path-based instructions (2)
IMPORTANT: Only comment on issues directly introduced by this PR's code changes.

⚙️ CodeRabbit configuration file

Files:

  • tests-unit/execution_test/dynamic_group_test.py
  • comfy_api/latest/_io.py
  • tests-unit/comfy_api_test/io_dynamic_group_test.py
Source excerpt: Keep changes small and direct.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • tests-unit/execution_test/dynamic_group_test.py
  • comfy_api/latest/_io.py
  • tests-unit/comfy_api_test/io_dynamic_group_test.py

📝 Walkthrough

Walkthrough

The dynamic-group class is renamed to _DynamicGroup and removed from the module’s public exports. Internal implementation references and tests now use the renamed type. A new test checks that neither name is exposed through the latest or v0_0_2 public IO modules. Existing dynamic-group test expectations remain unchanged.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 73867

The public export is intentionally removed, and in-repository runtime code uses the internal implementation; no concrete merge-blocking regression is identified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 73867

The change removes a public API symbol without a compatibility alias, so external integrations using that symbol may require updates. The registered input format, validation limits, and execution dispatch are preserved. Making the class internal is an API-support boundary, not an access-control mechanism.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected change contracts Python API availability rather than adding a new prompt-dispatch capability. Existing dynamic-input dispatch remains registered under the same identifier; the comparison identifies no new caller or authority-bearing sink.

Trust Boundaries and Controls

  • observed — The internal implementation remains directly importable, as demonstrated by the updated tests. Removing it from public exports establishes an API-support boundary, not authentication, authorization, or isolation against code that deliberately imports private modules.

Resilience and Maintainability Implications

  • observed — The existing failure-containment ordering is preserved: malformed keys and row-limit violations are rejected before row-path expansion. Reconstruction works on a copy of input values and preserves empty groups and sparse positions. The PR adds no new persistent state transition or recovery protocol.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 33 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: keeping DynamicGroup internal while it is being stabilized.
Description check ✅ Passed The description explains the API visibility change, preserved behavior, test updates, and verification results. It is directly related to the changeset.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants