Provisioning: Fix repos stuck in deletion (#111918)

This commit is contained in:
Stephanie Hingtgen
2025-10-02 00:04:55 -06:00
committed by GitHub
parent ebbcef5583
commit 6f0a8a344a
5 changed files with 57 additions and 2 deletions
@@ -975,6 +975,27 @@ func TestGithubClient_DeleteWebhook(t *testing.T) {
webhookID: 789,
wantErr: ErrServiceUnavailable,
},
{
name: "unauthorized to delete the webhook",
mockHandler: mockhub.NewMockedHTTPClient(
mockhub.WithRequestMatchHandler(
mockhub.DeleteReposHooksByOwnerByRepoByHookId,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusUnauthorized)
require.NoError(t, json.NewEncoder(w).Encode(github.ErrorResponse{
Response: &http.Response{
StatusCode: http.StatusUnauthorized,
},
Message: "401 bad credentials",
}))
}),
),
),
owner: "test-owner",
repository: "test-repo",
webhookID: 789,
wantErr: ErrUnauthorized,
},
{
name: "other error",
mockHandler: mockhub.NewMockedHTTPClient(