-
Notifications
You must be signed in to change notification settings - Fork 738
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
Distinguish SLACK "warning" "danger" color #2393
Conversation
d12ef51
to
ee4fd06
Compare
16ed19c
to
c042a09
Compare
Unstable:
Failure:
|
currentBuild.result = "UNSTABLE" | ||
if (SLACK_CHANNEL) { | ||
slackSend channel: SLACK_CHANNEL, color: 'warning', message: "Unstable: ${env.JOB_NAME} #${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)\nDownstream Job: ${JOB_NAME} #${DOWNSTREAM_JOB_NUMBER} (<${DOWNSTREAM_JOB_URL}|Open>)" | ||
} |
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.
I think we should add an echo here, similar to the error
above but just print a WARNING: ...
We can probably get rid of the def MESSAGE = ''
since we only define/use it once.
So, if "FAILURE; error "failed"; else if "UNSTABLE"; echo "warning: unstable"
something like that?
@@ -132,23 +132,29 @@ def build_with_slack(JOB_NAME, PARAMETERS) { | |||
def MESSAGE = '' | |||
def JOB = build job: JOB_NAME, parameters: PARAMETERS, propagate: false | |||
|
|||
if (JOB.resultIsWorseOrEqualTo('UNSTABLE')) { |
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.
Is there a reason why we removed this if
? We don't need to get the DOWNSTREAM_JOB_NUMBER or URL is the build passes, we only use it in the slack message if we are FAILED or UNSTABLE
6383d0e
to
c2826c7
Compare
} | ||
error "Downstream job ${JOB_NAME} did not pass. Job Number: ${DOWNSTREAM_JOB_NUMBER} Job URL: ${DOWNSTREAM_JOB_URL}" | ||
} else if (JOB.result == "UNSTABLE") { | ||
echo "WARNING: ${env.JOB_NAME} ${env.BUILD_NUMBER} is unstable" |
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.
This warning should mention the downstream job name and number, similar to the error case.
c2826c7
to
3eb65ce
Compare
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.
This looks good to me now. Please squash the commits before merging
3eb65ce
to
5b49c41
Compare
@llxia for final review/merge |
} | ||
error "Downstream job ${JOB_NAME} did not pass. Job Number: ${DOWNSTREAM_JOB_NUMBER} Job URL: ${DOWNSTREAM_JOB_URL}" | ||
} else if (JOB.result == "UNSTABLE") { | ||
echo "WARNING: Downstream job ${JOB_NAME} is unstable. Job Number: ${DOWNSTREAM_JOB_NUMBER} Job URL: ${DOWNSTREAM_JOB_URL}" |
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.
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.
old version of the code, this one has it
https://ci.eclipse.org/openj9/view/Sandbox/job/xiaoxiao-Pipeline-Build-Test-JDK10-linux_x86-64_cmprssptrs/18/console
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.
although, that's still a slightly old version. I will ask Michelle to run one more.
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.
5b49c41
to
ab1ff50
Compare
- When the build result is "UNSTABLE" - instead of sending RED message to indicate failure - use YELLOW to indicate "warning" - two error messages [skip ci] Fixes eclipse-openj9#2347 Signed-off-by: Xiaoxiao Wang <michellejavajs@gmail.com>
ab1ff50
to
43a69e3
Compare
Signed-off-by: Xiaoxiao Wang michellejavajs@gmail.com