-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add upstream causes to Slack messages #3269
Add upstream causes to Slack messages #3269
Conversation
Current Slack message example:
New Slack message:
Marking as WIP to allow discussion of formatting, text, and links. |
The new output format looks fine to me. I think this is a big improvement. We can always make further changes later based on real world results. |
Ok. Edit: Apparently I never marked it WIP so nothing to do there. |
@@ -195,6 +195,18 @@ def build_with_artifactory(JOB_NAME, VARIABLE_FILE, VENDOR_REPO, VENDOR_BRANCH, | |||
} | |||
} | |||
|
|||
def get_causes_recursively(cause) { | |||
if (cause.class.toString().contains("UpstreamCause")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reformat:
def cause_string = cause.getShortDescription()
if (cause instanceof hudson.model.Cause.UpstreamCause) {
for (upCause in cause.upstreamCauses) {
cause_string += '\n' + get_causes_recursively(upCause)
}
}
return cause_string
42f48cd
to
ddf6b5b
Compare
@vsebe updated based on feedback. Also moved the initial loop into another function. |
- Recursively find upstream causes - Print out upstream causes in Slack message - Allows the ability to distinguish between a nightly build and an OMR Acceptance for example - Requires Jenkins script approvals: - org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper getRawBuild - method hudson.model.Run getCauses - hudson.model.Cause$UpstreamCause getUpstreamCauses - hudson.model.Cause getShortDescription [skip ci] Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
ddf6b5b
to
e5dc9ca
Compare
@AdamBrousseau we're getting nothing on Slack now, please take a look |
Fixed. Hadn't run it on the OpenJ9 Jenkins yet so the scripts hadn't been approved. |
build and an OMR Acceptance for example
[skip ci]
Signed-off-by: Adam Brousseau adam.brousseau88@gmail.com