-
Notifications
You must be signed in to change notification settings - Fork 9
fix: BOMS-235 Create script to set up remotes for devstack #184
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: master
Are you sure you want to change the base?
fix: BOMS-235 Create script to set up remotes for devstack #184
Conversation
e70e048
to
3656bc6
Compare
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.
Pull Request Overview
Implements a git remote setup system for devstack repositories to handle forked repositories between edx and openedx organizations. The script automatically configures appropriate remotes for developers working with forks.
- Adds remote setup functionality that renames origin to the primary organization and adds the complementary remote
- Creates a comprehensive test suite to validate the remote setup behavior across different repository types
- Integrates remote setup into the existing make clone workflow for automatic configuration
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
File | Description |
---|---|
repo.sh | Adds core remote setup logic, forked repository configuration map, and new command handler |
Makefile | Integrates remote setup command and adds automatic setup to clone operations |
test_repo.sh | Comprehensive test suite for validating remote setup functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
show_remotes "course-discovery" "AFTER" | ||
cd course-discovery | ||
# course-discovery should be renamed from origin to openedx, and get an edx remote | ||
if git remote get-url openedx | grep -q "openedx/course-discovery" && git remote get-url edx | grep -q "edx/course-discovery" && [ $(git remote | wc -l) -eq 2 ]; then |
Copilot
AI
Oct 7, 2025
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 command substitution $(git remote | wc -l)
should be quoted to prevent word splitting. Use [ \"$(git remote | wc -l)\" -eq 2 ]
instead.
if git remote get-url openedx | grep -q "openedx/course-discovery" && git remote get-url edx | grep -q "edx/course-discovery" && [ $(git remote | wc -l) -eq 2 ]; then | |
if git remote get-url openedx | grep -q "openedx/course-discovery" && git remote get-url edx | grep -q "edx/course-discovery" && [ "$(git remote | wc -l)" -eq 2 ]; then |
Copilot uses AI. Check for mistakes.
cd "$TEST_WORKSPACE" | ||
show_remotes "unknown-repo" "AFTER" | ||
cd unknown-repo | ||
if git remote | grep -q "^origin$" && [ $(git remote | wc -l) -eq 1 ]; then |
Copilot
AI
Oct 7, 2025
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 command substitutions $(git remote | wc -l)
should be quoted to prevent word splitting. Use [ \"$(git remote | wc -l)\" -eq 1 ]
and [ \"$(git remote | wc -l)\" -eq 2 ]
instead.
Copilot uses AI. Check for mistakes.
cd "$TEST_WORKSPACE" | ||
show_remotes "frontend-app-gradebook" "AFTER SECOND RUN (should be identical)" | ||
cd frontend-app-gradebook | ||
if [ $(git remote | wc -l) -eq 2 ] && git remote | grep -q "edx" && git remote | grep -q "openedx"; then |
Copilot
AI
Oct 7, 2025
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 command substitutions $(git remote | wc -l)
should be quoted to prevent word splitting. Use [ \"$(git remote | wc -l)\" -eq 1 ]
and [ \"$(git remote | wc -l)\" -eq 2 ]
instead.
if [ $(git remote | wc -l) -eq 2 ] && git remote | grep -q "edx" && git remote | grep -q "openedx"; then | |
if [ "$(git remote | wc -l)" -eq 2 ] && git remote | grep -q "edx" && git remote | grep -q "openedx"; then |
Copilot uses AI. Check for mistakes.
for repo in "${repos[@]}" "${non_release_repos[@]}" | ||
do |
Copilot
AI
Oct 7, 2025
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.
Iterating over two arrays separately can lead to unexpected behavior if elements contain spaces. Consider combining arrays first: combined_repos=(\"${repos[@]}\" \"${non_release_repos[@]}\")
then iterate over \"${combined_repos[@]}\"
.
for repo in "${repos[@]}" "${non_release_repos[@]}" | |
do | |
local combined_repos=( "${repos[@]}" "${non_release_repos[@]}" ) | |
for repo in "${combined_repos[@]}" |
Copilot uses AI. Check for mistakes.
echo "" | ||
fi | ||
|
||
echo "Total repositories processed: $((${#successful_repos[@]} + ${#failed_repos[@]} + ${#skipped_repos[@]}))" |
Copilot
AI
Oct 7, 2025
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 arithmetic expansion should be quoted to handle edge cases properly. Use echo \"Total repositories processed: $((${#successful_repos[@]} + ${#failed_repos[@]} + ${#skipped_repos[@]}))\"
instead.
echo "Total repositories processed: $((${#successful_repos[@]} + ${#failed_repos[@]} + ${#skipped_repos[@]}))" | |
echo "Total repositories processed: \"$((${#successful_repos[@]} + ${#failed_repos[@]} + ${#skipped_repos[@]}))\"" |
Copilot uses AI. Check for mistakes.
…ipt-to-set-up-remotes-for-devstack
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
"git@github.com:openedx/edx-platform.git" | ||
"git@github.com:edx/edx-platform.git" | ||
"git@github.com:openedx/xqueue.git" | ||
"git@github.com:edx/edx-analytics-dashboard.git" |
Copilot
AI
Oct 10, 2025
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 edx-analytics-dashboard repository appears twice in the ssh_repos array (lines 82 and 88). This duplication should be removed to maintain consistency.
Copilot uses AI. Check for mistakes.
for repo in "${repos[@]}" "${non_release_repos[@]}" | ||
do | ||
# Extract repo name from URL | ||
if [[ ! $repo =~ $name_pattern ]]; then |
Copilot
AI
Oct 10, 2025
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 $name_pattern
is referenced but not defined in this function scope. This pattern should be defined locally or passed as a parameter to avoid potential runtime errors.
Copilot uses AI. Check for mistakes.
Description:
Developers need to set up git remotes for forked repositories to access both edx and openedx organizations. Script was a need to be prepared to handle the remote , origin , personal and non-forked repos.
Solution:
make dev.setup-remotes
and automatic setup during clone operationsRun test file:
Make the test file executable:
chmod +x test_repo.sh
Run dry run
./test_repo.sh
Expected dry-run output:
JIRA Ticket:
BOMS-235