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

Fix Clean.sh issue across projects (#9297) #9298

Conversation

ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented Nov 20, 2024

This closes #9297

Summary by CodeRabbit

Release Notes

  • New Features

    • Added options for "AzureBlobStorage" and "Other" in file storage and database selections within the Bit Boilerplate template.
    • Included shell script files in the template configuration for better project setup.
  • Improvements

    • Enhanced clarity and readability of comments in various cleaning scripts.
    • Updated instructions for Windows developers to run a bash script when opening the project in a container.

These updates improve user experience and flexibility in project configuration.

@ysmoradi ysmoradi requested a review from msynk November 20, 2024 11:43
Copy link

coderabbitai bot commented Nov 20, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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.

Walkthrough

The changes involve modifications to several Clean.sh scripts across different directories, focusing on enhancing clarity and consistency in comments without altering functionality. Additionally, the template.json file in the Boilerplate template has been updated to include new options for file storage and database selection, as well as refined file inclusion and exclusion logic. A new instruction has also been added to a Razor page to guide Windows developers on running a bash script when setting up the project in a container.

Changes

File Path Change Summary
src/BlazorUI/Clean.sh Comments modified for clarity and consistency; no functional changes.
src/Clean.sh Comments updated for clarity; list of directories and files to delete modified; no functional changes.
src/Templates/BlazorEmpty/Bit.BlazorEmpty/Clean.sh Comments rephrased for brevity and clarity; no functional changes.
src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json Added options for "AzureBlobStorage" and "Other"; updated file inclusion logic; refined exclusions.
src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor New instruction added for Windows developers to run a bash script in Docker; no other changes.

Assessment against linked issues

Objective Addressed Explanation
Boilerplate project template Clean.sh file is corrupt (9297)

🐰 In the meadow, scripts do gleam,
Comments polished, like a dream.
Azure options now take flight,
Clean commands shine so bright!
For Windows folks, a bash to run,
Setting up projects just got fun! 🌼


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>, please review it.
    • Generate unit testing code 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 testing code 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 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 generate unit testing code.
    • @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.

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 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.

Copy link

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

Actionable comments posted: 4

🧹 Outside diff range and nitpick comments (2)
src/Clean.sh (1)

1-23: Consider adding additional safety features

To make the script more robust and user-friendly:

  1. Add a confirmation prompt before proceeding with deletions
  2. Add error handling
  3. Add a dry-run option

Here's a sample implementation of these features:

#!/bin/bash

set -euo pipefail

# Script configuration
DRY_RUN=false

# Parse command line arguments
while [[ $# -gt 0 ]]; do
    case $1 in
        --dry-run)
            DRY_RUN=true
            shift
            ;;
    esac
done

# Confirmation prompt
if [[ "$DRY_RUN" = false ]]; then
    read -p "This will delete build artifacts and temporary files. Are you sure? (y/N) " -n 1 -r
    echo
    if [[ ! $REPLY =~ ^[Yy]$ ]]; then
        echo "Operation cancelled."
        exit 1
    fi
fi
🧰 Tools
🪛 Shellcheck

[warning] 8-8: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 13-13: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 18-18: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)

src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor (1)

99-101: LGTM! Consider adding context about why this step is necessary.

The instruction is well-placed within the Docker setup section and properly formatted. To make it more helpful for developers, consider adding a brief explanation of why this step is necessary for Windows users specifically.

 <br />
-If you're developing on Windows, it is recommended to run <b><i>bash ./Clean.sh</i></b> the first time you open the project in a container.
+If you're developing on Windows, it is recommended to run <b><i>bash ./Clean.sh</i></b> the first time you open the project in a container to ensure proper line endings and file permissions.
 <br />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1ed547a and e16d258.

📒 Files selected for processing (5)
  • src/BlazorUI/Clean.sh (1 hunks)
  • src/Clean.sh (1 hunks)
  • src/Templates/BlazorEmpty/Bit.BlazorEmpty/Clean.sh (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json (1 hunks)
  • src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor (1 hunks)
🧰 Additional context used
🪛 Shellcheck
src/BlazorUI/Clean.sh

[warning] 8-8: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 13-13: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 18-18: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)

src/Clean.sh

[warning] 8-8: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 13-13: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 18-18: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)

src/Templates/BlazorEmpty/Bit.BlazorEmpty/Clean.sh

[warning] 8-8: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 13-13: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 18-18: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)

🔇 Additional comments (3)
src/Clean.sh (1)

3-5: LGTM! Clear and concise comments.

The updated comments effectively communicate the script's purpose and prerequisites.

src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json (2)

362-363: LGTM: Shell script inclusion addresses the Clean.sh corruption issue.

The addition of "**/*.sh" to the copyOnly array ensures that shell scripts, including Clean.sh, are properly included in the template. This change directly addresses the corruption issue mentioned in #9297.


Line range hint 1-585: Verify database and storage configuration documentation.

The AI summary indicates new options were added for file storage (AzureBlobStorage, Other) and database (Other). While these additions enhance flexibility, please ensure that:

  1. The documentation is updated to cover these new options
  2. Any necessary configuration examples are provided for the "Other" options

src/Clean.sh Show resolved Hide resolved
src/Clean.sh Show resolved Hide resolved
src/Clean.sh Show resolved Hide resolved
src/Clean.sh Show resolved Hide resolved
@msynk msynk merged commit 906e664 into bitfoundation:develop Nov 20, 2024
3 checks passed
@ysmoradi ysmoradi deleted the 9297-boilerplate-project-template-cleansh-file-is-corrupt branch November 20, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Clean batch/shell files are corrupt across all projects
2 participants