Repository navigation
fix(#2805): slug-targeted image refresh honours plural slugs input (no whole-catalog fallback) - #2809
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2805.
Root cause
Run 38816499609 was a
workflow_dispatchwithmode=slug-targetedand the pluralslugs=input set (singularslugempty). TheRefresh tutorial images (slug-targeted)step resolved its slug from onlyinputs.slug || dispatch_slug— it never readinputs.slugs— soREFRESH_SLUGwas 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--slugand/or--slugs(unioned, trimmed, blank-dropped, de-duped order-preserving);collectImageUrlstakes 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 passesREFRESH_SLUGS: inputs.slugs || dispatch_slugsand invokesbackfill-images.ts --slug "$REFRESH_SLUG" --slugs "$REFRESH_SLUGS", mirroring the publish step'sPUBLISH_SLUGS. Also closes the same gap on therepository_dispatchmulti-slug trigger.publish-performance-spike-2802.mdFinding 3 records the root cause + fix; design + plan underdocs/superpowers/.Verification
npx vitest run test/unit/backfill-images-slug-filter.test.js→ 9/9 pass; no regressions inpublish-content-slug-filter/publish-image-warm.--slug "" --slugs "a,b"now scopes to a,b (not whole-catalog, no crash); both-empty still enumerates the full catalog.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