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: readthedocs/readthedocs-corporate#372

@humitos humitos added this to the Cleanup milestone Oct 29, 2018
@ericholscher
Copy link
Member

@ericholscher ericholscher commented Oct 31, 2018

Looks reasonable, what else is needed here?

Loading

@humitos
Copy link
Member Author

@humitos 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.

Loading

@stale
Copy link

@stale 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.

Loading

@stale stale bot added the Status: stale label Jan 10, 2019
Copy link
Member

@ericholscher ericholscher left a comment

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

Loading

@humitos
Copy link
Member Author

@humitos humitos commented Jan 10, 2019

You say it, you have it! :)

Issue to track the rest of this work at #5092

Loading

@stale stale bot removed the Status: stale label Jan 10, 2019
@humitos humitos force-pushed the humitos/integrations/handle-error-codes branch from 53928f0 to e17d0cd Jan 10, 2019
@codecov
Copy link

@codecov 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

Loading

1 similar comment
@codecov
Copy link

@codecov 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

Loading

@humitos humitos force-pushed the humitos/integrations/handle-error-codes branch from 9ea2f78 to 2ae1c26 Jan 10, 2019
@ericholscher ericholscher merged commit 392ff56 into master Jan 10, 2019
1 of 2 checks passed
Loading
@delete-merged-branch delete-merged-branch bot deleted the humitos/integrations/handle-error-codes branch Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants