Use a wrapper function for github status in jenkins#4847
Open
pfultz2 wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Jenkins Pipeline wrapper to automatically set GitHub commit statuses (pending/failure/success) around a build closure, and refactors the rocmtest helper to use this wrapper instead of inline status-handling logic.
Changes:
- Add
autoSetGitStatusclosure to centralize commit status updates for a build block. - Update
rocmtestto rely onautoSetGitStatusand remove the previous try/catch/finally status logic.
Comment on lines
+123
to
+135
| def autoSetGitStatus = { Map conf = [:], Closure body -> | ||
| def statusContext = conf.get("context", "Unknown") | ||
| def commitSha = ${env.GIT_COMMIT}; | ||
| try { | ||
| setCommitStatus(commitSha, 'pending', statusContext, 'Building') | ||
| body() | ||
| } | ||
| catch (Exception ex) { | ||
| setCommitStatus(commitSha, 'failure', statusContext, 'Build failed') | ||
| throw ex | ||
| } | ||
| setCommitStatus(commitSha, 'success', statusContext, 'Build succeeded') | ||
| } |
Comment on lines
+149
to
+153
| @@ -136,13 +150,11 @@ def rocmtest = { Map conf = [:], Closure body -> | |||
| def statusContext = "Jenkins - ${variant}" | |||
| def buildResult = 'failure' | |||
|
|
|||
| try { | |||
| autoSetGitStatus(context: "Jenkins - ${variant}") { | |||
Collaborator
Author
There was a problem hiding this comment.
@copilot apply changes based on this feedback
Contributor
There was a problem hiding this comment.
Removed the unused commitSha, statusContext, and buildResult variables from rocmtest in commit 7c14204.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ROCm/AMDMIGraphX/sessions/4170ff9b-b386-490d-bf69-64900ebb8a32 Co-authored-by: pfultz2 <1306044+pfultz2@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4847 +/- ##
========================================
Coverage 92.85% 92.85%
========================================
Files 584 584
Lines 30147 30147
========================================
Hits 27992 27992
Misses 2155 2155 🚀 New features to boost your workflow:
|
Collaborator
|
Rekicking the CI since the previous run could have been a CI internal error |
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
This works similar to how it did before.
Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable