Skip to content

Commit

Permalink
[Backport 6.x] Revert to the gradle-check alias logic rather than q…
Browse files Browse the repository at this point in the history
…uerying `-*` gradle check indices (#511)

Signed-off-by: Prudhvi Godithi <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 73b084e commit 9042485
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jacocoTestReport {
}
}

String version = '6.9.1'
String version = '6.9.2'

task updateVersion {
doLast {
Expand Down
5 changes: 3 additions & 2 deletions src/gradlecheck/OpenSearchMetricsQuery.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ class OpenSearchMetricsQuery {
this.script = script
}

// Ensure the alias `gradle-check` is created targeting all the gradle-check-* indices.
def fetchMetrics(String query) {
def response = script.sh(
script: """
set -e
set +x
MONTH_YEAR=\$(date +"%m-%Y")
curl -s -XGET "${metricsUrl}/gradle-check-*/_search" --aws-sigv4 "aws:amz:us-east-1:es" --user "${awsAccessKey}:${awsSecretKey}" -H "x-amz-security-token:${awsSessionToken}" -H 'Content-Type: application/json' -d "${query}" | jq '.'
curl -s -XGET "${metricsUrl}/gradle-check/_search" --aws-sigv4 "aws:amz:us-east-1:es" --user "${awsAccessKey}:${awsSecretKey}" -H "x-amz-security-token:${awsSessionToken}" -H 'Content-Type: application/json' -d "${query}" | jq '.'
""",
returnStdout: true
).trim()
return new JsonSlurper().parseText(response)
}
}
}
3 changes: 3 additions & 0 deletions vars/publishGradleCheckTestResults.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ void indexFailedTestData() {
"type": "keyword"
}
}
},
"aliases": {
"gradle-check": {}
}
}'
echo "INDEX NAME IS \$INDEX_NAME"
Expand Down

0 comments on commit 9042485

Please sign in to comment.