Skip to content

Commit

Permalink
jenkins: retry getting queued item build url on BuildableItem response
Browse files Browse the repository at this point in the history
Return a RetryableError from GetBuildURL when Jenkins responds with
a BuildableItem class.
  • Loading branch information
fho committed Dec 16, 2024
1 parent e11c7d5 commit f031522
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/jenkins/client_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit f031522

Please sign in to comment.