From 6b90c8306ec5a98e8a86c93aadb9fde08813d93c Mon Sep 17 00:00:00 2001 From: Zachary Hancock Date: Thu, 5 Sep 2024 10:56:21 -0400 Subject: [PATCH 1/2] feat: clone registrar from 2U fork --- docs/service_list.rst | 4 ++-- repo.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/service_list.rst b/docs/service_list.rst index 246e7bf585..0f9686ca9f 100644 --- a/docs/service_list.rst +++ b/docs/service_list.rst @@ -79,8 +79,8 @@ Some common service combinations include: .. _frontend-app-publisher: https://github.com/openedx/frontend-app-publisher .. _frontend-app-gradebook: https://github.com/openedx/frontend-app-gradebook .. _lms: https://github.com/openedx/edx-platform -.. _frontend-app-program-console: https://github.com/openedx/frontend-app-program-console -.. _registrar: https://github.com/openedx/registrar +.. _frontend-app-program-console: https://github.com/edx/frontend-app-program-console +.. _registrar: https://github.com/edx/registrar .. _cms: https://github.com/openedx/edx-platform .. _frontend-app-learner-dashboard: https://github.com/openedx/frontend-app-learner-dashboard .. _frontend-app-learner-record: https://github.com/openedx/frontend-app-learner-record diff --git a/repo.sh b/repo.sh index 3d899de963..7abcf98f7a 100755 --- a/repo.sh +++ b/repo.sh @@ -43,8 +43,8 @@ non_release_repos=( "https://github.com/openedx/frontend-app-course-authoring.git" "https://github.com/openedx/frontend-app-learning.git" "https://github.com/openedx/frontend-app-library-authoring.git" - "https://github.com/openedx/registrar.git" - "https://github.com/openedx/frontend-app-program-console.git" + "https://github.com/edx/registrar.git" + "https://github.com/edx/frontend-app-program-console.git" "https://github.com/openedx/frontend-app-account.git" "https://github.com/openedx/frontend-app-profile.git" "https://github.com/openedx/frontend-app-ora-grading.git" @@ -73,8 +73,8 @@ non_release_ssh_repos=( "git@github.com:openedx/frontend-app-course-authoring.git" "git@github.com:openedx/frontend-app-learning.git" "git@github.com:openedx/frontend-app-library-authoring.git" - "git@github.com:openedx/registrar.git" - "git@github.com:openedx/frontend-app-program-console.git" + "git@github.com:edx/registrar.git" + "git@github.com:edx/frontend-app-program-console.git" "git@github.com:openedx/frontend-app-account.git" "git@github.com:openedx/frontend-app-profile.git" "git@github.com:openedx/frontend-app-ora-grading.git" From 23451b56f462a10ab1f07dbedd84bd9e7177af6e Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Tue, 17 Sep 2024 02:12:52 +0000 Subject: [PATCH 2/2] fix: Fix MFE repo URLs; better error message on bad format; tighter regex (#44) Two frontend repos were missing the `.git` suffix that is required for the regex that maps repo URLs to directory names. That's fixed now. But also, `make dev.reset-repos` would print two lines of `The [] repo is not cloned. Skipping.` -- hard to understand that that meant the regex failed to match. Now the match failure is explicitly handled for checkout, clone, reset, and status and a useful message is printed. Also, tightens up regex to anchor the end. --- repo.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/repo.sh b/repo.sh index 7abcf98f7a..cb93108f63 100755 --- a/repo.sh +++ b/repo.sh @@ -30,8 +30,8 @@ repos=( "https://github.com/openedx/xqueue.git" "https://github.com/edx/edx-analytics-dashboard.git" "https://github.com/openedx/frontend-app-gradebook.git" - "https://github.com/openedx/frontend-app-learner-dashboard" - "https://github.com/openedx/frontend-app-learner-record" + "https://github.com/openedx/frontend-app-learner-dashboard.git" + "https://github.com/openedx/frontend-app-learner-record.git" "https://github.com/edx/frontend-app-payment.git" "https://github.com/openedx/frontend-app-publisher.git" "https://github.com/edx/edx-analytics-dashboard.git" @@ -87,7 +87,7 @@ else ssh_repos+=("${non_release_ssh_repos[@]}") fi -name_pattern=".*/(.*).git" +name_pattern=".*/(.*).git$" _checkout () { @@ -97,7 +97,10 @@ _checkout () do # Use Bash's regex match operator to capture the name of the repo. # Results of the match are saved to an array called $BASH_REMATCH. - [[ $repo =~ $name_pattern ]] + if [[ ! $repo =~ $name_pattern ]]; then + echo "Cannot perform checkout on repo; URL did not match expected pattern: $repo" + exit 1 + fi name="${BASH_REMATCH[1]}" # If a directory exists and it is nonempty, assume the repo has been cloned. @@ -122,7 +125,10 @@ _clone () do # Use Bash's regex match operator to capture the name of the repo. # Results of the match are saved to an array called $BASH_REMATCH. - [[ $repo =~ $name_pattern ]] + if [[ ! $repo =~ $name_pattern ]]; then + echo "Cannot clone repo; URL did not match expected pattern: $repo" + exit 1 + fi name="${BASH_REMATCH[1]}" # If a directory exists and it is nonempty, assume the repo has been checked out @@ -196,7 +202,10 @@ reset () for repo in ${repos[*]} do - [[ $repo =~ $name_pattern ]] + if [[ ! $repo =~ $name_pattern ]]; then + echo "Cannot reset repo; URL did not match expected pattern: $repo" + exit 1 + fi name="${BASH_REMATCH[1]}" if [ -d "$name" ]; then @@ -227,7 +236,10 @@ status () currDir=$(pwd) for repo in ${repos[*]} do - [[ $repo =~ $name_pattern ]] + if [[ ! $repo =~ $name_pattern ]]; then + echo "Cannot check repo status; URL did not match expected pattern: $repo" + exit 1 + fi name="${BASH_REMATCH[1]}" if [ -d "$name" ]; then