diff --git a/build.gradle b/build.gradle index 3c48cbdd..a765785e 100644 --- a/build.gradle +++ b/build.gradle @@ -127,7 +127,7 @@ jacocoTestReport { } } -String version = '6.9.1' +String version = '6.9.2' task updateVersion { doLast { diff --git a/src/gradlecheck/OpenSearchMetricsQuery.groovy b/src/gradlecheck/OpenSearchMetricsQuery.groovy index d732677d..a3a3862f 100644 --- a/src/gradlecheck/OpenSearchMetricsQuery.groovy +++ b/src/gradlecheck/OpenSearchMetricsQuery.groovy @@ -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) } -} \ No newline at end of file +} diff --git a/vars/publishGradleCheckTestResults.groovy b/vars/publishGradleCheckTestResults.groovy index d09c19a1..8e023133 100644 --- a/vars/publishGradleCheckTestResults.groovy +++ b/vars/publishGradleCheckTestResults.groovy @@ -164,6 +164,9 @@ void indexFailedTestData() { "type": "keyword" } } + }, + "aliases": { + "gradle-check": {} } }' echo "INDEX NAME IS \$INDEX_NAME"