From 89d826be2979b975400b4424897c5ab665a4fb90 Mon Sep 17 00:00:00 2001 From: lyen1688 Date: Fri, 14 Aug 2026 23:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=88=86=E7=BB=84=E7=94=A8=E9=87=8F=20PR=20=E7=9A=84=20CI=20?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 恢复分组时区测试进入前的全局时区,避免污染高峰计费和支付租约测试。同步升级 Go 1.26.6 与 nanoid 3.3.18,清除后端和前端安全门禁。 --- .github/workflows/backend-ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/security-scan.yml | 2 +- backend/go.mod | 2 +- .../service/custom_group_usage_rollup_test.go | 17 +++++++++++------ frontend/pnpm-lock.yaml | 8 ++++---- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 21a4fea79..6c4a028c9 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -32,7 +32,7 @@ jobs: cache-dependency-path: backend/go.sum - name: Verify Go version run: | - go version | grep -q 'go1.26.5' + go version | grep -q 'go1.26.6' - name: Unit tests working-directory: backend run: make test-unit @@ -72,7 +72,7 @@ jobs: cache-dependency-path: backend/go.sum - name: Verify Go version run: | - go version | grep -q 'go1.26.5' + go version | grep -q 'go1.26.6' - name: golangci-lint uses: golangci/golangci-lint-action@v9 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ba01833c..4ecc8a26b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -115,7 +115,7 @@ jobs: - name: Verify Go version run: | - go version | grep -q 'go1.26.5' + go version | grep -q 'go1.26.6' # Docker setup for GoReleaser - name: Set up QEMU diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 96a7ae4ed..0e68d950a 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -23,7 +23,7 @@ jobs: cache-dependency-path: backend/go.sum - name: Verify Go version run: | - go version | grep -q 'go1.26.5' + go version | grep -q 'go1.26.6' - name: Run govulncheck working-directory: backend run: | diff --git a/backend/go.mod b/backend/go.mod index d6f1c10ed..d5188b3ca 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -1,6 +1,6 @@ module github.com/Wei-Shaw/sub2api -go 1.26.5 +go 1.26.6 require ( entgo.io/ent v0.14.5 diff --git a/backend/internal/service/custom_group_usage_rollup_test.go b/backend/internal/service/custom_group_usage_rollup_test.go index 7be65037a..35c568a45 100644 --- a/backend/internal/service/custom_group_usage_rollup_test.go +++ b/backend/internal/service/custom_group_usage_rollup_test.go @@ -10,9 +10,16 @@ import ( "github.com/stretchr/testify/require" ) +func useGroupUsageTestTimezone(t *testing.T, name string) { + t.Helper() + + previousName := appTimezone.Name() + require.NoError(t, appTimezone.Init(name)) + t.Cleanup(func() { require.NoError(t, appTimezone.Init(previousName)) }) +} + func TestGroupUsageDateUsesConfiguredTimezoneBoundary(t *testing.T) { - require.NoError(t, appTimezone.Init("America/New_York")) - t.Cleanup(func() { require.NoError(t, appTimezone.Init("Asia/Shanghai")) }) + useGroupUsageTestTimezone(t, "America/New_York") beforeMidnight := time.Date(2026, 3, 9, 3, 59, 59, 0, time.UTC) atMidnight := time.Date(2026, 3, 9, 4, 0, 0, 0, time.UTC) @@ -23,8 +30,7 @@ func TestGroupUsageDateUsesConfiguredTimezoneBoundary(t *testing.T) { } func TestGroupUsageParseDateUsesConfiguredTimezone(t *testing.T) { - require.NoError(t, appTimezone.Init("America/New_York")) - t.Cleanup(func() { require.NoError(t, appTimezone.Init("Asia/Shanghai")) }) + useGroupUsageTestTimezone(t, "America/New_York") parsed, err := ParseGroupUsageDate("2026-03-08") require.NoError(t, err) @@ -33,8 +39,7 @@ func TestGroupUsageParseDateUsesConfiguredTimezone(t *testing.T) { } func TestGroupUsageYesterdayStartHandlesDST(t *testing.T) { - require.NoError(t, appTimezone.Init("America/New_York")) - t.Cleanup(func() { require.NoError(t, appTimezone.Init("Asia/Shanghai")) }) + useGroupUsageTestTimezone(t, "America/New_York") todayStart := time.Date(2026, 3, 9, 4, 0, 0, 0, time.UTC) yesterdayStart := GroupUsageYesterdayStart(todayStart) diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index e17969c9c..4c86452cc 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -3322,8 +3322,8 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - nanoid@3.3.17: - resolution: {integrity: sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==} + nanoid@3.3.18: + resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -8443,7 +8443,7 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 - nanoid@3.3.17: {} + nanoid@3.3.18: {} natural-compare@1.4.0: {} @@ -8641,7 +8641,7 @@ snapshots: postcss@8.5.23: dependencies: - nanoid: 3.3.17 + nanoid: 3.3.18 picocolors: 1.1.1 source-map-js: 1.2.1