Skip to content

perf(qa): reuse cached non-target content on QA slug-targeted rebuilds despite feed drift - #2057

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-qa-fastpath-feed-drift
Aug 27, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-qa-fastpath-feed-drift

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

QA slug-targeted rebuilds take ~10 min vs prod's ~90s for the same single-tutorial change. Investigation of run 33103082513 (per-step timing + full log):

  • The slug-filter works on QA ([slug-filter] scoped Phase 2 to 1 repo(s)); discovery is not the cost.
  • The cost is a full regen of all ~2100 tutorials, triggered by [content-cache] fast path disabled — feed fingerprint changed. The fingerprint hashes catalog + tag-labels (fetch-tutorials.ts:864). QA rebuilds run rarely while prod republishes on every merge, so by each QA run the catalog has drifted and the fingerprint almost always mismatches → the content-cache fast path is chronically defeated on QA.

Fix

Add decideFastPath({ allowFeedDrift }) and set allowFeedDrift: channel === 'qa'. On QA slug-targeted runs the fast path now reuses cached non-target pages despite feed drift (the target slug is always regenerated — its cache is busted upstream). Prod is unchanged (defaults false → strict feed-freshness).

Tradeoff (approved)

Non-target QA preview pages may show slightly stale nav/tags until the next full QA rebuild. Acceptable for an author-preview channel; buys ~90s single-slug previews.

Tests

+4 decideFastPath cases (eligible on drift with allowFeedDrift; still requires a sidecar + slug-targeted run). 18 content-cache tests pass. Change is type-clean (only pre-existing baseline @types/node noise in these files).

…s despite feed drift

QA rebuilds ran ~10min (vs prod ~90s) for a single-slug preview. Root
cause: the content-cache fast path (decideFastPath) disables on a feed
fingerprint mismatch (catalog/tag-labels), forcing a full regen of all
~2100 tutorials. QA rebuilds are infrequent while prod republishes on
every merge, so by each QA run the catalog has drifted and the
fingerprint almost always mismatches — chronically defeating the fast
path. (The slug-filter Phase-2 scoping already works on QA; the full
regen, not discovery, was the cost.)

Add decideFastPath({ allowFeedDrift }) and set it for channel === 'qa'
only. On QA slug-targeted runs the fast path now reuses cached
non-target pages despite feed drift (the target slug is always
regenerated). Trades slightly-stale nav/tags on OTHER preview pages
(corrected on the next full QA rebuild) for a ~90s targeted preview.
Prod keeps strict feed-freshness (allowFeedDrift defaults false).

Tests: +4 decideFastPath cases (allowFeedDrift eligible on drift; still
requires sidecar + slug-targeted). 18 content-cache tests pass.
@jung-thomas
jung-thomas merged commit 27453d1 into DEV Aug 27, 2026
3 checks passed
@jung-thomas
jung-thomas deleted the worktree-qa-fastpath-feed-drift branch August 27, 2026 19:30
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.

1 participant