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

Add CI #14

Merged
merged 22 commits into from
Mar 15, 2024
Merged

Add CI #14

merged 22 commits into from
Mar 15, 2024

Conversation

mmena1
Copy link
Owner

@mmena1 mmena1 commented Mar 15, 2024

Resolves #13, closes #3

Summary by CodeRabbit

  • New Features

    • Introduced a GitHub Actions workflow for setup validation.
    • Enhanced user interaction with a new prompt function for streamlined input handling across various setup scripts.
    • Added conditional logic for setting email addresses and executing scripts based on the "dev" environment variable.
    • Implemented checks for existing configurations (e.g., Fira Code fonts, SSH keys) to improve user experience by avoiding redundant setups.
    • Enabled passwordless sudo access under specific conditions for convenience.
  • Bug Fixes

    • Updated .gitignore to correctly ignore certain bookmark paths.
  • Documentation

    • Updated README.md with a new GitHub Actions workflow badge.
  • Refactor

    • Unified user input handling across scripts for installing tools like tmux, Docker, VSCode, GitHub CLI, and others by replacing direct read calls with a new prompt function.
    • Modified template invocations to pass additional context data or parameters, enhancing the script execution process.

@mmena1 mmena1 self-assigned this Mar 15, 2024
Copy link
Contributor

coderabbitai bot commented Mar 15, 2024

Warning

Rate Limit Exceeded

@mmena1 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 19 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 579b636 and ef802ed.

Walkthrough

The repository underwent significant enhancements, focusing on automation and user experience improvements. A GitHub Actions workflow was introduced for validation, .gitignore was updated, and various scripts were modified to streamline installation processes and user interactions. These changes aim to provide an unattended installation option and ensure setup integrity through automated checks.

Changes

Files Change Summary
.github/workflows/main.yml Introduced GitHub Actions workflow for setup validation.
.gitignore Updated path pattern for ignoring **/gtk-3.0/bookmarks.
home/.../.chezmoi.toml.tmpl Added conditional logic for email based on "dev" env variable.
home/.../.chezmoiscripts/..., home/.../.chezmoitemplates/common Enhanced scripts with conditional logic, improved prompting, and template adjustments.
README.md Added workflow badge.

Assessment against linked issues

Objective Addressed Explanation
Add GitHub actions workflow to make sure the setup works correctly (#13)
Option for unattended script that installs the default config without prompting the user. (#3) The changes, especially around conditional logic and environment variables, allow for an unattended installation option.

Poem

To the rhythm of code, under the moon's glow,
Changes were made, letting automation flow.
No more shall we wait, for prompts to dictate,
Our setup's fate, it's now first-rate. 🌟
With a hop and a skip, in the repository's ship,
We sail into the dawn, with no reason to yawn. 🚀
Cheers to the bits, in harmony, they knit.

  • 🐰 CodeRabbit, with a tip of the hat.

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.
    • 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 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 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: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2f9b3ef and e535d2d.
Files selected for processing (21)
  • .github/workflows/main.yml (1 hunks)
  • .gitignore (1 hunks)
  • home/.chezmoi.toml.tmpl (1 hunks)
  • home/.chezmoiscripts/run_after_99-finish.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_before_00-intro.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_00-passwordless_sudo.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_01-tmux-conf.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl (3 hunks)
  • home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_07_vscode-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_08-starship-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_98-darwin-add-fish-to-shells.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_before_01-install-homebrew.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_onchange_darwin-install-packages.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl (1 hunks)
  • home/.chezmoitemplates/common (1 hunks)
Files skipped from review due to trivial changes (4)
  • home/.chezmoiscripts/run_after_99-finish.sh.tmpl
  • home/.chezmoiscripts/run_once_after_01-tmux-conf.sh.tmpl
  • home/.chezmoiscripts/run_once_after_07_vscode-setup.sh.tmpl
  • home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl
Additional comments: 33
.gitignore (1)
  • 3-3: The update to the .gitignore file to modify the path pattern for ignoring **/gtk-3.0/bookmarks is appropriate and makes the ignore rule more inclusive.
home/.chezmoiscripts/run_once_after_08-starship-setup.sh.tmpl (1)
  • 3-3: Passing the current context to the template invocation enhances the flexibility and usability of the template. This is a good practice in templating.
home/.chezmoiscripts/run_onchange_darwin-install-packages.sh.tmpl (1)
  • 3-3: Passing the current context to the template invocation is a good practice, ensuring that the template has access to the entire context for dynamic rendering.
home/.chezmoiscripts/run_once_after_98-darwin-add-fish-to-shells.sh.tmpl (1)
  • 3-3: Passing the current context to the template invocation is consistent with best practices and enhances the script's flexibility. The change is appropriate.
home/.chezmoiscripts/run_before_00-intro.sh.tmpl (1)
  • 1-21: The introduction of conditional logic based on the "dev" environment variable and the standardization of user input handling through the prompt function are positive changes that improve the script's flexibility and user experience.
home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl (1)
  • 1-10: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-25]

The conditional inclusion of the common template and the standardization of user input handling through the prompt function are positive changes that enhance the script's usability and maintainability.

home/.chezmoiscripts/run_once_before_01-install-homebrew.sh.tmpl (1)
  • 3-3: The standardization of user input handling through the prompt function for installing Homebrew is a positive change that enhances the script's usability and maintainability.
home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (3)
  • 3-3: The inclusion of the prompt function for handling user input is a good practice, enhancing the script's usability and maintainability.
  • 8-8: Please ensure the prompt function is thoroughly tested, especially its integration within this script and its behavior across different scenarios.
  • 8-8: Verify the conditional logic for different OS distributions (linux-debian) to ensure the installation steps are correctly executed.
home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (2)
  • 7-7: Adding a check for Fira Code installation before proceeding is a good improvement, avoiding unnecessary operations if the font is already installed.
  • 8-8: Ensure the prompt function and the new check for Fira Code installation are thoroughly tested to confirm their correct functionality.
.github/workflows/main.yml (4)
  • 1-1: The introduction of the "Chezmoi Setup Validation" GitHub Actions workflow is a significant enhancement for automating the validation of the setup process.
  • 3-7: The decision to exclude 'LICENSE' and 'README.md' from triggering the workflow is sensible, focusing CI resources on meaningful changes.
  • 21-26: The use of caching for asdf tools is a good practice, potentially improving CI run times by avoiding unnecessary downloads.
  • 31-31: Ensure the chezmoi initialization step with the current branch content is correctly functioning and effectively validates the setup process.
home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (3)
  • 3-3: The inclusion of the prompt function for handling user input in the GitHub CLI setup script enhances usability and maintainability.
  • 8-8: Please ensure the prompt function is thoroughly tested, especially its integration within this script and its behavior across different scenarios.
  • 8-8: Verify the conditional logic for different OS distributions (linux-debian) to ensure the installation steps are correctly executed for the GitHub CLI.
home/.chezmoitemplates/common (3)
  • 20-20: The addition of default message parameters to the ok() function and similar updates to other functions enhance script readability and usability.
  • 44-44: The introduction of the prompt function is a significant improvement, centralizing and standardizing user input handling across scripts.
  • 44-44: Ensure the prompt function and updates to existing functions are thoroughly tested to confirm their correct functionality and integration.
home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl (3)
  • 1-1: The introduction of conditional logic based on the "dev" environment variable and the use of the prompt function for SSH keys setup enhance script flexibility and user interaction.
  • 8-8: Ensure the prompt function and the conditional logic for SSH keys setup are thoroughly tested, especially their integration within this script and their behavior across different scenarios.
  • 24-24: Verify the conditional logic for adding the public SSH key to a GitHub account, ensuring it correctly functions when the GitHub CLI is available.
home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (3)
  • 3-3: The inclusion of the prompt function for handling user input in the 1password setup script enhances usability and maintainability.
  • 8-8: Please ensure the prompt function is thoroughly tested, especially its integration within this script and its behavior across different scenarios.
  • 8-8: Verify the conditional logic for different OS distributions (linux-debian) to ensure the installation steps are correctly executed for 1password.
home/.chezmoiscripts/run_once_after_00-passwordless_sudo.sh.tmpl (3)
  • 1-1: The introduction of conditional logic based on the "dev" environment variable and the use of the prompt function for enabling passwordless sudo enhance script flexibility and user interaction.
  • 4-4: Ensure the checks for valid LOGNAME characters, sudo access, and existing sudoers configuration are thoroughly tested to confirm their correct functionality.
  • 20-20: Verify the prompt function's integration within this script, especially its behavior in different scenarios related to enabling passwordless sudo.
home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl (2)
  • 7-7: The introduction of the prompt function for user input in install_asdf enhances user experience and consistency across scripts. Good improvement.
  • 31-31: The use of the prompt function for user input in install_asdf_tools is a consistent and user-friendly improvement. Nicely done.

home/.chezmoi.toml.tmpl Show resolved Hide resolved
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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e535d2d and 9cf8d3d.
Files selected for processing (1)
  • home/.chezmoiscripts/run_once_after_00-passwordless_sudo.sh.tmpl (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • home/.chezmoiscripts/run_once_after_00-passwordless_sudo.sh.tmpl

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: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9cf8d3d and bab7ce2.
Files selected for processing (2)
  • README.md (1 hunks)
  • home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl
Additional comments: 1
README.md (1)
  • 3-3: The addition of the GitHub Actions workflow badge is a great way to provide immediate visibility into the build status of the project. This is a common best practice and enhances the README's utility.

README.md Show resolved Hide resolved
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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bab7ce2 and 94d0a94.
Files selected for processing (1)
  • home/.chezmoitemplates/common (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • home/.chezmoitemplates/common

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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 94d0a94 and 193711e.
Files selected for processing (6)
  • home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_onchange_darwin-install-packages.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl (1 hunks)
Files skipped from review as they are similar to previous changes (6)
  • home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl
  • home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl
  • home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl
  • home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl
  • home/.chezmoiscripts/run_onchange_darwin-install-packages.sh.tmpl
  • home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl

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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 193711e and 579b636.
Files selected for processing (5)
  • home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (1 hunks)
  • home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (2 hunks)
  • home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl
  • home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl
  • home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl
  • home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl
  • home/.chezmoiscripts/run_onchange_debian-install-packages.sh.tmpl

@mmena1 mmena1 merged commit 05cd2d2 into main Mar 15, 2024
1 check passed
@mmena1 mmena1 deleted the add-ci branch March 15, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant