-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Silently omit git argument when git is unavailable #176
Silently omit git argument when git is unavailable #176
Conversation
There were the following issues with your Pull Request
Guidelines are available at https://github.com/coveralls-clients/coveralls-python This message was auto-generated by https://gitcop.com |
9f2ccfc
to
2d97137
Compare
Failures within the ci/circleci: check test seem unrelated. I think this PR is ready for review. |
Would it make sense to make this an option like That would make it explicit that you intended it and didn't e.g. accidentally run outside the repo. You'd probably want a warning from this check that mentions the options in that case. |
tbh I'm not sure the risk/damage of accidentally proceeding without git is high. worst thing you'll get something over to coveralls instead of nothing. Definitely warrants a warning though. What do you think about adding a warning but keeping it the default to silently proceed without git? Perhaps a lmk what you think is best and i'll have a commit doing whatever you pick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think the flag would be overkill, but if you could please log a warning in the case where git support is not detected, that would be great.
coveralls/api.py
Outdated
run_command('git', 'status') | ||
except CoverallsException: | ||
return {} | ||
|
||
rev = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD').strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please put the try catch around the already-existing commands? No need to run an extra git command here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that; the original reason I ended up adding a git status
command was to avoid any possible errors related specifically to the existing commands, that may be because of something other than git not being available.
I can't think of a good scenario but an unlikely example could be having a git version that does not support the current command (or any future changes). Either because git version is too old or too new with backwards incompatible cli changes.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense -- I think if we add the logging, something like "could not collect git data -- are you running coveralls in a repository?", along with logging the CoverallsException message (which contains the process output), that should cover it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will amend with a more verbose log (and phrasing that's more to your liking).
Ah, and as per the tests -- so long as only the |
There were the following issues with your Pull Request
Guidelines are available at https://github.com/coveralls-clients/coveralls-python This message was auto-generated by https://gitcop.com |
017382d
to
e215097
Compare
There were the following issues with your Pull Request
Guidelines are available at https://github.com/coveralls-clients/coveralls-python This message was auto-generated by https://gitcop.com |
e215097
to
79eb761
Compare
79eb761
to
411633d
Compare
Pinging @TheKevJames @jvarho, any additional thoughts/comments? |
@nirizr still would like to see you wrap the other git commands rather than introducing a new one. Looks like your log formatting is a bit janky -- you have a bracket-interpolation param with no matching data being passed in. Go ahead and take that out and just throw a |
Apologies, I thought you agreed with the I used the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks for the fix! I will cut a new release as soon as I can.
Splendid! thanks for the quick responses! |
Tries to fix #174
Alternatively, we could require a flag or take the test out of the
git_info
method although it seems fitting imo.