-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add remark-definition-links import script #67
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
base: dev
Are you sure you want to change the base?
Conversation
Signed-off-by: Logan McAnsh <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @mcansh, 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!
I've introduced a new chore script to facilitate the migration of the remark-definition-links
project into this repository. This script automates the complex process of merging two distinct Git histories, ensuring that the remark-definition-links
codebase can be seamlessly integrated as a package within this monorepo structure. The primary purpose is to streamline the import process, making it repeatable and less prone to manual errors.
Highlights
- New script for package import: I've added a new shell script,
scripts/import-remark-definition-links.sh
, designed to automate the process of importing theremark-definition-links
repository into the currentpackages
repository. - Automated migration process: The script handles cloning both source and destination repositories, removing their origins, checking out specific branches, and then merging the source repository's history into the destination using
git merge --allow-unrelated-histories
. - Post-migration instructions: It provides clear instructions for the user to push the newly created branch and open a pull request after the script completes its execution, ensuring a smooth finalization of the import.
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 or fill out our survey to provide feedback.
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. ↩
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
packages | 7355e17 | Commit Preview URL Branch Preview URL |
Aug 09 2025, 02:21 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #67 +/- ##
=======================================
Coverage 93.80% 93.80%
=======================================
Files 19 19
Lines 872 872
Branches 215 214 -1
=======================================
Hits 818 818
Misses 54 54 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a shell script for importing the remark-definition-links
repository. The script is well-structured, but there are several opportunities to improve its robustness and clarity. My review includes suggestions for better error handling with set -u
, ensuring all variables are quoted to prevent shell expansion issues, using a trap
for reliable cleanup of temporary files, and removing commented-out code to improve readability. These changes will make the script safer and easier to maintain.
git remote rm origin | ||
cd .. | ||
cd "$DEST_REPO_DIR" | ||
git checkout $DEST_BRANCH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $DEST_BRANCH
should be quoted (e.g., "$DEST_BRANCH"
) to prevent potential issues with word splitting and globbing if the branch name were to contain spaces or special characters. This is a shell scripting best practice that should be applied to all unquoted variable expansions in this script for improved robustness (e.g., on lines 42, 44, 64-66, 68-69).
git checkout $DEST_BRANCH | |
git checkout "$DEST_BRANCH" |
#!/bin/bash | ||
|
||
set -x | ||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the script more robust, I suggest two improvements:
- Use
set -u
: This will cause the script to exit if it tries to use an uninitialized variable. - Use a
trap
for cleanup: This ensures that the temporary directories ($SOURCE_REPO_DIR
and$DEST_REPO_DIR
) are removed when the script exits, whether it succeeds or fails.
With the trap
in place, you can then remove the rm -rf
commands on lines 26-27.
set -e | |
set -e | |
set -u | |
trap 'rm -rf "$SOURCE_REPO_DIR" "$DEST_REPO_DIR"' EXIT |
# git-filter-repo --force \ | ||
# --path .env.example \ | ||
# --path .github \ | ||
# --path .gitignore \ | ||
# --path .prettierrc \ | ||
# --path .vscode \ | ||
# --path CONTRIBUTING.md \ | ||
# --path LICENSE \ | ||
# --path package.json \ | ||
# --path packages \ | ||
# --path pnpm-lock.yaml \ | ||
# --path pnpm-workspace.yaml \ | ||
# --path scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.