Detect conflicting output paths across build steps - #321
Draft
bcomnes wants to merge 1 commit into
Draft
Conversation
Coverage Report for CI Build 34791088100Coverage increased (+0.5%) to 94.769%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
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
Closes #288.
Enforce one producer per destination-relative output path across pages, generated pages, templates, static assets, copied directories, esbuild bundles, service workers, and generated metadata. Conflicts fail with DOM_STACK_ERROR_OUTPUT_CONFLICT and identify the output path and both producers instead of silently choosing whichever write finishes last.
Implementation
Scope and tradeoffs
Ordinary one-shot builds do not stage or roll back the whole site: earlier successful writes may remain after a later failure, but a conflicting second producer cannot overwrite the first. Incremental page phases, full watch builds, and copy isolation retain staging where needed for checked publication. Stages use the destination filesystem.
This is a cross-cutting build/watch change rather than a small validation check. It adds ownership bookkeeping, buffered output, temporary disk usage, and a separate promotion lock to coordinate esbuild with page workers. Performance has not been benchmarked.
Publication is not atomic against filesystem I/O failures. Arbitrary filesystem writes by user code or plugins bypass the registry, separate instances are not coordinated when publishing to the same destination, and unattributable esbuild plugin/shared-chunk collisions retain native diagnostics. Initial copy/esbuild failures abort watch startup and require restarting; conflicts in a successfully started session can recover after correcting the source.
Validation
Regression coverage includes cross-producer collisions, dynamic template outputs, filtered watch conflicts, esbuild/page promotion races, startup copy changes, rename/removal recovery, overlapping copy roots, hook read-back, copy-report mappers, and recovery after promotion I/O failure.
Review focus