Skip to content

Commit a883241

Browse files
oktalzGopher Bot
authored andcommitted
CLEANUP/MINOR: ci: refine pipeline cancel logs
1 parent 81dc0b6 commit a883241

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cmd/gitlab-mr-pipelines/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ func main() {
9494
fmt.Printf("Canceling pipeline ID %d on project ID %d\n", p.ID, p.ProjectID)
9595
err = cancelPipeline(gitlabAPIURL, strconv.Itoa(p.ProjectID), p.ID, gitlabToken)
9696
if err != nil {
97-
// Log error but continue trying to cancel others
98-
fmt.Printf("Failed to cancel pipeline %d: %v\n", p.ID, err)
97+
// Non-fatal: best-effort cleanup, keep canceling the rest
98+
fmt.Printf("Warning: could not cancel pipeline %d (continuing): %v\n", p.ID, err)
9999
} else {
100100
fmt.Printf("Successfully requested cancellation for pipeline %d\n", p.ID)
101101
}
@@ -231,7 +231,7 @@ func cancelPipeline(apiURL, projectID string, pipelineID int, token string) erro
231231
fmt.Println("Pipeline already finished, nothing to do.") //nolint:forbidigo
232232
return nil
233233
}
234-
return fmt.Errorf("failed to cancel pipeline: status %d, body: %s", resp.StatusCode, string(body))
234+
return fmt.Errorf("cancel request returned status %d, body: %s", resp.StatusCode, string(body))
235235
}
236236

237237
return nil

0 commit comments

Comments
 (0)