GitHub code host doesn't report problems when adding invalid tokens
Created by: artemruts
Problem
When adding invalid tokens (think bla-bla-42
) for GitHub code host, backend reports code host as successfully added.
GraphQL mutation is AddExternalService
.
Based on the architecture, I'd guess this happens due to indirection and throttling @ github-proxy and the errors will be eventually reported when code hosts starts to sync.
Steps to reproduce
- Make sure your user has
allowUserExternalServicePublic
tag set - Navigate to code host connections page
https://sourcegraph.com/users/<your user>/settings/code-hosts
- Open Browser DevTools and monitor network
- Add
bad-token
personal access token to GitHub code host connection - Examine
200
response from https://sourcegraph.com/.api/graphql?AddExternalService, it will havewarning
andlastSyncError
set asnull
-
⚠ ️ Instead we should havewarning
orlastSyncError
have an error message.