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

Add warning for git version parse failures #10446

Closed
wants to merge 1 commit into from
Closed

Add warning for git version parse failures #10446

wants to merge 1 commit into from

Conversation

HausCloud
Copy link

@HausCloud HausCloud commented Sep 7, 2021

This is what I came up with from studying the issue. Any guidance on how to improve this would be much appreciated. Thanks for your time.

Fix #10361.

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

This is very nice! Some minor comments inlined.

tests/unit/test_vcs.py Show resolved Hide resolved
@@ -94,6 +94,7 @@ def get_git_version(self) -> Tuple[int, ...]:
version = self.run_command(["version"], show_stdout=False, stdout_only=True)
match = GIT_VERSION_REGEX.match(version)
if not match:
logger.warning("Unable to parse '%s'.", version)
Copy link
Member

@uranusjr uranusjr Sep 7, 2021

Choose a reason for hiding this comment

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

It may also be worth while to explain where we got that unparsable string, i.e.

Suggested change
logger.warning("Unable to parse '%s'.", version)
logger.warning("Unable to parse 'git version' output: %r.", version)

Copy link
Author

@HausCloud HausCloud Sep 8, 2021

Choose a reason for hiding this comment

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

Do you mean something like the below?
"""
Equivalent of running 'git --version'
See run_command in parent class
"""

Copy link
Member

Choose a reason for hiding this comment

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

I don’t quite understand what you meant. What I was trying to express is, this Unable to parse message will be seen by the user in the console, and when that happens the user may not fully understand the context of the message (why does the string fail to parse? Where does that string come from?) Therefore, I recommended adding git version output to the message, so the user understands the string is the output to git version and react accordingly (and yes, git --version gives the exact same output, but we are using git version right now so that should be used instead).

Copy link
Author

@HausCloud HausCloud Sep 8, 2021

Choose a reason for hiding this comment

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

Ah okay. I misunderstood, my apologies.

EDIT: What I can I do now to get this moving along?

@github-actions github-actions bot added the needs rebase or merge PR has conflicts with current master label Sep 21, 2021
@ziebam
Copy link
Contributor

ziebam commented Sep 23, 2021

Just tagging #10361 so that people looking for "good first issue" know there's a PR open.

@uranusjr
Copy link
Member

(I updated the top post to include the “close” command so GitHub shows the PR more prominently in the issue.)

Copy link
Member

@DiddiLeija DiddiLeija left a comment

Choose a reason for hiding this comment

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

Hello @HausCloud. This is a really good PR!

Could you please rebase the branch, so we can keep going ahead?

@pradyunsg
Copy link
Member

Closing this out, due to lack of a response.

@pradyunsg pradyunsg closed this Jan 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs rebase or merge PR has conflicts with current master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log a warning when git's version can't be parsed
5 participants