Skip to content

Commit

Permalink
Revert "[ci/stats] fix git metadata collection (#66840)"
Browse files Browse the repository at this point in the history
This reverts commit 9eaf0c0.
  • Loading branch information
spalger committed May 19, 2020
1 parent 82bc3d7 commit 49213bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 44 deletions.
31 changes: 0 additions & 31 deletions vars/getCheckoutInfo.groovy

This file was deleted.

35 changes: 22 additions & 13 deletions vars/workers.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,33 @@ def base(Map params, Closure closure) {
}
}

def checkoutInfo = [:]
def scmVars = [:]

if (config.scm) {
// Try to clone from Github up to 8 times, waiting 15 secs between attempts
retryWithDelay(8, 15) {
checkout scm
}
scmVars = checkout scm

def mergeBase
if (env.ghprbTargetBranch) {
sh(
script: "cd kibana && git fetch origin ${env.ghprbTargetBranch}",
label: "update reference to target branch 'origin/${env.ghprbTargetBranch}'"
)
mergeBase = sh(
script: "cd kibana && git merge-base HEAD FETCH_HEAD",
label: "determining merge point with target branch 'origin/${env.ghprbTargetBranch}'",
returnStdout: true
).trim()
}

dir("kibana") {
checkoutInfo = getCheckoutInfo()
ciStats.reportGitInfo(
env.ghprbSourceBranch ?: scmVars.GIT_LOCAL_BRANCH ?: scmVars.GIT_BRANCH,
scmVars.GIT_COMMIT,
env.ghprbTargetBranch,
mergeBase
)
}

ciStats.reportGitInfo(
checkoutInfo.branch,
checkoutInfo.commit,
checkoutInfo.targetBranch,
checkoutInfo.mergeBase
)
}

withEnv([
Expand All @@ -78,7 +87,7 @@ def base(Map params, Closure closure) {
"PR_TARGET_BRANCH=${env.ghprbTargetBranch ?: ''}",
"PR_AUTHOR=${env.ghprbPullAuthorLogin ?: ''}",
"TEST_BROWSER_HEADLESS=1",
"GIT_BRANCH=${checkoutInfo.branch ?: ''}",
"GIT_BRANCH=${scmVars.GIT_BRANCH ?: ''}",
]) {
withCredentials([
string(credentialsId: 'vault-addr', variable: 'VAULT_ADDR'),
Expand Down

0 comments on commit 49213bd

Please sign in to comment.