[AIROCMLIR-597][CI] Extract Jenkinsfile helpers into helpers/*.groovy and load them in a Bootstrap stage#2360
Conversation
… in a Bootstrap stage Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
6cacfd3 to
947e828
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the main CI pipeline definition by extracting Jenkinsfile helper logic into per-domain Groovy scripts under mlir/utils/jenkins/helpers/, then loading and wiring those helpers in a new Bootstrap stage. This reduces the size/complexity of the primary Jenkinsfile and centralizes shared helper logic to support future de-duplication with downstream/release pipelines.
Changes:
- Added a
Bootstrapstage that checks out SCM,load()s helper scripts, and wires cross-helper dependencies. - Moved helper methods out of
mlir/utils/jenkins/Jenkinsfileinto six domain-focused helper files. - Updated Jenkinsfile call sites to use namespaced helper handles (e.g.,
ciLogic.*,nodeUtils.*,scmUtils.*, etc.).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mlir/utils/jenkins/Jenkinsfile | Removes inlined helpers, adds Bootstrap load/wiring, and updates call sites to namespaced helper objects. |
| mlir/utils/jenkins/helpers/scmUtils.groovy | Extracts SCM-related helpers (git health check, robust checkout). |
| mlir/utils/jenkins/helpers/nodeUtils.groovy | Extracts node health/Docker discovery logic and withHealthyNode() harness. |
| mlir/utils/jenkins/helpers/buildUtils.groovy | Extracts build helpers for rocMLIR + CK/MIGraphX. |
| mlir/utils/jenkins/helpers/testUtils.groovy | Extracts test/sweep/static-check/coverage helpers (includes the tail -n 1 fix). |
| mlir/utils/jenkins/helpers/reportUtils.groovy | Extracts report publication and perfDB archival helpers. |
| mlir/utils/jenkins/helpers/ciLogic.groovy | Extracts CI flow logic (labels/gating/splitting/failure classification/Teams notifications). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
dorde-antic
left a comment
There was a problem hiding this comment.
lgtm, finally a cleaner Jenkinsfile :)
wait for all types of CI runs to be successful before merging
Motivation
The primary
mlir/utils/jenkins/Jenkinsfilehas grown to ~2000 lines, the majority of which are helper functions defined at the top of the file. This makes the actual pipeline definition hard to read and to navigate, and forces the same helpers to be duplicated acrossJenkinsfile.downstreamandJenkinsfile.release(see the// ON CHANGING THESE, ALSO CHANGE Jenkinsfile.downstreammarkers). Extracting the helpers into a shared location is the first step toward eliminating that duplication.Two earlier attempts addressed this problem but neither was merged:
vars/directory at the repo root. Clean per-domain separation, but the implicit-Shared-Library mechanism requires the Jenkins controller to be configured with a Global Pipeline Library.PipelineHelpers.groovyand loaded it from aBootstrapstage. Fully self-contained, but consolidates ~2000 lines into one file, which keeps the original navigability problem.This PR combines the strengths of both: it adopts CI: Refactor Jenkinsfile helpers into implicit Shared Library #2092's per-domain file split (helpers grouped by purpose into separate files) and [AIROCMLIR-597][CI] Create PipelineHelpers and load them in Jenkinsfile via Bootstrap stage #2276's
load()-from-Bootstraploading mechanism.Technical Details
mlir/utils/jenkins/helpers/directory with six files:scmUtils,nodeUtils,buildUtils,testUtils,reportUtils,ciLogic— 37 helpers total.Bootstrapstage inJenkinsfiledoescheckout scm,loads each helper file, and wires cross-helper handles via@Field(
nodeUtils.scmUtils,testUtils.nodeUtils,testUtils.buildUtils).Jenkinsfileare namespaced (e.g.ciLogic.setHeartbeat()).Jenkinsfile: 2012 → 1099 lines.developexcept the cross-helper namespace prefixes and one deliberate shell bug fix intestUtils.collectCoverageData, per Copilot review on PR [AIROCMLIR-597][CI] Create PipelineHelpers and load them in Jenkinsfile via Bootstrap stage #2276 ([AIROCMLIR-597][CI] Create PipelineHelpers and load them in Jenkinsfile via Bootstrap stage #2276 (review)):Test Plan
mfmanavi21navi3xnavi4xvanillagfx950Test Result
Submission Checklist