Skip to content

Change submodule and master-based-workflow setup #381

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dportil
Copy link

@dportil dportil commented Jul 22, 2025

The submodule and master-based-workflow /exercise directories do not have a repository. So git commands executed in /exercise would effect the parent git-katas repo.

Replaced mkdir with the make-exercise-repo utility in the setup.sh files. This creates an empty repo in /exercise and protects the parent repo.

Summary by CodeRabbit

  • Chores
    • Simplified setup scripts by consolidating directory creation and navigation into a single command for easier setup.

dportil added 2 commits July 22, 2025 16:14
The submodule /exercise directory does not have a repository.
So git commands executed in /exercise would effect the parent git-katas repo.

Added the make-exercise-repo utility to the setup.sh to create an empty repo in /exercise.
Which encapsulates it.
The submodule /exercise directory does not have a repository.
So git commands executed in /exercise would effect the parent git-katas repo.

Added the make-exercise-repo utility to the setup.sh to create an empty repo in /exercise.
Which encapsulates it.
Copy link

coderabbitai bot commented Jul 22, 2025

Walkthrough

The setup scripts in two directories have been updated to replace manual directory creation and navigation steps with a single call to a make-exercise-repo function or command. This encapsulates the setup process, and minor adjustments to file copy commands reflect the new working directory context.

Changes

File(s) Change Summary
master-based-workflow/setup.sh Replaced manual directory creation and navigation with make-exercise-repo; adjusted copy path.
submodules/setup.sh Replaced manual directory creation and navigation with make-exercise-repo.

Estimated code review effort

1 (~2 minutes)

Poem

In scripts where setup used to sprawl,
One function now does it all!
With make-exercise-repo we leap,
No more mkdirs in a heap.
A tidy hop, a simpler flow—
That’s how rabbits like to go! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

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

🧹 Nitpick comments (4)
submodules/setup.sh (2)

7-11: Redundant cleanup – exercise/ is removed twice

make-exercise-repo already performs rm -rf exercise/.
Keeping the standalone rm -rf exercise introduces needless I/O and makes the intent less clear.

-# First cleanup if there is an old exercise folder
-rm -rf exercise
-
-# Create exercise folder & go there
-make-exercise-repo
+# Create exercise folder & go there (make-exercise-repo handles cleanup itself)
+make-exercise-repo

1-5: Harden the script with strict-mode flags

Consider adding the usual bash safety flags right after the shebang:

set -euo pipefail

This causes the script to abort on the first error, on unset variables, and on pipe failures—especially useful in teaching katas where users may modify the script.

master-based-workflow/setup.sh (2)

4-7: Duplicate rm -rf exercise call

make-exercise-repo already deletes any pre-existing exercise/ folder.
Removing the extra call keeps the setup concise and avoids unnecessary disk work.

-rm -rf exercise
-
-make-exercise-repo
+make-exercise-repo   # function already wipes old exercise repo

1-3: Enable strict mode for safer execution

Add bash strict-mode flags to fail fast on errors and undefined variables:

set -euo pipefail

This is particularly helpful in workflow-oriented scripts where an unnoticed failure can derail the subsequent learner steps.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d2c18f and 83432ad.

📒 Files selected for processing (2)
  • master-based-workflow/setup.sh (1 hunks)
  • submodules/setup.sh (1 hunks)
🧬 Code Graph Analysis (2)
submodules/setup.sh (1)
utils/make-exercise-repo.sh (1)
  • make-exercise-repo (2-12)
master-based-workflow/setup.sh (1)
utils/make-exercise-repo.sh (1)
  • make-exercise-repo (2-12)
🧰 Additional context used
🧬 Code Graph Analysis (2)
submodules/setup.sh (1)
utils/make-exercise-repo.sh (1)
  • make-exercise-repo (2-12)
master-based-workflow/setup.sh (1)
utils/make-exercise-repo.sh (1)
  • make-exercise-repo (2-12)

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.

1 participant