Skip to content

fix: correct operator precedence in install command validation#365

Merged
bigcat88 merged 2 commits intoComfy-Org:mainfrom
Xyc2016:fix-specify-commit
Mar 11, 2026
Merged

fix: correct operator precedence in install command validation#365
bigcat88 merged 2 commits intoComfy-Org:mainfrom
Xyc2016:fix-specify-commit

Conversation

@Xyc2016
Copy link
Contributor

@Xyc2016 Xyc2016 commented Feb 17, 2026

Fixed issue #335: --pr cannot be used with --version or --commit

The condition "pr and version not in {None, "nightly"} or commit" was evaluated incorrectly due to operator precedence. Added parentheses to ensure the logic only triggers error when --pr is actually combined with conflicting flags, not when only --commit is specified.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #365      +/-   ##
==========================================
+ Coverage   52.49%   52.52%   +0.02%     
==========================================
  Files          32       32              
  Lines        3568     3568              
==========================================
+ Hits         1873     1874       +1     
+ Misses       1695     1694       -1     
Files with missing lines Coverage Δ
comfy_cli/cmdline.py 49.79% <100.00%> (+0.40%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Fixed issue Comfy-Org#335: --pr cannot be used with --version or --commit

The condition "pr and version not in {None, \"nightly\"} or commit" was
evaluated incorrectly due to operator precedence. Added parentheses
to ensure the logic only triggers error when --pr is actually combined
with conflicting flags, not when only --commit is specified.

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

Ensures that using --commit with --version nightly (without --pr)
does not falsely trigger the "--pr cannot be used" error.
Copilot AI review requested due to automatic review settings March 11, 2026 13:50
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Mar 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes install command flag validation to correctly apply operator precedence so --commit no longer triggers a --pr conflict unless --pr is actually provided (issue #335).

Changes:

  • Add parentheses to the --pr/--version/--commit conflict condition in install.
  • Add a regression test ensuring --commit without --pr does not emit the --pr conflict error and still calls install execution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
comfy_cli/cmdline.py Fixes boolean condition precedence in install flag conflict validation.
tests/comfy_cli/command/github/test_pr.py Adds regression test coverage for issue #335 (--commit without --pr).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@bigcat88 bigcat88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good - merging.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 11, 2026
@bigcat88 bigcat88 merged commit 749ea1f into Comfy-Org:main Mar 11, 2026
15 checks passed
@Xyc2016 Xyc2016 deleted the fix-specify-commit branch March 11, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants