Skip to content

fix(#2805): slug-targeted image refresh honours plural slugs input (no whole-catalog fallback) - #2809

Merged
jung-thomas merged 4 commits into
DEVfrom
worktree-fix-2805-plural-slugs
Oct 16, 2026
Merged

jung-thomas merged 4 commits into
DEVfrom
worktree-fix-2805-plural-slugs

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Fixes #2805.

Root cause

Run 38816499609 was a workflow_dispatch with mode=slug-targeted and the plural slugs= input set (singular slug empty). The Refresh tutorial images (slug-targeted) step resolved its slug from only inputs.slug || dispatch_slug — it never read inputs.slugs — so REFRESH_SLUG was empty, backfill-images.ts --slug "" enumerated the whole catalog (21,712 images), and the step took 361s instead of the assumed 0–2s. Not a slow slug: a silent whole-catalog fallback whenever an operator uses the plural input.

The publish side of this same gap was already fixed on DEV (PUBLISH_SLUGS, filterToSlugs, dispatch_slugs); the image path was never updated. This PR mirrors that pattern onto the image path.

Changes

  • scripts/backfill-images.ts — accepts a comma-separated list via --slug and/or --slugs (unioned, trimmed, blank-dropped, de-duped order-preserving); collectImageUrls takes a slug array and scans only those tutorials' built HTML. Empty/absent → whole-catalog (unchanged default). Unknown slug → empty map, no throw (best-effort warm). New unit tests: test/unit/backfill-images-slug-filter.test.js (9 cases).
  • .github/workflows/rebuild-content.yml — the slug-targeted image step now also passes REFRESH_SLUGS: inputs.slugs || dispatch_slugs and invokes backfill-images.ts --slug "$REFRESH_SLUG" --slugs "$REFRESH_SLUGS", mirroring the publish step's PUBLISH_SLUGS. Also closes the same gap on the repository_dispatch multi-slug trigger.
  • Docs — publish-performance-spike-2802.md Finding 3 records the root cause + fix; design + plan under docs/superpowers/.

Verification

  • npx vitest run test/unit/backfill-images-slug-filter.test.js → 9/9 pass; no regressions in publish-content-slug-filter / publish-image-warm.
  • Failing-run shape traced: --slug "" --slugs "a,b" now scopes to a,b (not whole-catalog, no crash); both-empty still enumerates the full catalog.
  • CI proof (post-merge to DEV): dispatch rebuild-content.yml -f mode=slug-targeted -f slugs=<one-slug> and confirm the image step logs (slugs: …) + a small image count and runs in seconds, not 361s.

🤖 Generated with Claude Code

@jung-thomas
jung-thomas marked this pull request as ready for review October 16, 2026 20:15
@jung-thomas
jung-thomas merged commit 020ea2f into DEV Oct 16, 2026
3 of 4 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-2805-plural-slugs branch October 16, 2026 20:15
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