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

Improve logging around status setting on PR builds #6912

Merged
merged 2 commits into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion readthedocs/oauth/services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,18 @@ def send_build_status(self, build, commit, state):
if resp.status_code in [401, 403, 404]:
log.info(
'GitHub project does not exist or user does not have '
'permissions: project=%s',
'permissions: project=%s, user=%s',
project,
self.user,
)
return False

log.warning(
'Unknown GitHub status API response: project=%s, user=%s, status_code=%s',
project,
self.user,
resp.status_code
)
return False

# Catch exceptions with request or deserializing JSON
Expand Down
5 changes: 3 additions & 2 deletions readthedocs/rtd_tests/tests/test_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ def test_send_build_status_404_error(self, session, mock_logger):
self.assertFalse(success)
mock_logger.info.assert_called_with(
'GitHub project does not exist or user does not have '
'permissions: project=%s',
self.project
'permissions: project=%s, user=%s',
self.project,
self.user
)

@mock.patch('readthedocs.oauth.services.github.log')
Expand Down