Skip to content

fix(catalog): align directory and permission tests with Windows semantics / 修复 catalog 测试的 Windows 平台兼容性 - #8408

Merged
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:fix/catalog-windows-ci-cross-platform
Aug 11, 2026
Merged

fix(catalog): align directory and permission tests with Windows semantics / 修复 catalog 测试的 Windows 平台兼容性#8408
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:fix/catalog-windows-ci-cross-platform

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Fix the two Windows-only CI failures blocking the v1.24.0 release candidate.

Problem
main-v2 push CI fails on the Windows leg in projectiondb.TestOpenAppliesLedgerAndPrivatePermissions and sessioncatalog.TestRebuildFailureKeepsExistingCatalog, introduced by the sqlite catalogs integration (#8257). Neither test ever ran on Windows before merge: the PR smoke suite (ci.yml test (Windows smoke)) omits these packages, while the full ./... sweep runs only on main-v2 pushes.

Root cause

  • os.ReadDir of a plain file returns ENOTDIR on POSIX but yields the file itself on Windows (FindFirstFile semantics), so Rebuild silently treated a file path as an empty directory and succeeded.
  • The projectiondb permission assertion assumes POSIX 0600, which os.Chmod cannot express on Windows (read-only bit only).

Fix

  • directorySignature stats the path first and rejects non-directories on every platform, making Rebuild behavior consistent across POSIX and Windows.
  • The permission assertion skips on Windows while keeping the ledger assertions.

Verification

  • go test -race ./internal/projectiondb/ ./internal/sessioncatalog/ green on macOS
  • gofmt, go vet (darwin + GOOS=windows), go build ./..., go run ./tools/repolint all clean
  • Fix is confirmed by the same two tests failing across three main-v2 push runs and passing locally

Cache-impact: none - no prompt/tool/provider files changed
Cache-guard: existing stable-prefix guard rationale; provider-visible prefix untouched

Problem: main-v2 push CI fails on the Windows leg in
projectiondb.TestOpenAppliesLedgerAndPrivatePermissions and
sessioncatalog.TestRebuildFailureKeepsExistingCatalog, introduced by
the sqlite catalogs integration and never executed on Windows because
the PR smoke suite omits these packages.

Root cause: os.ReadDir of a plain file returns ENOTDIR on POSIX but
yields the file itself on Windows (FindFirstFile semantics), so Rebuild
silently treated a file path as an empty directory. The projectiondb
permission assertion assumes POSIX 0600, which os.Chmod cannot express
on Windows (read-only bit only).

Fix: directorySignature stats the path first and rejects non-directories
on every platform; the permission assertion skips on Windows while
keeping the ledger assertions.

Verification: gofmt, go vet (darwin + GOOS=windows), go test -race on
both packages, repolint clean.
@SivanCola
SivanCola requested a review from esengine as a code owner August 11, 2026 14:26
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Aug 11, 2026
@SivanCola
SivanCola merged commit 42c17cc into esengine:main-v2 Aug 11, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant