Skip to content

Commit b873ea3

Browse files
gqcnclaude
andcommitted
chore(openspec): archive sqlite change, consolidate legacy archives, and sync delta specs
Archive the completed sqlite-database-support change and consolidate older archived changes into 5 functional groups (file-storage, foundation, notification, org-structure, system-governance). Sync delta specs with new and updated spec files. Refactor timezone resolution into a pure function for improved testability. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 88bb876 commit b873ea3

64 files changed

Lines changed: 4073 additions & 101 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/lina-core/internal/service/config/config_protected_settings_test.go

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package config
66
import (
77
"context"
88
"testing"
9-
"time"
109
)
1110

1211
// TestRuntimeParamSpecsReturnsCopy verifies callers cannot mutate the shared
@@ -148,44 +147,23 @@ func TestProtectedConfigHelpersPreferOverridesAndFallbackDefaults(t *testing.T)
148147
// TestResolveCurrentSystemTimezoneUsesEnvironment verifies a valid TZ
149148
// environment variable is exposed directly to the frontend.
150149
func TestResolveCurrentSystemTimezoneUsesEnvironment(t *testing.T) {
151-
t.Setenv("TZ", "Asia/Tokyo")
152-
oldLocal := time.Local
153-
time.Local = time.UTC
154-
t.Cleanup(func() {
155-
time.Local = oldLocal
156-
})
157-
158-
if timezone := resolveCurrentSystemTimezone(); timezone != "Asia/Tokyo" {
150+
if timezone := resolveSystemTimezone("Asia/Tokyo", "UTC"); timezone != "Asia/Tokyo" {
159151
t.Fatalf("expected timezone from TZ environment, got %q", timezone)
160152
}
161153
}
162154

163155
// TestResolveCurrentSystemTimezoneFallsBackToProcessLocation verifies the
164156
// process location is used when TZ is invalid.
165157
func TestResolveCurrentSystemTimezoneFallsBackToProcessLocation(t *testing.T) {
166-
t.Setenv("TZ", "Invalid/Timezone")
167-
oldLocal := time.Local
168-
time.Local = time.UTC
169-
t.Cleanup(func() {
170-
time.Local = oldLocal
171-
})
172-
173-
if timezone := resolveCurrentSystemTimezone(); timezone != "UTC" {
158+
if timezone := resolveSystemTimezone("Invalid/Timezone", "UTC"); timezone != "UTC" {
174159
t.Fatalf("expected timezone fallback to process location UTC, got %q", timezone)
175160
}
176161
}
177162

178163
// TestResolveCurrentSystemTimezoneUsesProjectDefault verifies the helper uses
179164
// the project default when both environment and process location are local.
180165
func TestResolveCurrentSystemTimezoneUsesProjectDefault(t *testing.T) {
181-
t.Setenv("TZ", "")
182-
oldLocal := time.Local
183-
time.Local = time.FixedZone("Local", 0)
184-
t.Cleanup(func() {
185-
time.Local = oldLocal
186-
})
187-
188-
if timezone := resolveCurrentSystemTimezone(); timezone != "Asia/Shanghai" {
166+
if timezone := resolveSystemTimezone("", "Local"); timezone != "Asia/Shanghai" {
189167
t.Fatalf("expected project default timezone Asia/Shanghai, got %q", timezone)
190168
}
191169
}

apps/lina-core/internal/service/config/config_public_frontend.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,17 @@ func (s *serviceImpl) GetPublicFrontend(ctx context.Context) (*PublicFrontendCon
379379

380380
// resolveCurrentSystemTimezone returns the host timezone identifier exposed to the frontend.
381381
func resolveCurrentSystemTimezone() string {
382-
if timezone := strings.TrimSpace(os.Getenv("TZ")); timezone != "" && timezone != "Local" {
382+
return resolveSystemTimezone(os.Getenv("TZ"), time.Now().Location().String())
383+
}
384+
385+
// resolveSystemTimezone selects the first valid system timezone candidate.
386+
func resolveSystemTimezone(envTimezone string, processTimezone string) string {
387+
if timezone := strings.TrimSpace(envTimezone); timezone != "" && timezone != "Local" {
383388
if _, err := time.LoadLocation(timezone); err == nil {
384389
return timezone
385390
}
386391
}
387-
if timezone := strings.TrimSpace(time.Now().Location().String()); timezone != "" && timezone != "Local" {
392+
if timezone := strings.TrimSpace(processTimezone); timezone != "" && timezone != "Local" {
388393
if _, err := time.LoadLocation(timezone); err == nil {
389394
return timezone
390395
}

openspec/changes/sqlite-database-support/.openspec.yaml renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/.openspec.yaml

File renamed without changes.

openspec/changes/sqlite-database-support/design.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/design.md

File renamed without changes.

openspec/changes/sqlite-database-support/proposal.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/proposal.md

File renamed without changes.

openspec/changes/sqlite-database-support/specs/cluster-deployment-mode/spec.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/specs/cluster-deployment-mode/spec.md

File renamed without changes.

openspec/changes/sqlite-database-support/specs/database-bootstrap-commands/spec.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/specs/database-bootstrap-commands/spec.md

File renamed without changes.

openspec/changes/sqlite-database-support/specs/database-dialect-abstraction/spec.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/specs/database-dialect-abstraction/spec.md

File renamed without changes.

openspec/changes/sqlite-database-support/specs/dictionary-management/spec.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/specs/dictionary-management/spec.md

File renamed without changes.

openspec/changes/sqlite-database-support/specs/framework-bootstrap-installer/spec.md renamed to openspec/changes/archive/2026-05-08-sqlite-database-support/specs/framework-bootstrap-installer/spec.md

File renamed without changes.

0 commit comments

Comments
 (0)