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 parsing SSH URLs with random domains #17

Open
JBrVJxsc opened this issue Jan 29, 2023 · 6 comments
Open

Support parsing SSH URLs with random domains #17

JBrVJxsc opened this issue Jan 29, 2023 · 6 comments

Comments

@JBrVJxsc
Copy link

JBrVJxsc commented Jan 29, 2023

Description

Currently, the library does not support parsing SSH URLs with random domains, e.g., [email protected]:mozilla-releng/mozilla-repo-urls.git.

Use cases

When we git clone [email protected]:mozilla-releng/mozilla-repo-urls.git, what happens under the hood is that git will invoke ssh, which takes git as SSH username and github.com as the host; however, there are cases where people need different alias names for github.com, e.g., when they have multiple ssh keys locally, what they often do is to add multiple host configs, e.g., github.com-personal and github.com-work in ~/.ssh/config, and then use that alias to pull and push, that way the ssh will automatically know which SSH key to use.

Proposed solution

Add regular expression support for random domains.

Alternatives

None I could think of.

@JohanLorenzo
Copy link
Collaborator

Hello @JBrVJxsc!

Thank you very much for you detailed report! 👍 I totally agree, the library is very strict regarding random domain names. The original intent for this library is to be used by Mozilla's CI/CD. We do want to be strict there for security reasons.

That said, we shouldn't break people's setups 🙂 In order for me to understand the context, how did you stumble upon an error raised by mozilla-repo-urls?

@xzhang-brex
Copy link

@JohanLorenzo I actually checked out the Firefox source code on GitHub mirror, with custom SSH domain, and I couldn't ./mach build it due to the reason I mentioned above.

@JohanLorenzo
Copy link
Collaborator

Oh, I see what's going on. Thank you for highlighting that. It turns out we're still not using mozilla-repo-url v0.1.1 and taskcluster-taskgraph v3.5.2+. I'll follow up in bug 1793219.

@JohanLorenzo
Copy link
Collaborator

The fix made it to mozilla-central: https://hg.mozilla.org/mozilla-central/rev/5b7b3a5e5d7e. @JBrVJxsc and @xzhang-brex, please hg pull the latest central revision and let me know if you still face this error 🙂

@xzhang-brex
Copy link

@JohanLorenzo thanks! QQ: does it support custom SSH domain now? I didn't see the change in the code...

@JohanLorenzo
Copy link
Collaborator

Great! It doesn't. mozilla-central just doesn't run mozilla-repo-urls on local machines anymore. It is only used by CI/CD. That said, your original request is 100% valid. I'll keep it in mind and think about a way to support it on machines that aren't part of Mozilla's CI/CD.

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

No branches or pull requests

3 participants