Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

PULL_REQUEST_{TO,FROM}_{HTTP,SSH}_CLONE_URL variables contains username #229

Closed
johntconklin opened this issue Jul 3, 2017 · 11 comments
Closed

Comments

@johntconklin
Copy link
Contributor

I've found that using the PULL_REQUEST_{TO,FROM}_{HTTP,SSH}_CLONE_URL variables inconvenient to use as is, because of the username in the URL. My agents that use the URL don't use that username (and could not, because it doesn't have the password for that username). I don't know whether there is a use case where the username is useful, in which case, the username could be removed. But if there is a use case, please consider adding another set of _URL variables that don't include username.

@tomasbjerre
Copy link
Owner

@christiangalsterer what do you think about removing the usernames? I'm asking because you introduced it in 001a9c7ce0d89b9 .

I would vote for removing it.

@christiangalsterer
Copy link
Contributor

Hi,

as long as we keep the variables (we heavily rely on it in our build pipeline) as such and remove only the username from the URL I'm fine with it.

jwoolston added a commit to jwoolston/pull-request-notifier-for-bitbucket that referenced this issue Jan 30, 2018
…ULL_REQUEST_{TO_FROM}_{HTTP,SSH}_CLONE_URL

Signed-off-by: Jared Woolston <[email protected]>
tomasbjerre added a commit that referenced this issue Jan 30, 2018
#229 Proposed URI reconstruction to remove username from PULL_REQUEST…
@tomasbjerre
Copy link
Owner

Thanks to @jwoolston and his PR, this is now released in 3.20!

@jwoolston
Copy link
Contributor

I really appreciate the speedy release, this will help a lot, thank you.

@steve-behnke-spacex
Copy link

I don't really understand the justification in making this change. This broke our setup. What's the entire point behind stripping the username from the URLs?

Right now git@stash:7999/project/PROJ/repo/REPO is coming out as stash:7999/project/PROJ/repo/REPO which seems broken to me.

@tomasbjerre
Copy link
Owner

I'm thinking that the SSH clone URL should still have git@.... But the HTTP clone URL should not have username.

What do you say @johntconklin ?

@tomasbjerre tomasbjerre reopened this Jun 7, 2018
@steve-behnke-spacex
Copy link

Thank you for considering -- That would be ideal for our use-case.

@tomasbjerre
Copy link
Owner

Fixed in 3.22.

@steve-behnke-spacex
Copy link

Radical. Thank you @tomasbjerre.

@johntconklin
Copy link
Contributor Author

I'm no longer in an organization that uses Bitbucket, but if I recall correctly the SSH URL's included the name of the user who raised the pull request, not a generic "git@". So a pull request raised by user "foo" had a URL [email protected]:/project/PROJ/repo/REPO, and as a result, the build service account used for builds triggered by the event could not use the URL as-is, because it did not have credentials for "foo". To my mind, the URL and the access credentials are two completely separate things, and as such, the user should not be included in the URL.

@theucke, you may want to follow this.

@steve-behnke-spacex
Copy link

steve-behnke-spacex commented Jun 8, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants