CI Skip passing jobs#4910
Merged
Merged
Conversation
pfultz2
requested changes
May 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Jenkins CI pipeline to avoid rerunning long stages when a Jenkins job is restarted on the same PR commit SHA, by checking existing GitHub commit statuses and conditionally skipping stages that have already succeeded.
Changes:
- Added
isStageCompleted(stageName)helper that queries GitHub commit statuses and skips stages that previously succeeded for the same SHA (unlessFORCE_REBUILDis set). - Added
FORCE_REBUILDpipeline parameter to override the skip behavior. - Wrapped multiple long-running
rocmteststages withif (!isStageCompleted(...))guards.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4910 +/- ##
========================================
Coverage 92.66% 92.66%
========================================
Files 588 588
Lines 30412 30412
========================================
Hits 28180 28180
Misses 2232 2232 🚀 New features to boost your workflow:
|
Comment on lines
+186
to
+198
| def response = sh( | ||
| script: """ | ||
| curl -s -L \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer \$TOKEN" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "https://api.github.com/repos/ROCmSoftwarePlatform/AMDMIGraphX/commits/${commitSha}/status" | ||
| """, | ||
| returnStdout: true | ||
| ).trim() | ||
| def json = new groovy.json.JsonSlurper().parseText(response) | ||
| result = json.statuses?.any { it.context == context && it.state == "success" } ?: false | ||
| } |
eddieliao
approved these changes
May 26, 2026
pfultz2
approved these changes
May 26, 2026
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
Each task in the job can take over 30 minutes to run. If a task fails for a random reason such as network timeout the entire the Jenkins job is restarted. This adds to the burden on the CI servers. The goal here is to skip a task if the Jenkins job was simply restarted using the same PR commit hash.
Technical Details
Check the GitHub PR status, skip if the commit status "Jenkins - xxx" is successful
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable