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

[CI] Ping assignees on Github PR comments #91871

Merged
merged 2 commits into from
Feb 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions vars/githubPr.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def getNextCommentMessage(previousCommentInfo = [:], isFinal = false) {

messages << "To update your PR or re-run it, just comment with:\n`@elasticmachine merge upstream`"

catchErrors {
def assignees = getAssignees()
if (assignees) {
messages << "cc " + assignees.collect { "@${it}"}.join(" ")
}
}

info.builds << [
status: status,
url: env.BUILD_URL,
Expand Down Expand Up @@ -329,3 +336,19 @@ def shouldCheckCiMetricSuccess() {

return true
}

def getPR() {
withGithubCredentials {
def path = "repos/elastic/kibana/pulls/${env.ghprbPullId}"
return githubApi.get(path)
}
}

def getAssignees() {
def pr = getPR()
if (!pr) {
return []
}

return pr.assignees.collect { it.login }
}