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

Handle 401, 403 and 404 status codes when hitting GitHub for webhook #4805

Merged
merged 2 commits into from
Jan 10, 2019

Conversation

humitos
Copy link
Member

@humitos humitos commented Oct 24, 2018

This is a work in progress PR.

All of our integrations are not handling these error codes: 401, 403 and 404. All of them are being logged as errors in our application. This PR handle them to log as info instead of an error (via the else: clause).

Also, this code may need to be repeated across all the integrations and twice on each. So, maybe it's possible to refactor this all together: https://github.com/rtfd/readthedocs-corporate/issues/372

@humitos humitos added the PR: work in progress Pull request is not ready for full review label Oct 24, 2018
@humitos humitos added this to the Cleanup milestone Oct 29, 2018
@ericholscher
Copy link
Member

Looks reasonable, what else is needed here?

@humitos
Copy link
Member Author

humitos commented Nov 1, 2018

Changes are good, but I did them only for GitHub in this PR. I need to extend this to all the services and because of this, I wanted to refactor a little those files to share more code.

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2019
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

@humitos merge this now, and create an issue for the others?

@humitos
Copy link
Member Author

humitos commented Jan 10, 2019

You say it, you have it! :)

Issue to track the rest of this work at #5092

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@humitos humitos force-pushed the humitos/integrations/handle-error-codes branch from 53928f0 to e17d0cd Compare January 10, 2019 17:43
@codecov
Copy link

codecov bot commented Jan 10, 2019

Codecov Report

Merging #4805 into master will decrease coverage by 0.63%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #4805      +/-   ##
==========================================
- Coverage   76.87%   76.23%   -0.64%     
==========================================
  Files         158      158              
  Lines        9997    10037      +40     
  Branches     1255     1268      +13     
==========================================
- Hits         7685     7652      -33     
- Misses       1980     2042      +62     
- Partials      332      343      +11
Impacted Files Coverage Δ
readthedocs/oauth/services/github.py 42.76% <0%> (-0.83%) ⬇️
readthedocs/vcs_support/backends/svn.py 27.69% <0%> (-11.71%) ⬇️
readthedocs/vcs_support/backends/hg.py 59.09% <0%> (-8.61%) ⬇️
readthedocs/builds/forms.py 87.87% <0%> (-7.96%) ⬇️
readthedocs/restapi/client.py 82.35% <0%> (-5.53%) ⬇️
readthedocs/core/utils/__init__.py 75% <0%> (-5.42%) ⬇️
readthedocs/builds/views.py 85.71% <0%> (-5.03%) ⬇️
readthedocs/restapi/views/integrations.py 87.23% <0%> (-4.72%) ⬇️
readthedocs/projects/utils.py 54.54% <0%> (-4.55%) ⬇️
readthedocs/builds/models.py 75.98% <0%> (-2.85%) ⬇️
... and 43 more

1 similar comment
@codecov
Copy link

codecov bot commented Jan 10, 2019

Codecov Report

Merging #4805 into master will decrease coverage by 0.63%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #4805      +/-   ##
==========================================
- Coverage   76.87%   76.23%   -0.64%     
==========================================
  Files         158      158              
  Lines        9997    10037      +40     
  Branches     1255     1268      +13     
==========================================
- Hits         7685     7652      -33     
- Misses       1980     2042      +62     
- Partials      332      343      +11
Impacted Files Coverage Δ
readthedocs/oauth/services/github.py 42.76% <0%> (-0.83%) ⬇️
readthedocs/vcs_support/backends/svn.py 27.69% <0%> (-11.71%) ⬇️
readthedocs/vcs_support/backends/hg.py 59.09% <0%> (-8.61%) ⬇️
readthedocs/builds/forms.py 87.87% <0%> (-7.96%) ⬇️
readthedocs/restapi/client.py 82.35% <0%> (-5.53%) ⬇️
readthedocs/core/utils/__init__.py 75% <0%> (-5.42%) ⬇️
readthedocs/builds/views.py 85.71% <0%> (-5.03%) ⬇️
readthedocs/restapi/views/integrations.py 87.23% <0%> (-4.72%) ⬇️
readthedocs/projects/utils.py 54.54% <0%> (-4.55%) ⬇️
readthedocs/builds/models.py 75.98% <0%> (-2.85%) ⬇️
... and 43 more

@humitos humitos force-pushed the humitos/integrations/handle-error-codes branch from 9ea2f78 to 2ae1c26 Compare January 10, 2019 18:26
@ericholscher ericholscher merged commit 392ff56 into master Jan 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the humitos/integrations/handle-error-codes branch January 10, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: work in progress Pull request is not ready for full review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants