Skip to content

feat: Add conflict command to differentiate versioning #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Aug 3, 2025

Conversation

shravan20
Copy link
Collaborator

@shravan20 shravan20 commented Jul 18, 2025

Sample :

ERROR: [
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "redis",
      "expected": ">=7.0.0, <8.0.0",
      "current": null,
      "status": "Tool not found",
      "conflict": true,
      "error": null
    },
    "error": "redis: Tool not found"
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "python3-venv",
      "expected": ">=3.8, <3.13",
      "current": "3.13.5",
      "status": "Version mismatch",
      "conflict": true,
      "error": null
    },
    "error": "python3-venv: Expected >=3.8, <3.13, Found 3.13.5"
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "python3",
      "expected": ">=3.8, <3.13",
      "current": "3.13.5",
      "status": "Version mismatch",
      "conflict": true,
      "error": null
    },
    "error": "python3: Expected >=3.8, <3.13, Found 3.13.5"
  },
  {
    "success": true,
    "message": "git: Version compatible (2.50.1)",
    "data": {
      "tool": "git",
      "expected": ">=2.30.0, <3.0.0",
      "current": "2.50.1",
      "status": "Version compatible",
      "conflict": false,
      "error": null
    },
    "error": null
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "openssh-server",
      "expected": ">=8.0, <10.0",
      "current": null,
      "status": "Tool not found",
      "conflict": true,
      "error": null
    },
    "error": "openssh-server: Tool not found"
  },
  {
    "success": true,
    "message": "openssl: Version compatible (3.5.1)",
    "data": {
      "tool": "openssl",
      "expected": ">=1.1.1, <4.0.0",
      "current": "3.5.1",
      "status": "Version compatible",
      "conflict": false,
      "error": null
    },
    "error": null
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "open-ssh",
      "expected": ">=8.0, <10.0",
      "current": null,
      "status": "Tool not found",
      "conflict": true,
      "error": null
    },
    "error": "open-ssh: Tool not found"
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "curl",
      "expected": ">=7.80.0, <8.0.0",
      "current": "7.53.1",
      "status": "Version mismatch",
      "conflict": true,
      "error": null
    },
    "error": "curl: Expected >=7.80.0, <8.0.0, Found 7.53.1"
  },
  {
    "success": true,
    "message": "air: Version compatible (1.62.0)",
    "data": {
      "tool": "air",
      "expected": ">=1.40.0, <2.0.0",
      "current": "1.62.0",
      "status": "Version compatible",
      "conflict": false,
      "error": null
    },
    "error": null
  },
  {
    "success": true,
    "message": "go: Version compatible (1.24.3)",
    "data": {
      "tool": "go",
      "expected": ">=1.23.0, <2.0.0",
      "current": "1.24.3",
      "status": "Version compatible",
      "conflict": false,
      "error": null
    },
    "error": null
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "node",
      "expected": ">=18.0.0, <22.0.0",
      "current": "24.4.0",
      "status": "Version mismatch",
      "conflict": true,
      "error": null
    },
    "error": "node: Expected >=18.0.0, <22.0.0, Found 24.4.0"
  },
  {
    "success": false,
    "message": "",
    "data": {
      "tool": "poetry",
      "expected": ">=1.2.0, <2.0.0",
      "current": "2.1.3",
      "status": "Version mismatch",
      "conflict": true,
      "error": null
    },
    "error": "poetry: Expected >=1.2.0, <2.0.0, Found 2.1.3"
  }
]

Copy link

keploy bot commented Jul 18, 2025

No significant changes currently retry

Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@shravan20 shravan20 changed the title Feat/cli /conflict feat: Add conflict command to differentiate versioning Jul 18, 2025
@shravan20 shravan20 requested a review from Copilot July 18, 2025 19:10
Copy link

@Copilot 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

This PR adds a new conflict command to the nixopus CLI to check for tool version conflicts. The implementation includes comprehensive version checking, comparison logic, and configuration parsing capabilities.

  • Adds a new conflict command with comprehensive version checking for system tools
  • Updates dependency version specifications to use explicit version ranges
  • Improves error handling in service command

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
helpers/config.prod.yaml Updates dependency version specifications from simple values to explicit version ranges
cli/pyproject.toml Adds packaging dependency and updates requests version
cli/app/main.py Integrates conflict command into main CLI application
cli/app/commands/service/command.py Improves error handling with null check
cli/app/commands/conflict/tests/test_conflict.py Comprehensive test suite for conflict checking functionality
cli/app/commands/conflict/messages.py Message constants for conflict command
cli/app/commands/conflict/conflict.py Core conflict checking logic and version comparison
cli/app/commands/conflict/command.py CLI command implementation for conflict checking
cli/Makefile Enhanced Makefile with better documentation and convenience targets
Comments suppressed due to low confidence (2)

cli/app/commands/conflict/conflict.py:86

  • [nitpick] The tool name 'postgresql' maps to 'psql' command, but this is inconsistent with the dependency name 'postgres' that might be used in config files. Consider using 'postgres' as the key or adding both variants to handle common naming conventions.
                'postgresql': ['psql', '--version'],

cli/app/commands/conflict/tests/test_conflict.py:158

  • The test covers basic version requirement parsing but doesn't test edge cases like invalid version formats, malformed requirements, or boundary conditions. Consider adding tests for error handling and edge cases.
        self.assertEqual(checker.parse_version_requirement("^1.20.0"), ">=1.20.0, <2.0.0")

@conflict_app.callback(invoke_without_command=True)
def conflict_callback(
ctx: typer.Context,
config_file: str = typer.Option("helpers/config.prod.yaml", "--config-file", "-c", help="Path to configuration file"),
Copy link
Owner

Choose a reason for hiding this comment

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

use config to load this default option

@shravan20 shravan20 requested a review from raghavyuva August 3, 2025 05:20
try:
logger.info(checking_conflicts_info)

config = ConflictConfig(
Copy link
Owner

Choose a reason for hiding this comment

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

make use of the timeout wrapper here like other commands instead of passing the timeout variable

@shravan20 shravan20 requested a review from raghavyuva August 3, 2025 14:00
@raghavyuva raghavyuva merged commit 627cbbe into raghavyuva:feat/cli Aug 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants