Skip to content
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

feat(commands): add a repository update command #20

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

steveiliop56
Copy link
Collaborator

@steveiliop56 steveiliop56 commented Feb 4, 2024

Summary by CodeRabbit

  • New Features
    • Introduced a new command for updating the app store repository, enhancing the application's maintainability.
  • Bug Fixes
    • Improved the user interface by fixing the formatting of the welcome message in the CLI.

Copy link
Contributor

coderabbitai bot commented Feb 4, 2024

Walkthrough

The update introduces a new feature to the Runtipi CLI, allowing users to update their app store repository directly through a new RepoUpdate command. This enhancement involves adding a new command variant, updating the command module list, implementing the update functionality using Git, and refining the CLI's welcome message for a cleaner user experience.

Changes

File Path Change Summary
src/args.rs Added RepoUpdate variant to RuntipiMainCommand enum.
src/commands/... Added repo_update module; Implemented repository update functionality.
src/main.rs Updated welcome message; Integrated RepoUpdate command with its function.

🐇✨
In the world of code, a rabbit hopped,
Bringing updates, where it stopped.
"Repo's fresh," it cheerily said,
With every pull, ahead we tread.
🌟🐾

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit-tests for this file.
  • 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 generate unit tests for this file.
    • @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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b1fb880 and 8335943.
Files selected for processing (4)
  • src/args.rs (1 hunks)
  • src/commands/mod.rs (1 hunks)
  • src/commands/repo_update.rs (1 hunks)
  • src/main.rs (2 hunks)
Additional comments: 3
src/commands/mod.rs (1)
  • 6-6: The addition of the repo_update module is correctly implemented.
src/main.rs (1)
  • 41-43: The integration of the RepoUpdate command is correctly implemented.
src/args.rs (1)
  • 53-54: The addition of the RepoUpdate variant to the RuntipiMainCommand enum is correctly implemented.

src/commands/repo_update.rs Show resolved Hide resolved
let repo_id = env::get_env_value("APPS_REPO_ID").unwrap_or("29ca930bfdaffa1dfabf5726336380ede7066bc53297e3c0c868b27c97282903".to_string());
let path = format!("repos/{}", repo_id);
let repo_path = Path::new(&path);
set_current_dir(&repo_path).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace unwrap() with proper error handling to avoid potential panics if changing the current directory fails.

src/commands/repo_update.rs Show resolved Hide resolved
@JigSawFr
Copy link

JigSawFr commented Feb 4, 2024

Should refactor to:
repo add
repo del
repo update
Repo upgrade (force fetch all)

@steveiliop56
Copy link
Collaborator Author

Shhh to much stuff. Maybe in a next update.

@nicotsx nicotsx force-pushed the main branch 2 times, most recently from b7c48e5 to 080f72c Compare February 16, 2024 21:34
@nicotsx nicotsx changed the base branch from main to develop March 8, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants