Skip to content

Conversation

@zhravan
Copy link
Collaborator

@zhravan zhravan commented Dec 6, 2025

Issue

Link to related issue(s):


Description

Short summary of what this PR changes or introduces.


Scope of Change

Select all applicable areas impacted by this PR:

  • View (UI/UX)
  • API
  • CLI
  • Infra / Deployment
  • Docs
  • Other (specify): ________

Screenshot / Video / GIF (if applicable)

Attach or embed screenshots, screen recordings, or GIFs demonstrating the feature or fix.


Related PRs (if any)

Link any related or dependent PRs across repos.


Additional Notes for Reviewers (optional)

Anything reviewers should know before testing or merging (e.g., environment variables, setup steps).


Developer Checklist

To be completed by the developer who raised the PR.

  • Add valid/relevant title for the PR
  • Self-review done
  • Manual dev testing done
  • No secrets exposed
  • No merge conflicts
  • Docs added/updated (if applicable)
  • Removed debug prints / secrets / sensitive data
  • Unit / Integration tests passing
  • Follows all standards defined in Nixopus Docs

Reviewer Checklist

To be completed by the reviewer before merge.

  • Peer review done
  • No console.logs / fmt.prints left
  • No secrets exposed
  • If any DB migrations, migration changes are verified
  • Verified release changes are production-ready

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Updated PostgreSQL driver to use Simple Protocol for improved compatibility.
    • Fixed API Dockerfile installation to prevent post-install script execution issues.
  • Improvements

    • Enhanced extension loader with batch progress logging (displays "Processed X/Y extensions").
    • Updated Docker Compose configuration for improved service dependency management.
    • Release date metadata updated.
  • Chores

    • Streamlined CLI command structure.
    • Reorganized internal utilities and configuration management.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Extensive CLI refactoring removes class-based command implementations (preflight, clone, conflict, conf, service, proxy, test) and replaces them with modular, function-based utilities. The install command is enhanced with external database URL and staging parameters, while utilities are restructured from monolithic classes to stateless functions. Docker compose files and versioning are updated accordingly.

Changes

Cohort / File(s) Summary
CLI Command Removals
cli/app/commands/clone/command.py, cli/app/commands/clone/messages.py, cli/app/commands/conf/base.py, cli/app/commands/conf/command.py, cli/app/commands/conf/delete.py, cli/app/commands/conf/list.py, cli/app/commands/conf/messages.py, cli/app/commands/conf/set.py, cli/app/commands/conflict/command.py, cli/app/commands/conflict/conflict.py, cli/app/commands/conflict/messages.py, cli/app/commands/conflict/models.py, cli/app/commands/preflight/command.py, cli/app/commands/preflight/deps.py, cli/app/commands/preflight/messages.py, cli/app/commands/preflight/port.py, cli/app/commands/preflight/run.py, cli/app/commands/proxy/base.py, cli/app/commands/proxy/command.py, cli/app/commands/proxy/load.py, cli/app/commands/proxy/messages.py, cli/app/commands/proxy/status.py, cli/app/commands/proxy/stop.py, cli/app/commands/service/base.py, cli/app/commands/service/command.py, cli/app/commands/service/down.py, cli/app/commands/service/messages.py, cli/app/commands/service/ps.py, cli/app/commands/service/restart.py, cli/app/commands/service/up.py, cli/app/commands/test/command.py, cli/app/commands/test/messages.py, cli/app/commands/test/test.py, cli/app/commands/uninstall/command.py
Removed entire class-based CLI command implementations for clone, conf, conflict, preflight, proxy, service, test, and partial uninstall; removed associated command builders, formatters, services, data models, and message constants.
New Utility Modules
cli/app/commands/conf/conf.py, cli/app/commands/install/config_schema.py, cli/app/commands/install/config_utils.py, cli/app/commands/install/environment.py, cli/app/commands/install/services.py, cli/app/commands/install/validate.py, cli/app/commands/preflight/preflight.py, cli/app/commands/proxy/proxy.py, cli/app/commands/service/service.py, cli/app/utils/directory_manager.py, cli/app/utils/file_manager.py, cli/app/utils/host_information.py, cli/app/utils/parallel_processor.py, cli/app/utils/supported.py
Introduced modular, function-based utilities for environment file management, port/dependency checking, proxy configuration loading, Docker service orchestration, and host/file/directory operations replacing class-based implementations.
Install Command Refactoring
cli/app/commands/install/base.py, cli/app/commands/install/command.py, cli/app/commands/install/deps.py, cli/app/commands/install/development.py, cli/app/commands/install/run.py, cli/app/commands/install/ssh.py
Extensively refactored install command to use functional utilities, added external_db_url and staging parameters, restructured config management and environment setup, and replaced class-based SSH operations with function-based alternatives.
Uninstall/Update Command Refactoring
cli/app/commands/uninstall/uninstall.py, cli/app/commands/uninstall/messages.py, cli/app/commands/uninstall/run.py, cli/app/commands/update/command.py, cli/app/commands/update/run.py, cli/app/commands/update/update.py
Removed old command modules and introduced new function-based implementations with Typer integration and enhanced messaging.
Version Command Refactoring
cli/app/commands/version/command.py, cli/app/commands/version/version.py
Replaced class-based VersionCommand with functional get_version() and run_version() utilities supporting both package metadata and fallback version.txt reading.
Utility Layer Refactoring
cli/app/utils/config.py, cli/app/utils/lib.py, cli/app/utils/logger.py, cli/app/utils/output_formatter.py, cli/app/utils/timeout.py
Decomposed monolithic utility classes (Config, HostInformation, ParallelProcessor, DirectoryManager, FileManager, Logger, OutputFormatter, TimeoutWrapper) into focused functional modules with stateless operations.
CLI Main & Build
cli/app/main.py, cli/build.sh, cli/Makefile
Updated main.py to import from new module paths, removed registration of eliminated commands, updated build spec hiddenimports, and removed Makefile targets (conflict, preflight).
Docker & Compose Configuration
docker-compose.yml, docker-compose-staging.yml, api/Dockerfile
Updated Dockerfile APK installation to include --no-scripts flag, simplified docker-compose port bindings (host:fixed-container mapping), adjusted service dependencies, introduced Redis and SuperTokens services, and modified database volume configuration.
Configuration & Documentation
api/api/versions.json, api/internal/features/extension/loader/loader.go, api/internal/storage/config.go, cli/app/commands/test/__init__.py, cli/pyproject.toml, docs/cli/cli-reference.md, scripts/install.sh
Updated version timestamp, refactored logging patterns in extension loader, configured PostgreSQL simple protocol, bumped CLI version to 0.1.29, pruned CLI documentation, and simplified install script help text.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Areas requiring extra attention:

  • Install command refactoring (cli/app/commands/install/*): Complex orchestration of new functions, config resolution via ConfigResolver, environment variable management, and interaction with external utilities; verify all parameter flows through multiple layers.
  • Utility decomposition (cli/app/utils/config.py, cli/app/utils/logger.py, cli/app/utils/output_formatter.py): Significant reorganization from classes to functions; verify state management removed correctly, signature compatibility maintained across new functional APIs, and error handling paths preserved.
  • Docker compose changes: Port binding semantics altered (host:fixed-container); verify backward compatibility and no unintended service port conflicts.
  • Removed CLI commands: Ensure no orphaned references to deleted modules (clone, conf, conflict, preflight, proxy, service, test) remain in other parts of codebase.
  • SSH refactoring (cli/app/commands/install/ssh.py): Conversion from class-based to function-based with multiple helper steps; verify key generation, permissions, and authorized_keys logic flows correctly.
  • Config schema introduction (cli/app/commands/install/config_schema.py): New central configuration registry; verify all port and env var mappings are correct and utilized consistently.

Possibly related PRs

  • PR #643: Performs identical SSH utility refactor (class-based to function-based) in parallel with this PR.
  • PR #508: Previous install command refactoring; this PR extends and reorganizes similar patterns.
  • PR #322: Introduced the conflict CLI feature that is now being removed in this PR.

Poem

🐰 Classes to functions, the refactor runs deep,
Commands consolidated, utilities leap,
Config and logging now stateless and neat,
Docker and services dance to the beat,
From monolith layers to modular sight!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/refactor/cli

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5fd69f and 4ff6dc0.

📒 Files selected for processing (81)
  • api/Dockerfile (2 hunks)
  • api/api/versions.json (1 hunks)
  • api/internal/features/extension/loader/loader.go (1 hunks)
  • api/internal/storage/config.go (1 hunks)
  • cli/Makefile (0 hunks)
  • cli/app/commands/clone/clone.py (2 hunks)
  • cli/app/commands/clone/command.py (0 hunks)
  • cli/app/commands/clone/messages.py (0 hunks)
  • cli/app/commands/conf/base.py (0 hunks)
  • cli/app/commands/conf/command.py (0 hunks)
  • cli/app/commands/conf/conf.py (1 hunks)
  • cli/app/commands/conf/delete.py (0 hunks)
  • cli/app/commands/conf/list.py (0 hunks)
  • cli/app/commands/conf/messages.py (0 hunks)
  • cli/app/commands/conf/set.py (0 hunks)
  • cli/app/commands/conflict/command.py (0 hunks)
  • cli/app/commands/conflict/conflict.py (0 hunks)
  • cli/app/commands/conflict/messages.py (0 hunks)
  • cli/app/commands/conflict/models.py (0 hunks)
  • cli/app/commands/install/base.py (3 hunks)
  • cli/app/commands/install/command.py (9 hunks)
  • cli/app/commands/install/config_schema.py (1 hunks)
  • cli/app/commands/install/config_utils.py (1 hunks)
  • cli/app/commands/install/deps.py (5 hunks)
  • cli/app/commands/install/development.py (15 hunks)
  • cli/app/commands/install/environment.py (1 hunks)
  • cli/app/commands/install/run.py (18 hunks)
  • cli/app/commands/install/services.py (1 hunks)
  • cli/app/commands/install/ssh.py (2 hunks)
  • cli/app/commands/install/validate.py (1 hunks)
  • cli/app/commands/preflight/command.py (0 hunks)
  • cli/app/commands/preflight/deps.py (0 hunks)
  • cli/app/commands/preflight/messages.py (1 hunks)
  • cli/app/commands/preflight/port.py (0 hunks)
  • cli/app/commands/preflight/preflight.py (1 hunks)
  • cli/app/commands/preflight/run.py (0 hunks)
  • cli/app/commands/proxy/base.py (0 hunks)
  • cli/app/commands/proxy/command.py (0 hunks)
  • cli/app/commands/proxy/load.py (0 hunks)
  • cli/app/commands/proxy/messages.py (1 hunks)
  • cli/app/commands/proxy/proxy.py (1 hunks)
  • cli/app/commands/proxy/status.py (0 hunks)
  • cli/app/commands/proxy/stop.py (0 hunks)
  • cli/app/commands/service/base.py (0 hunks)
  • cli/app/commands/service/command.py (0 hunks)
  • cli/app/commands/service/down.py (0 hunks)
  • cli/app/commands/service/messages.py (1 hunks)
  • cli/app/commands/service/ps.py (0 hunks)
  • cli/app/commands/service/restart.py (0 hunks)
  • cli/app/commands/service/service.py (1 hunks)
  • cli/app/commands/service/up.py (0 hunks)
  • cli/app/commands/test/__init__.py (0 hunks)
  • cli/app/commands/test/command.py (0 hunks)
  • cli/app/commands/test/messages.py (0 hunks)
  • cli/app/commands/test/test.py (0 hunks)
  • cli/app/commands/uninstall/command.py (0 hunks)
  • cli/app/commands/uninstall/messages.py (0 hunks)
  • cli/app/commands/uninstall/run.py (0 hunks)
  • cli/app/commands/uninstall/uninstall.py (1 hunks)
  • cli/app/commands/update/command.py (0 hunks)
  • cli/app/commands/update/run.py (0 hunks)
  • cli/app/commands/update/update.py (1 hunks)
  • cli/app/commands/version/command.py (1 hunks)
  • cli/app/commands/version/version.py (0 hunks)
  • cli/app/main.py (2 hunks)
  • cli/app/utils/config.py (2 hunks)
  • cli/app/utils/directory_manager.py (1 hunks)
  • cli/app/utils/file_manager.py (1 hunks)
  • cli/app/utils/host_information.py (1 hunks)
  • cli/app/utils/lib.py (0 hunks)
  • cli/app/utils/logger.py (1 hunks)
  • cli/app/utils/output_formatter.py (1 hunks)
  • cli/app/utils/parallel_processor.py (1 hunks)
  • cli/app/utils/supported.py (1 hunks)
  • cli/app/utils/timeout.py (1 hunks)
  • cli/build.sh (1 hunks)
  • cli/pyproject.toml (1 hunks)
  • docker-compose-staging.yml (5 hunks)
  • docker-compose.yml (2 hunks)
  • docs/cli/cli-reference.md (1 hunks)
  • scripts/install.sh (1 hunks)

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

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

@raghavyuva raghavyuva marked this pull request as ready for review December 7, 2025 18:12
@raghavyuva raghavyuva merged commit d0f813f into master Dec 7, 2025
6 of 7 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.

3 participants