From a0e8f768dd8ff89c16e6ec80f55b3c497d6afa5e Mon Sep 17 00:00:00 2001 From: Zyy Date: Thu, 1 Oct 2026 21:40:27 +0800 Subject: [PATCH] fix(ci): align container timezone checks with UTC Assert the UTC PostgreSQL timezone and runtime timezone configured by the deployment files. Keep the application business timezone independent from the infrastructure checks. Co-authored-by: Codex --- .github/actions/verify-container/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/verify-container/action.yml b/.github/actions/verify-container/action.yml index 9088e903b..068ff175e 100644 --- a/.github/actions/verify-container/action.yml +++ b/.github/actions/verify-container/action.yml @@ -117,8 +117,9 @@ runs: compose=(docker compose --project-name "$COMPOSE_PROJECT_NAME" \ -f deploy/compose.yaml) "${compose[@]}" up -d --no-build --wait postgres redis + # 基础设施使用 UTC,业务展示和调度时区由应用配置独立控制。 test "$("${compose[@]}" exec -T -e PGPASSWORD="$CI_POSTGRES_PASSWORD" postgres \ - psql -At -U codex_proxy -d codex_proxy -c "SHOW TimeZone;" | tr -d '\r')" = Asia/Shanghai + psql -At -U codex_proxy -d codex_proxy -c "SHOW TimeZone;" | tr -d '\r')" = UTC "${compose[@]}" exec -T -e PGPASSWORD="$CI_POSTGRES_PASSWORD" postgres \ psql -v ON_ERROR_STOP=1 -U codex_proxy -d codex_proxy -c \ "CREATE TABLE cpr_ci_persistence_probe (value text PRIMARY KEY); INSERT INTO cpr_ci_persistence_probe VALUES ('persisted');" @@ -148,8 +149,8 @@ runs: test "$status" = 204 test "$("${compose[@]}" exec -T codex-proxy-rs id -u | tr -d '\r')" = 10001 test "$("${compose[@]}" exec -T codex-proxy-rs id -g | tr -d '\r')" = 10001 - test "$("${compose[@]}" exec -T codex-proxy-rs date +%z | tr -d '\r')" = +0800 - test "$("${compose[@]}" exec -T codex-proxy-rs cat /etc/timezone | tr -d '\r')" = Asia/Shanghai + test "$("${compose[@]}" exec -T codex-proxy-rs date +%z | tr -d '\r')" = +0000 + test "$("${compose[@]}" exec -T codex-proxy-rs cat /etc/timezone | tr -d '\r')" = UTC "${compose[@]}" exec -T codex-proxy-rs sh -c \ 'touch /app/.runtime/data/.ci-write /app/.runtime/logs/.ci-write && rm /app/.runtime/data/.ci-write /app/.runtime/logs/.ci-write'