fix: orchcli init now clones repos in user's current directory#32
fix: orchcli init now clones repos in user's current directory#32mohit-nagaraj merged 5 commits intomainfrom
Conversation
- Added config management system to track project locations - Store project paths in orchcli-config.json next to executable - All commands (start, stop, logs, etc.) now use config to find projects - Support for multiple projects in different directories - Repos are cloned in user's current directory, not CLI install location Fixes permission issues and enables proper project organization
- Renamed configuration-related functions to use PascalCase for consistency - Adjusted directory and file permission settings for improved security - Simplified conditional logic in various functions for better readability - Updated tests to reflect changes in function names and configurations
There was a problem hiding this comment.
Summary of Changes
Hello @mohit-nagaraj, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses a critical issue in orchcli init where repositories were incorrectly cloned into the CLI's installation directory, leading to permission problems and hindering multi-project management. The core change introduces a robust configuration management system that ensures repositories are cloned into the user's current working directory and allows for tracking and managing multiple development projects. This significantly improves the user experience by providing proper project isolation and persistent configuration.
Highlights
- Corrected Repository Cloning Location: orchcli init now clones UI and Core repositories into the user's current working directory instead of the CLI's installation path, resolving permission issues and enabling proper project management.
- Introduced Configuration Management System: A new system tracks project locations and settings in a orchcli-config.json file, supporting multiple projects and their respective UI/Core paths and development modes.
- Updated Core Commands: All orchcli commands (start, stop, logs, status, restart) have been updated to leverage the new configuration system, ensuring they operate correctly within the context of the active project.
- Improved User Experience: The changes facilitate managing multiple orchcli projects from different directories and provide clearer output regarding project initialization.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request effectively resolves the issue of orchcli init cloning repositories into the wrong directory by introducing a robust configuration management system. The changes correctly use the user's current working directory for new projects and store project-specific paths in a configuration file. This allows for managing multiple projects and makes the CLI's behavior predictable. The updates to other commands (start, stop, etc.) to use this new configuration system are well-implemented and consistent. My review includes a critical point about preventing race conditions when modifying the configuration file and suggestions to improve the newly added unit tests to ensure they are testing the intended functionality.
- Standardized directory permission settings using constants for better readability - Enhanced error handling in directory creation functions - Updated comments for clarity and future use of the removeProjectConfig function
fc59c8a to
3313a52
Compare
- Implement file locking using github.com/gofrs/flock - Protect config read-modify-write operations from race conditions - Add comprehensive tests for concurrent config access - Ensure atomic writes to prevent data corruption
- Refactor config tests to use actual SaveConfig/LoadConfig functions - Fix unchecked error returns from fileLock.Unlock() - Format test files with gofmt -s - Update test workflow to use Go 1.22 only
What this PR does / why we need it:
This PR fixes a critical issue where
orchcli initwas cloning repositories (UI and Core) into the CLI'sinstallation directory (e.g.,
/usr/local/bin/) instead of the user's current working directory. This causedpermission issues, prevented managing multiple projects, and led to unexpected behavior.
The PR introduces a configuration management system that:
start,stop,logs,status,restart) to use the configurationWhich issue(s) this PR fixes:
Fixes #31
Special notes for your reviewer:
orchcli-config.json) is stored next to the orchcli executable or in~/.orchcli/as a fallbackorchcli-config.jsonto.gitignoreto prevent committing local configurationsChecklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
update if it's a user facing feature / API change.
Release note: