fix(walk): re-render when output directory is missing - #41
Merged
alindeman merged 2 commits intoSep 9, 2026
Conversation
A cache hit only checked the stored hash, not whether the previously rendered output still existed. When an app's hash matched but its output directory was gone (e.g. deleted by a racing regeneration that rendered from a stale base), the walker skipped rendering and recursed into the missing directory, where os.ReadDir aborted the entire run with "open <dir>: no such file or directory". EmptyManifest cannot catch this: a missing manifest.yaml is treated as "not empty" so that root and CopySource dirs are not force-rendered, so it returns false for a deleted output just as it does for those dirs. Stat the output directory before honoring a cache hit and force a render when it is absent. Keying off directory existence rather than manifest.yaml leaves root and CopySource apps unaffected. Missing output now self-heals on the next render instead of failing the run. JIRA: IP-174
alindeman
marked this pull request as ready for review
September 9, 2026 20:04
timchepeleff
approved these changes
Sep 9, 2026
jeffqichime
reviewed
Sep 9, 2026
| pathMissing = true | ||
| } | ||
|
|
||
| if hashGenerated != hash || emptyManifest || pathMissing { |
There was a problem hiding this comment.
os.Stat runs unconditionally before the if (waste resource), so it fires even when hashGenerated != hash || emptyManifest is already true, better guard the stat behind those conditions to skip the syscall on cache misses.
The check that the output directory still exists is only meaningful on a cache hit (hash matches and manifest non-empty). Compute the render decision first and stat the directory only when a render would otherwise be skipped, avoiding a syscall per node on the render path. Behavior is unchanged. JIRA: IP-174
jeffqichime
approved these changes
Sep 9, 2026
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.
Summary
A cache hit in the walker only checked the stored hash, not whether the previously rendered output still exists on disk. If an app's hash matches but its output directory is gone (for example, deleted by a racing regeneration that rendered from a stale base), the walker skips rendering and recurses into the missing directory, where
os.ReadDiraborts the entire run withopen <dir>: no such file or directory.Change
Stat the output directory before honoring a cache hit; if it is absent, treat the node as a cache miss and render it.
A missing output directory now heals on the next render instead of failing.