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

Support a dot in repo names. #114

Merged
merged 1 commit into from
Jan 20, 2020
Merged

Conversation

notlee
Copy link
Contributor

@notlee notlee commented Nov 6, 2019

Currently Ebi parses https://github.com/financial-times/ft.com-cdn
as https://github.com/financial-times/ft, which redirects and returns
files from https://github.com/financial-times/fta

This commit updates GITHUB_REPO_REGEX to match dots in the repo
name. This however means .git is also matched, so .git is
removed first as part of the extractOwnerAndRepo method.

Note: My previous attempt to do everything in a regex, without removing
.git first didn't go great. I ended up with the repo name either being
in group 2 or 3:
^(?:\S*github\.com(?:\/|:))?([\w-]+)\/(?:([\w-\.]+)(?:\.git)|([\w-\.]+))

Currently Ebi parses https://github.com/financial-times/ft.com-cdn
as https://github.com/financial-times/ft, which redirects and returns
files from https://github.com/financial-times/fta

This commit updates `GITHUB_REPO_REGEX` to match dots in the repo
name. This however means `.git` is also matched, so `.git` is
removed first as part of the `extractOwnerAndRepo` method.

_Note: My previous attempt to do everything in a regex, without removing
`.git` first didn't go great. I ended up with the repo name either being
in group 3 or 4:
`^(?:\S*github\.com(?:\/|:))?([\w-]+)\/(([\w-\.]+)(?:\.git)|([\w-\.]+))`_
Copy link
Contributor

@taktran taktran left a comment

Choose a reason for hiding this comment

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

👍 Looks good

@stale
Copy link

stale bot commented Jan 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale The issue has not had any recent activity. label Jan 5, 2020
@notlee
Copy link
Contributor Author

notlee commented Jan 6, 2020

👋 Happy for me to merge and release?

@stale stale bot removed the stale The issue has not had any recent activity. label Jan 6, 2020
@jenniferemshepherd
Copy link
Contributor

yes! sorry for the delay 👍

@jenniferemshepherd jenniferemshepherd merged commit e25fc5e into master Jan 20, 2020
@jenniferemshepherd jenniferemshepherd deleted the support-dot-in-repo-name branch January 20, 2020 17:29
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.

3 participants