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

Update GitRemote#normalize to support organizations prefixed with a number #4651

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bryceatmoderne
Copy link
Contributor

What's changed?

GitRemote#normalize was incorrectly identifying an organization starting with a number, such 1org, as a port number. These changes update the regex Pattern to match a numerical string up to a forward slash.

What's your motivation?

Some repositories such as https://github.com/1Remote/1Remote were failing to build using the Moderne CLI.

Anything in particular you'd like reviewers to focus on?

No

Anyone you would like to review specifically?

@pstreef

Have you considered any alternatives or workarounds?

No

Any additional context

No

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@bryceatmoderne bryceatmoderne changed the title Update GitRemote#normalize to support organizations prefixed with a number Update GitRemote#normalize to support organizations prefixed with a number Nov 6, 2024
@bryceatmoderne bryceatmoderne self-assigned this Nov 6, 2024
@@ -279,7 +279,7 @@ private String repositoryPath(RemoteServerMatch match, URI normalizedUri) {
.replaceFirst("^/", "");
}

private static final Pattern PORT_PATTERN = Pattern.compile(":\\d+");
private static final Pattern PORT_PATTERN = Pattern.compile(":\\d+/");
Copy link
Contributor

Choose a reason for hiding this comment

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

what if the org is a number 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well at least github supports number-only orgs. (https://github.com/1234)

@timtebeek timtebeek added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

3 participants