From d666e3386b8869195251a3e3bac78ff1933783e9 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:26:03 +0000 Subject: [PATCH] Determine upstream actual tagging date rather than the commit for daily build status (#944) * Use taggerdate for determining daily status build age Signed-off-by: Andrew Leonard * Use taggerdate for determining daily status build age Signed-off-by: Andrew Leonard * Use taggerdate for determining daily status build age Signed-off-by: Andrew Leonard * Use taggerdate for determining daily status build age Signed-off-by: Andrew Leonard * Use taggerdate for determining daily status build age Signed-off-by: Andrew Leonard * Use taggerdate for determining daily status build age Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard --- tools/nightly_build_and_test_stats.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/nightly_build_and_test_stats.groovy b/tools/nightly_build_and_test_stats.groovy index 16bb91536..4e1e48767 100644 --- a/tools/nightly_build_and_test_stats.groovy +++ b/tools/nightly_build_and_test_stats.groovy @@ -52,7 +52,8 @@ def getOpenjdkBuildTagAge(String version, String tag) { openjdkRepo = "https://github.com/openjdk/jdk8u.git" } - def date = sh(returnStdout: true, script:"(rm -rf tmpRepo; git clone --depth 1 --branch ${tag} ${openjdkRepo} tmpRepo; cd tmpRepo; git log --tags --simplify-by-decoration --pretty=\"format:PUBLISH_DATE=%cI\") | grep PUBLISH_DATE | cut -d\"=\" -f2 | tr -d '\\n'") + def date = sh(returnStdout: true, script:"(rm -rf tmpRepo; git clone ${openjdkRepo} tmpRepo; cd tmpRepo; git for-each-ref --format=\"%(refname:short) %(taggerdate:format:%Y-%m-%dT%H:%M:%S%z)\" \"refs/tags/*\"; cd ..; rm -rf tmpRepo) | grep \"${tag}\" | cut -d\" \" -f2 | sed -e 's/.\\{22\\}/&:/1' | tr -d '\\n'") + def tagTs = Instant.parse(date).atZone(ZoneId.of('UTC')) def now = ZonedDateTime.now(ZoneId.of('UTC')) def days = ChronoUnit.DAYS.between(tagTs, now)