Skip to content
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

fix: Fix MFE repo URLs; better error message on bad format; tighter regex #44

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

timmc-edx
Copy link
Member

@timmc-edx timmc-edx commented Sep 11, 2024

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.


I've completed each of the following or determined they are not applicable:

  • Made a plan to communicate any major developer interface changes (or N/A)

repo.sh Outdated
@@ -234,7 +234,7 @@ status ()
printf "\nGit status for [%s]:\n" "$name"
cd "$name";git status;cd "$currDir"
else
printf "The [%s] repo is not cloned. Skipping.\n" "$name"
echo "Skipped repo since name ($name) did not match an existing directory: $repo"
Copy link

Choose a reason for hiding this comment

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

How would this typically get resolved? Running make dev.clone, or other? The earlier message hinted at a next step. Maybe we make it explicit? Or am I entirely off about what issue this represents?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good point. It would either need to get cloned or the URL would need to get fixed. I'll go for the additional check after all (which will allow a more explicit message here).

Copy link
Member Author

Choose a reason for hiding this comment

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

Reworked to handle this differently. I'm not sure why, but in some cases failure to match the regex would result in an immediate exit, and other times the match would just not be set. (Depended on whether I had the end-anchor character in there, I think?) So I just handled failure explicitly, which is probably better anyhow.

…egex

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.
@timmc-edx timmc-edx changed the title fix: Use right format for two MFE repos; better dev.reset warning message fix: Fix MFE repo URLs; better error message on bad format; tighter regex Sep 16, 2024
@timmc-edx timmc-edx merged commit 23451b5 into master Sep 17, 2024
10 of 12 checks passed
@timmc-edx timmc-edx deleted the timmc/fix-urls branch September 17, 2024 02: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.

2 participants