Skip to content
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

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

MichelleXiaoxiaoWang
Copy link
Contributor

Signed-off-by: Xiaoxiao Wang michellejavajs@gmail.com

@MichelleXiaoxiaoWang MichelleXiaoxiaoWang changed the title WIP: distinguish SLACK "warning" "danger" color Distinguish SLACK "warning" "danger" color Jul 17, 2018
@MichelleXiaoxiaoWang MichelleXiaoxiaoWang force-pushed the Slack-Color branch 2 times, most recently from 16ed19c to c042a09 Compare July 17, 2018 15:58
@AdamBrousseau
Copy link
Contributor

Unstable:

Unstable: xiaoxiao-Pipeline-Build-Test-JDK10-linux_x86-64_cmprssptrs #11 (Open)
Downstream Job: xiaoxiao-Test-sanity.functional-JDK10-linux_x86-64_cmprssptrs #13 (Open)

Failure:

Failure in: xiaoxiao-Pipeline-Build-Test-JDK10-linux_x86-64_cmprssptrs #10 (Open)
Downstream Job: xiaoxiao-Test-sanity.functional-JDK10-linux_x86-64_cmprssptrs #12 (Open)

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>)"
}
Copy link
Contributor

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')) {
Copy link
Contributor

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

@MichelleXiaoxiaoWang MichelleXiaoxiaoWang force-pushed the Slack-Color branch 5 times, most recently from 6383d0e to c2826c7 Compare July 19, 2018 21:02
}
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"
Copy link
Contributor

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.

Copy link
Contributor

@AdamBrousseau AdamBrousseau left a 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

@AdamBrousseau
Copy link
Contributor

@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}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 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>
@llxia llxia merged commit f2cb33b into eclipse-openj9:master Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants