Skip to content

Conversation

@Akanshu-2u
Copy link
Contributor

@Akanshu-2u Akanshu-2u commented Oct 1, 2025

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:

  1. Added a script that automatically configures git remotes for list of repositories.
  2. Renames existing origin remote to match the primary organization (edx or openedx)
  3. Adds the complementary remote (if origin is edx, adds openedx remote and vice versa)
  4. Integrated with make commands: make dev.setup-remotes and automatic setup during clone operations
  5. Works for all repository types: edx repos, openedx repos, personal forks, and non-forked repos

Run test file:

  • Make the test file executable:
    chmod +x test_repo.sh

  • Run dry run
    ./test_repo.sh

Expected dry-run output:

  1. Remote setup:
# Before
origin  https://github.com/edx/ecommerce.git

# After  
edx     https://github.com/edx/ecommerce.git
openedx https://github.com/openedx/ecommerce.git
  1. Error - Personal Fork:
Setting up remotes for forked repository: credentials
ERROR: Unexpected origin URL in credentials: https://github.com/personaluser/credentials.git
Expected URL to be from either edx or openedx organization
  1. Skipped Repository:
Repository course-discovery is not cloned. Skipping.
  1. Final summary:
Remote Setup Summary:
✓ Successfully configured remotes for 2 repositories:
  - ecommerce, edx-platform

✗ Failed to configure remotes for 1 repositories:
  - credentials

◦ Skipped 69 repositories (not cloned or not forked)

Total repositories processed: 72

JIRA Ticket:

BOMS-235

@Akanshu-2u Akanshu-2u force-pushed the BOMS-235-create-script-to-set-up-remotes-for-devstack branch from e70e048 to 3656bc6 Compare October 6, 2025 06:49
@Akanshu-2u Akanshu-2u changed the title BOMS-235 Create script to set up remotes for devstack fix: BOMS-235 Create script to set up remotes for devstack Oct 6, 2025
@Akanshu-2u Akanshu-2u marked this pull request as ready for review October 7, 2025 08:36
Copilot AI review requested due to automatic review settings October 7, 2025 08:36
Copy link
Contributor

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings October 10, 2025 11:19
Copy link
Contributor

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings October 15, 2025 11:25
Copy link
Contributor

Copilot AI left a 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 4 out of 4 changed files in this pull request and generated 11 comments.

Comments suppressed due to low confidence (1)

repo.sh:1

  • [nitpick] Large hard-coded FORKED_REPOS list duplicates data already implicit in repos/non_release_repos and increases drift risk; consider generating this from existing arrays (filtering those present in both orgs) or loading from a single config file to centralize maintenance.
#!/usr/bin/env bash

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Akanshu-2u Akanshu-2u requested a review from timmc-edx October 16, 2025 05:18
Copy link
Member

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small suggestion, but otherwise looks good!

Copilot AI review requested due to automatic review settings October 17, 2025 05:25
Copy link
Contributor

Copilot AI left a 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 4 out of 4 changed files in this pull request and generated 8 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Akanshu-2u Akanshu-2u merged commit 268f003 into master Oct 17, 2025
19 checks passed
@Akanshu-2u Akanshu-2u deleted the BOMS-235-create-script-to-set-up-remotes-for-devstack branch October 17, 2025 06:00
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.

5 participants