webhook events query and retry
xiazhilei opened this issue · comments
` for _, hook := range hooks {
hookEvents, _, err := git.Projects.ListHookWebhookEvents(projectID, hook.ID, nil)
if err != nil {
fmt.Printf("Error fetching hook events for hook %d: %v\n", hook.ID, err)
continue
}
for _, event := range hookEvents {
if event.Status == "failed" {
_, err := git.Projects.RedeliverHook(projectID, hook.ID, event.ID)
if err != nil {
fmt.Printf("Error retrying webhook for event %d: %v\n", event.ID, err)
} else {
fmt.Printf("Webhook retried for event %d\n", event.ID)
}
}
}
}`
ChatGPT gives the ListHookWebhookEvents method to query the list of events sent, and then retries those with a status of failure. However, I didn't find these two methods in the SDK. Is the SDK missing this method, or did GPT make it up?
You can find out by reading the docs: https://docs.gitlab.com/ee/api/api_resources.html