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

Build GitRemote url from it's parts #4411

Closed
wants to merge 4 commits into from
Closed

Conversation

pstreef
Copy link
Contributor

@pstreef pstreef commented Aug 13, 2024

What's changed?

Adds a static method on GitRemote that can be used to create a URI from the required parts:

URI buildRemoteUrl(Service service, boolean ssh, String origin, String path)

What's your motivation?

A single place to put this logic, which is the reverse of the URL parser that is already in GitRemote

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

Are all these URI's (in the test) correct

Anyone you would like to review specifically?

@bryceatmoderne

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

Adds a static method on `GitRemote` that can be used to create a `URI` from the required parts:

```
URI buildRemoteUrl(Service service, boolean ssh, String origin, String path)
```
@pstreef pstreef changed the title feat: Build GitRemote url from it's parts Build GitRemote url from it's parts Aug 14, 2024
@pstreef
Copy link
Contributor Author

pstreef commented Aug 14, 2024

related: #4414

@pstreef pstreef self-assigned this Aug 14, 2024
BitbucketCloud, false, bitbucket.org, org/repo, https://bitbucket.org/org/repo
BitbucketCloud, true, bitbucket.org, org/repo, ssh://[email protected]/org/repo.git
Bitbucket, false, scm.company.com/context/path, org/repo, https://scm.company.com/context/path/scm/org/repo
Bitbucket, true, scm.company.com/context/path, org/repo, ssh://[email protected]/context/path/org/repo.git
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we agreed on not adding the port 7999 to the ssh URL for Bitbucket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is in a separate PR, but we probably need to decide that first: #4414

@pstreef
Copy link
Contributor Author

pstreef commented Aug 20, 2024

replaced by #4429

@pstreef pstreef closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants