Skip to content

fix(site): seed the index from a local file - #181

Merged
abn merged 1 commit into
mainfrom
fix/build-site-seed-index
Nov 8, 2026
Merged

abn merged 1 commit into
mainfrom
fix/build-site-seed-index

Conversation

@abn

@abn abn commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Closes #180.

Problem

build-site seeded its cumulative index by fetching <pages-url>/index/static. Every failure
(timeout, non-200, Pages propagation delay) was logged at debug and the build continued from an empty
index. On a repository with more than one channel, the rebuild then contained only the current
channel's refs, so the other channel's refs disappeared silently after a successful deploy.

Change

  • Add --index-file <path> (env AETHERPAK_INDEX_FILE) to build-site, mapping to
    SiteOptions.IndexFile. When set, the index is read from the local file and the Pages index fetch
    is skipped; a missing or malformed seed fails the build.
  • Reject seed documents without a non-null Results array, so an error envelope served with HTTP 200
    cannot masquerade as an empty index.
  • Log a warning, instead of debug, when the Pages seed is unavailable, naming the consequence and
    pointing at --index-file.

Testing

  • New regression test: a dual-channel seed survives a build whose records cover only one channel, and
    the current record's digest wins.
  • Table tests for missing/malformed local seeds and for 500, non-JSON 200, missing Results, and
    null Results responses.
  • TestLoadSeedIndexReportsUnavailableSeed pins that a failed Pages seed is reported rather than
    swallowed.
  • go test ./..., go vet ./..., and make lint pass.

A failed Pages fetch started the rebuild from an empty index, so a
multi-channel deploy silently dropped the other channels' refs. Allow
build-site to read the published index from a local file, and warn
loudly when the Pages seed is unavailable.

Fixes #180.
@abn
abn added this pull request to stack #183 November 8, 2026 15:31
@abn
abn added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 1cf096b Nov 8, 2026
6 checks passed
@abn
abn deleted the fix/build-site-seed-index branch November 8, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build-site: allow seeding the index from a local path

1 participant