From 8864dcc3a4585fffefccfe4956fc53cb5c48dab6 Mon Sep 17 00:00:00 2001 From: Brock Hargreaves <253123018+brockhargreaves-amd@users.noreply.github.com> Date: Thu, 18 Jun 2026 21:16:24 +0000 Subject: [PATCH] [rocm-libraries] ROCm/rocm-libraries#8560 (commit f8362a1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [CK][CI] Post failure GitHub status on stage build errors (#8560) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Motivation Failed CI stages (e.g. Static checks) were left stuck on a `pending` GitHub status instead of reporting `failure`, so PRs showed an overall failure with no indication of which check actually failed. ## Technical Details `buildAndTest` posted `pending`/`success` statuses but its catch only rethrew, deferring failure reporting to `runOnHealthyNode` — which deferred right back. Neither posted `failure`. This adds a `failure` status post for real build errors in `buildAndTest`, while letting node-reroute signals (`NodeFault`/`TransientFault`) and aborts (`FlowInterruptedException`) propagate untouched so retries still work. Since every stage routes through `buildAndTest`, this fixes both the directly-called `Static checks` stage and the `runOnHealthyNode`-wrapped per-arch build stages. ## Test Plan Trigger a stage failure (e.g. introduce a clang-format violation) and confirm the corresponding GitHub status context transitions `pending` → `failure` rather than remaining `pending`. ## Test Result Pending CI run on a branch with a deliberate failure to confirm the status transition. ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. Co-authored-by: Claude Opus 4.7 --- groovy/vars/ck.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/groovy/vars/ck.groovy b/groovy/vars/ck.groovy index 3c327349e5..c58cd5f474 100644 --- a/groovy/vars/ck.groovy +++ b/groovy/vars/ck.groovy @@ -1025,8 +1025,12 @@ def buildAndTest(Map conf=[:]){ } setGithubStatus("${env.STAGE_NAME}", 'success', "Stage ${env.STAGE_NAME} passed") } + catch (org.ck.NodeFault e) { throw e } // reroute handled by runOnHealthyNode + catch (org.ck.TransientFault e) { throw e } // retry handled by runOnHealthyNode + catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { throw e } // abort: no status update catch (Exception e){ - throw e // runOnHealthyNode sets failure status — not here + setGithubStatus("${env.STAGE_NAME}", 'failure', "Stage ${env.STAGE_NAME} failed") + throw e } return retimage }