Preserve Composer overlay source revisions#1849
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.
Summary
composer-packageoverlay sources before stagingComposer\InstalledVersionsdatasets aligned so runtime first-match ordering returns the reviewed source commitCloses #1846.
Root cause
WP Codebox replaces a Composer package from a staged source checkout, but Composer metadata retained
reference: null. Updating only the consumer metadata was insufficient because the nested package autoloader could register its ownInstalledVersionsdataset first. Composer then returned the nested dataset’s null reference even when the consumer dataset contained the correct commit.This change writes the same resolved reference into both generic datasets, making runtime provenance deterministic regardless of loader order.
Compatibility impact
The recipe input schema is unchanged. Existing prepared/runtime output gains an optional additive
referencefield. Non-Git and unresolved sources retain existing behavior with no fabricated reference.How to test
npm ci.npm run test:composer-installed-versions-loader-order.npm run test:composer-package-overlay-revision.npm run test:recipe-runtime-setup-staged-materialization.npm run test:recipe-run-provenance.npm run test:runtime-command-result-envelope.npm run build.git diff --check origin/main...HEAD.All commands pass locally.
End-to-end evidence
A supplementary one-fixture Static Site Importer matrix run was repeated before and after this change using unchanged SSI and Blocks Engine revisions. Before the change, evidence readiness failed solely because the transformer reference was missing. After the change:
verifiedcore/htmlfallbacksKnown unrelated check
npm run test:schema-paritycurrently fails onmainbecausedocs/recipe-contract.mdomits the existinginputs.servicesfield. This PR does not change that schema or documentation surface.AI assistance