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

write-git-creds doesnt appear to work as indicated #873

Closed
jseiser opened this issue Dec 4, 2019 · 4 comments · Fixed by #883
Closed

write-git-creds doesnt appear to work as indicated #873

jseiser opened this issue Dec 4, 2019 · 4 comments · Fixed by #883
Labels
bug Something isn't working

Comments

@jseiser
Copy link

jseiser commented Dec 4, 2019

Version 10.2, and I have set write-git-creds to true.

What does work

"git::https://bitbucket.org/repo/tf_modules.git//module_name"

What Does not work

"git::ssh://git@bitbucket.org/repo/tf_modules.git//module_name"

This reads to me like it should work, #799

Im using SSH, and it will do some replacments to use the git-creds it wrote to file.

If im mistaken, please let me know. Thanks.

@lkysow lkysow added the bug Something isn't working label Dec 11, 2019
@lkysow
Copy link
Member

lkysow commented Dec 11, 2019

@ImperialXT should that work?

@andrewjeffree
Copy link

andrewjeffree commented Dec 12, 2019 via email

@andrewjeffree
Copy link

Right so yes this is a bug. I don't use bitbucket so I didn't look very closely at it when I wrote the initial code. I'm actually surprised that "git::https://bitbucket.org/repo/tf_modules.git//module_name" works as I can't even get that to work with my testing.

The issue appears to be that when calling WriteGitCreds in server/server.go I provide it with the BitBucketBaseURL value which if not set by the user defaults to "https://api.bitbucket.org" and WriteGitCreds takes that literally and writes out credits using that full url and hostname etc.

@lkysow I'd appreciate your feedback on how best to fix this.

I could just have an extra conditional when I'm calling WriteGitCreds for bitbucket where I check if the value BitBucketBaseURL is "https://api.bitbucket.org" and if so pass "bitbucket.org" instead to WriteGitCreds.

An alternative would be to potentially look at changing BitBucketBaseURL to default to "bitbucket.org" and then have a BitBucketAPIUrl variable or similar which we set to "api.bitbucket.org" and is used where needed but this would require changes in many places etc.

@lkysow
Copy link
Member

lkysow commented Dec 16, 2019

I think put the conditional inside server.go right before you call WriteGitCreds. Then that function can remain "dumb" in terms of not knowing about each vcs.

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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants