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

TravisLintBear: Check for internet connection #1982

Merged
merged 1 commit into from Aug 17, 2017

Conversation

6 participants
@yash-nisar
Member

yash-nisar commented Aug 6, 2017

Add a check for internet connection in the check_prerequisites
method without which the bear will fail to run.

Fixes #1978

For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!

Checklist

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    individually.
    It is not sufficient to have "fixup commits" on your PR,
    our bot will still report the issues for the previous commit.) You will
    likely receive a lot of bot comments and build failures if coala does not
    pass on every single commit!

After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will
review your PRs faster!

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 6, 2017

@gitmate-bot gitmate-bot added size/M and removed size/S labels Aug 6, 2017

Show outdated Hide outdated tests/yaml/TravisLintBearTest.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 6, 2017

Member

@SanketDG Fixed, thanks 👍

Member

yash-nisar commented Aug 6, 2017

@SanketDG Fixed, thanks 👍

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated

@gitmate-bot gitmate-bot added size/S and removed size/M labels Aug 6, 2017

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 7, 2017

Member

@Makman2 Updated.

Member

yash-nisar commented Aug 7, 2017

@Makman2 Updated.

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 10, 2017

Member

Updated @Makman2 . I hope this looks much cleaner and handles all cases now 😄

Member

yash-nisar commented Aug 10, 2017

Updated @Makman2 . I hope this looks much cleaner and handles all cases now 😄

@yash-nisar yash-nisar changed the title from TravisLintBear: Check for internet connection to WIP TravisLintBear: Check for internet connection Aug 10, 2017

@yash-nisar yash-nisar changed the title from WIP TravisLintBear: Check for internet connection to TravisLintBear: Check for internet connection Aug 10, 2017

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
if url_status is None:
return 'You are not connected to the internet.'
else:
url_status.raise_for_status()

This comment has been minimized.

@Makman2

Makman2 Aug 11, 2017

Member

what's raise_for_status?

@Makman2

Makman2 Aug 11, 2017

Member

what's raise_for_status?

This comment has been minimized.

@yash-nisar

yash-nisar Aug 12, 2017

Member

From the docs,

If we made a bad request (a 4XX client error or 5XX server error response), we can raise it with Response.raise_for_status():

More info here -> http://docs.python-requests.org/en/master/user/quickstart/#response-status-codes

@yash-nisar

yash-nisar Aug 12, 2017

Member

From the docs,

If we made a bad request (a 4XX client error or 5XX server error response), we can raise it with Response.raise_for_status():

More info here -> http://docs.python-requests.org/en/master/user/quickstart/#response-status-codes

This comment has been minimized.

@Makman2

Makman2 Aug 13, 2017

Member

Do we support raising exceptions inside check_prerequisites?

@Makman2

Makman2 Aug 13, 2017

Member

Do we support raising exceptions inside check_prerequisites?

This comment has been minimized.

@yash-nisar

yash-nisar Aug 14, 2017

Member

I've caught that exception we return the corresponding string -> Failed to establish a connection to the server.. I've also added a test for the same. 😄

@yash-nisar

yash-nisar Aug 14, 2017

Member

I've caught that exception we return the corresponding string -> Failed to establish a connection to the server.. I've also added a test for the same. 😄

This comment has been minimized.

@Makman2

Makman2 Aug 14, 2017

Member

Ah yeah damn sorry.... my bad 👍

@Makman2

Makman2 Aug 14, 2017

Member

Ah yeah damn sorry.... my bad 👍

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 12, 2017

Member

Updated @Makman2 (Maybe one last review)

Member

yash-nisar commented Aug 12, 2017

Updated @Makman2 (Maybe one last review)

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 14, 2017

Member

@Makman2 I've removed the pragma: no cover and tested that snippet as well, but there is a coverage failure.

Member

yash-nisar commented Aug 14, 2017

@Makman2 I've removed the pragma: no cover and tested that snippet as well, but there is a coverage failure.

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 15, 2017

Member

@Makman2 Should be ready now 😄

Member

yash-nisar commented Aug 15, 2017

@Makman2 Should be ready now 😄

Show outdated Hide outdated bears/yaml/TravisLintBear.py Outdated
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 15, 2017

Updated @Makman2

def check_prerequisites(cls):
base_check = super().check_prerequisites()
if base_check is not True:
return base_check

This comment has been minimized.

@Makman2

Makman2 Aug 15, 2017

Member

could you add a newline here? splits up the base check and the new check implemented by you :) I think it's really better to read with a newline here 👍

@Makman2

Makman2 Aug 15, 2017

Member

could you add a newline here? splits up the base check and the new check implemented by you :) I think it's really better to read with a newline here 👍

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 16, 2017

Done @Makman2

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2
Member

Makman2 commented Aug 16, 2017

ack 76b147e

TravisLintBear: Check for internet connection
Add a check for internet connection in the `check_prerequisites`
method without which the bear will fail to run.

Fixes #1978
@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar
Member

yash-nisar commented Aug 17, 2017

reack f51e54d

@yash-nisar

This comment has been minimized.

Show comment
Hide comment
@yash-nisar

yash-nisar Aug 17, 2017

Member

@Makman2 Rebased and pushed 👍

Member

yash-nisar commented Aug 17, 2017

@Makman2 Rebased and pushed 👍

@Makman2

This comment has been minimized.

Show comment
Hide comment
@Makman2
Member

Makman2 commented Aug 17, 2017

@rultor merge

@rultor

This comment has been minimized.

Show comment
Hide comment
@rultor

rultor Aug 17, 2017

@rultor merge

@Makman2 OK, I'll try to merge now. You can check the progress of the merge here

rultor commented Aug 17, 2017

@rultor merge

@Makman2 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit f51e54d into coala:master Aug 17, 2017

6 of 7 checks passed

ci/circleci CircleCI is running your tests
Details
codecov/project 100% (target 100%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
review/gitmate/commit No issues with this one - go ahead! :)
Details
review/gitmate/manual This commit was acknowledged.
Details
review/gitmate/pr All is well! :) (0 problems solved)
Details
@rultor

This comment has been minimized.

Show comment
Hide comment
@rultor

rultor Aug 17, 2017

@rultor merge

@Makman2 Done! FYI, the full log is here (took me 2min)

rultor commented Aug 17, 2017

@rultor merge

@Makman2 Done! FYI, the full log is here (took me 2min)

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