Skip to content

gitlab: Refresh expired accounts

Administrator requested to merge rs/refresh-expired-tokens into main

Created by: ryanslade

We ensure that even if a GitLab token expires, we still try to refresh it.

It was possible in the previous code that we would attempt to refresh the token with a small 10 second grace period and then it would take us more than 10 seconds to actually use the token. This could cause the token to be expired by the time we use it which would then cause us to mark the account as expired and never try to refresh it again.

Closes https://github.com/sourcegraph/sourcegraph/issues/37145, but not in the planned way.

The assumption in the above issue was that once a token had expired, repo syncing would no longer grant access to the user associated with the token. This was incorrect, the user sill has access it's just the one specific token (of which they may have many) that expired.

Test plan

Unit tests added

Merge request reports

Loading