From f0315224495ce6aa58a420fc3c978df5db10a956 Mon Sep 17 00:00:00 2001 From: Fabian Holler Date: Mon, 16 Dec 2024 15:04:25 +0100 Subject: [PATCH] jenkins: retry getting queued item build url on BuildableItem response Return a RetryableError from GetBuildURL when Jenkins responds with a BuildableItem class. --- internal/jenkins/client_queue.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/jenkins/client_queue.go b/internal/jenkins/client_queue.go index c9410bc..ba762cd 100644 --- a/internal/jenkins/client_queue.go +++ b/internal/jenkins/client_queue.go @@ -82,7 +82,9 @@ func (s *Client) GetBuildURL(ctx context.Context, queueItemID int64) (string, er case "": return "", fmt.Errorf("unmarshalled queue item response contains an empty class value, response: %s", string(respBytes)) - case "hudson.model.Queue$WaitingItem", "hudson.model.Queue$BlockedItem": + case "hudson.model.Queue$WaitingItem", + "hudson.model.Queue$BlockedItem", + "hudson.model.Queue$BuildableItem": return "", goorderr.NewRetryableAnytimeError(ErrBuildScheduled) case "hudson.model.Queue$LeftItem":