[AIROCMLIR-597][CI] Extract Jenkinsfile helpers into helpers/*.groovy and load them in a Bootstrap stage#2360
Open
bogdan-petkovic wants to merge 3 commits intoROCm:developfrom
Conversation
… in a Bootstrap stage Signed-off-by: bogdan-petkovic <bogdan.petkovic@htecgroup.com>
6cacfd3 to
947e828
Compare
Contributor
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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