From e8f943a67d693d8174c11a75efe731beaa37d9bd Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy Date: Sat, 5 Apr 2025 12:50:54 +0200 Subject: [PATCH 1/3] Add TeamCity configuration to automatically check for tzdb updates --- .teamcity/additionalConfiguration.kt | 76 +++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/.teamcity/additionalConfiguration.kt b/.teamcity/additionalConfiguration.kt index edf2a5ea..2f5eab1c 100644 --- a/.teamcity/additionalConfiguration.kt +++ b/.teamcity/additionalConfiguration.kt @@ -3,9 +3,16 @@ * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. */ +import jetbrains.buildServer.configs.kotlin.BuildType import jetbrains.buildServer.configs.kotlin.DslContext import jetbrains.buildServer.configs.kotlin.Project import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher +import jetbrains.buildServer.configs.kotlin.buildFeatures.notifications +import jetbrains.buildServer.configs.kotlin.buildSteps.gradle +import jetbrains.buildServer.configs.kotlin.buildSteps.script +import jetbrains.buildServer.configs.kotlin.toId +import jetbrains.buildServer.configs.kotlin.triggers.schedule +import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot fun Project.additionalConfiguration() { knownBuilds.buildAll.features { @@ -19,4 +26,71 @@ fun Project.additionalConfiguration() { } } } -} \ No newline at end of file + + vcsRoot(EggertTzRepo) + + BuildType { + id("Check_Updates") + name = "Check for timezone database updates" + description = "Queries the Internet to see if the timezone data was updated" + + vcs { + root(DslContext.settingsRoot) + root(EggertTzRepo, "+:. => tz") + } + + steps { + script { + name = "Check if a new version of the timezone database is present" + id = "Check_if_a_new_version_of_the_timezone_database_is_present" + scriptContent = """ + set -efu + latest_tag=$(git -C tz/ describe --abbrev=0 --tags) + current_tag=$(grep tzdbVersion gradle.properties | cut -d= -f2) + if [ "${'$'}latest_tag" != "${'$'}current_tag" ]; then + printf "A new version of the timezone database is available: %s\n" "${'$'}latest_tag" >&2 + exit 1 + fi + """.trimIndent() + } + gradle { + name = "Check if the Windows names need updating" + id = "Check_if_the_Windows_names_need_updating" + tasks = "downloadWindowsZonesMapping" + jdkHome = "%env.JDK_18_x64%" + } + } + + triggers { + schedule { + schedulingPolicy = daily { + hour = 1 + minute = 50 + } + triggerBuild = always() + } + } + + features { + notifications { + notifierSettings = slackNotifier { + connection = "PROJECT_EXT_51" + sendTo = "UL2TZ4V55" // Dmitry Khalanskiy + messageFormat = simpleMessageFormat() + } + buildFailed = true + firstFailureAfterSuccess = true + } + } + + requirements { + doesNotContain("teamcity.agent.jvm.os.name", "Windows") + } + }.also { buildType(it) } +} + +object EggertTzRepo : GitVcsRoot({ + name = "Timezone database repository" + url = "https://github.com/eggert/tz" + branch = "refs/heads/main" +}) \ No newline at end of file From 5ddb868561ad681625e1d15d393dbc12b3e31492 Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy Date: Sat, 5 Apr 2025 13:49:47 +0200 Subject: [PATCH 2/3] Update the Windows timezone mappings --- core/windows/src/internal/WindowsZoneNames.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/windows/src/internal/WindowsZoneNames.kt b/core/windows/src/internal/WindowsZoneNames.kt index 70f7ceb7..92c1e3f5 100644 --- a/core/windows/src/internal/WindowsZoneNames.kt +++ b/core/windows/src/internal/WindowsZoneNames.kt @@ -225,7 +225,6 @@ internal val standardToWindows: Map = mutableMapOf( "Asia/Brunei" to "Singapore Standard Time", "Asia/Calcutta" to "India Standard Time", "Asia/Chita" to "Transbaikal Standard Time", - "Asia/Choibalsan" to "Ulaanbaatar Standard Time", "Asia/Colombo" to "Sri Lanka Standard Time", "Asia/Damascus" to "Syria Standard Time", "Asia/Dhaka" to "Bangladesh Standard Time", @@ -311,8 +310,6 @@ internal val standardToWindows: Map = mutableMapOf( "Australia/Melbourne" to "AUS Eastern Standard Time", "Australia/Perth" to "W. Australia Standard Time", "Australia/Sydney" to "AUS Eastern Standard Time", - "CST6CDT" to "Central Standard Time", - "EST5EDT" to "Eastern Standard Time", "Etc/GMT" to "UTC", "Etc/GMT+1" to "Cape Verde Standard Time", "Etc/GMT+10" to "Hawaiian Standard Time", @@ -410,8 +407,6 @@ internal val standardToWindows: Map = mutableMapOf( "Indian/Mauritius" to "Mauritius Standard Time", "Indian/Mayotte" to "E. Africa Standard Time", "Indian/Reunion" to "Mauritius Standard Time", - "MST7MDT" to "Mountain Standard Time", - "PST8PDT" to "Pacific Standard Time", "Pacific/Apia" to "Samoa Standard Time", "Pacific/Auckland" to "New Zealand Standard Time", "Pacific/Bougainville" to "Bougainville Standard Time", From 8f5330a413a157b5800dfdb00c97f0f15afceccc Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy Date: Tue, 29 Apr 2025 11:43:38 +0200 Subject: [PATCH 3/3] Send to #kotlin-lib-team instead --- .teamcity/additionalConfiguration.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.teamcity/additionalConfiguration.kt b/.teamcity/additionalConfiguration.kt index 2f5eab1c..14d6556a 100644 --- a/.teamcity/additionalConfiguration.kt +++ b/.teamcity/additionalConfiguration.kt @@ -75,7 +75,7 @@ fun Project.additionalConfiguration() { notifications { notifierSettings = slackNotifier { connection = "PROJECT_EXT_51" - sendTo = "UL2TZ4V55" // Dmitry Khalanskiy + sendTo = "#kotlin-lib-team" messageFormat = simpleMessageFormat() } buildFailed = true @@ -93,4 +93,4 @@ object EggertTzRepo : GitVcsRoot({ name = "Timezone database repository" url = "https://github.com/eggert/tz" branch = "refs/heads/main" -}) \ No newline at end of file +})