Skip to content

Commit

Permalink
Revert to the gradle-check alias logic rather than querying -* gr…
Browse files Browse the repository at this point in the history
…adle check indices (#510)

Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi authored Oct 1, 2024
1 parent 2f05fd8 commit 5e17480
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 5e17480

Please sign in to comment.