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

Log a warning when git's version can't be parsed #10361

Closed
pradyunsg opened this issue Aug 15, 2021 · 13 comments · Fixed by #10801
Closed

Log a warning when git's version can't be parsed #10361

pradyunsg opened this issue Aug 15, 2021 · 13 comments · Fixed by #10801
Labels
good first issue A good item for first time contributors to work on type: enhancement Improvements to functionality

Comments

@pradyunsg
Copy link
Member

Would it make sense to have a logger.debug (or logger.info/warning) call here mentioning that the version couldn't be parsed ?

Originally posted by @xavfernandez in #10117 (comment)

Yes, let's do a warning. :)

@pradyunsg pradyunsg changed the title Log a warning when a git version can't be parsed Log a warning when git's version can't be parsed Aug 15, 2021
@uranusjr uranusjr added good first issue A good item for first time contributors to work on type: enhancement Improvements to functionality labels Aug 19, 2021
@josix
Copy link

josix commented Aug 19, 2021

Hello @uranusjr, @pradyunsg this issue looks suitable for new contributor like me. May I take a try for resolving this issue? Thanks.

@uranusjr
Copy link
Member

Please fee free :)

@aniketh-varma
Copy link

Hello, I would like to work on this issue. I would be grateful if you can please guide me on fixing this as well.

@uranusjr
Copy link
Member

@aniketh-varma Feel free! You’d want to follow instructions to set up a development environment, change the code in git.py, and add a test for the error message.

@HausCloud
Copy link

@uranusjr Is there a way to change what git --version outputs during a test?

@uranusjr
Copy link
Member

uranusjr commented Sep 6, 2021

Does subprocess not work?

@uranusjr
Copy link
Member

uranusjr commented Sep 6, 2021

But you should not need to get the actual git --version output. The goal should be to test whether an invalid Git version triggers a warning, but git --version is not guaranteed to be invalid (or valid), so a test should not be written against it. You should use mocking instead.

@HausCloud
Copy link

@uranusjr Thanks for help. I've made a pull request.

@Shivansh-007
Copy link
Contributor

Hi, Looks like this issue has already been resolved by #10419, though there were no tests introduced for this enhancement.

@pradyunsg
Copy link
Member Author

Ah, I see! Would you be willing to file a PR for adding a test?

@Shivansh-007
Copy link
Contributor

Yeah sure, will do 👍🏻

@Hermit97
Copy link

Hello, is this issue still open?

@DiddiLeija
Copy link
Member

Hey @Hermit97, thanks for offering. There is already a PR to close this at #10801.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue A good item for first time contributors to work on type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants