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

Enhancement: use local git user for stub runner by default #1206

Open
Sam-Kruglov opened this issue Sep 5, 2019 · 6 comments
Open

Enhancement: use local git user for stub runner by default #1206

Sam-Kruglov opened this issue Sep 5, 2019 · 6 comments

Comments

@Sam-Kruglov
Copy link

Sam-Kruglov commented Sep 5, 2019

I want to run my stubs that are stored in Git without having to provide git username and password. The stub runner must be able to just use my local git account, that I am using with Git CLI.

version 2.1.2.RELEASE, maven runner

@marcingrzejszczak
Copy link
Contributor

I'm sorry but can you create the issue properly from the beginning until the end? I have no idea what the problem is, for which version, what you did and what you're planning to do.

@Sam-Kruglov
Copy link
Author

updated

@marcingrzejszczak
Copy link
Contributor

What did you update? This issue?

Can you please read the comment we're providing for better issue creation when you click on the New issue? I'll paste it for your convinience

<!--
Thanks for raising a Spring Cloud issue. What sort of issue are you raising?

Question

Please ask questions about how to use something, or to understand why something isn't
working as you expect it to, on Stack Overflow using the spring-cloud tag.

Bug report

Please provide details of the problem, including the version of Spring Cloud that you
are using. If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.

Enhancement

Please start by describing the problem that you are trying to solve. There may already
be a solution, or there may be a way to solve it that you hadn't considered.
-->

Also please read on how to ask a good question on SO (it can give you pointers to how ask good questions on GitHub too) - https://stackoverflow.com/help/how-to-ask

@Sam-Kruglov
Copy link
Author

Sam-Kruglov commented Sep 6, 2019

I meant that I'd edited the description, i.e. the first comment. I don't really know what to add, don't have time to set up a whole project but basically, when using any stub runner and specifying contractsRepositoryUrl property as a Git repository (starts from git://...) then it requires me to also provide contractsRepositoryUsername and contractsRepositoryPassword (given my repository is private) because authentication fails without these.

The suggestion is to use local Git user credentials by default. Here is my reasoning:
I am writing code on my machine, so when I run my tests, I don't want to explicitly supply credentials to a git repository I already have access to using my CLI or IDE. Just like my IDE, I want this tool to recognize my local git user and use that. For CI it would be fine, but again, the CI could also use a git user.

Hopefully, that's clear enough.

@Sam-Kruglov
Copy link
Author

Found #1205 and your response actually solves my problem! If I execute these 2 lines then I don't need to provide username and password, which is exactly what my concern was. #1205 (comment)

I suggest updating the documentation. Otherwise, the issue may be closed

@marcingrzejszczak
Copy link
Contributor

Great, are you willing to do a PR? :) That would be a nice contribution (over here I guess https://github.com/spring-cloud/spring-cloud-contract/blob/master/docs/src/main/asciidoc/howto.adoc#how-can-i-use-git-as-the-storage-for-contracts-and-stubs)

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

No branches or pull requests

4 participants