From ea8587774ac7f5994bfc3c8fffe0a6baf0a1c553 Mon Sep 17 00:00:00 2001 From: Aaron Ogata Date: Tue, 9 Jun 2020 09:38:30 -0700 Subject: [PATCH] improve UX around non-merged parent commits refs CCI-364 Change-Id: I4bb5ee8ff453833f4ecbf0c86d7496a9751d936e Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239657 Tested-by: Service Cloud Jenkins QA-Review: Ryan Norton Product-Review: Aaron Ogata Reviewed-by: Ryan Norton --- Jenkinsfile | 4 +++- build/new-jenkins/linters/run-gergich.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec301b04974..44c4dcde96a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -421,7 +421,9 @@ pipeline { script { if (isPatchsetSlackableOnFailure()) { def branchSegment = env.GERRIT_BRANCH ? "[$env.GERRIT_BRANCH]" : '' - def authorSegment = env.GERRIT_EVENT_ACCOUNT_NAME ? "Patchset by ${env.GERRIT_EVENT_ACCOUNT_NAME}. " : '' + def authorSlackId = env.GERRIT_EVENT_ACCOUNT_EMAIL ? slackUserIdFromEmail(email: env.GERRIT_EVENT_ACCOUNT_EMAIL, botUser: true, tokenCredentialId: 'slack-user-id-lookup') : '' + def authorSlackMsg = authorSlackId ? "<@$authorSlackId>" : env.GERRIT_EVENT_ACCOUNT_NAME + def authorSegment = authorSlackMsg ? "Patchset by ${authorSlackMsg}. " : '' slackSend( channel: '#canvas_builds', color: 'danger', diff --git a/build/new-jenkins/linters/run-gergich.sh b/build/new-jenkins/linters/run-gergich.sh index cdf3d6ae387..073963cd238 100755 --- a/build/new-jenkins/linters/run-gergich.sh +++ b/build/new-jenkins/linters/run-gergich.sh @@ -31,7 +31,7 @@ export GERGICH_REVIEW_LABEL="Lint-Review" # when parent is not in \$GERRIT_BRANCH (i.e. master) if ! git merge-base --is-ancestor HEAD~1 \$GERRIT_BRANCH; then message="This commit is built upon commits not currently merged in \$GERRIT_BRANCH. Ensure that your dependent patchsets are merged first!\\n" - gergich comment "{\"path\":\"/COMMIT_MSG\",\"position\":1,\"severity\":\"error\",\"message\":\"\$message\"}" + gergich comment "{\"path\":\"/COMMIT_MSG\",\"position\":1,\"severity\":\"warn\",\"message\":\"\$message\"}" fi # we need to remove the hooks because compile_assets calls yarn install which will