Repository navigation
fix(marketplace): a changed locked origin is advised as a lock to restore first - #4518
Merged
Daniel Meppiel (danielmeppiel) merged 1 commit intoNov 21, 2026
Conversation
…tore first When an alias now names a different catalog than apm.lock.yaml recorded, the advice first says to restore apm.lock.yaml from version control if it was not changed on purpose, and only then to verify the locked source and re-register it. Both origins render as printable ASCII, and a locked origin that needed sanitizing is never echoed as a runnable command. Refs #4228 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 21:30
Daniel Meppiel (danielmeppiel)
merged commit Nov 21, 2026
a840782
into
train/0.37-final-2
3 checks passed
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.
Description
A review follow-up on #4228 (S lead), fixed in the sweep rather than filed. When an alias now names a different catalog than
apm.lock.yamlrecorded (MarketplaceOriginConflictError), the advice now points first at the safe path:core/remediation.py:marketplace-origin-restore(the owner of this advice) gainsbefore="verify that source first".marketplace/errors.py: the restore-from-version-control sentence comes first. The locked and current origins render throughutils.diagnostics.printable_ascii_text, so a lock value cannot inject terminal escapes. A locked origin that needed sanitizing is never echoed as a runnable command. The existing shlex quoting stays.test_catalog_origin.py::test_conflict_advice_restores_the_lock_first_and_renders_origins_as_ascii, and the tamperedsource_urlcell intest_marketplace_update_provenance_lifecycle.pynow asserts that the output says to restore apm.lock.yaml from version control.Base:
train/0.37-final-2(the catalog and #4475's tests are only there). Fold after #4475.Issue and approved scope
Issue: Refs #4228 (scope record: #4228 (comment)); #4475 closes it.
Human scope-approval comment: #4228 (comment)
Does this PR complete the issue, or what remains? It folds an S-lead review follow-up into the #4228 work; #4475 completes the issue.
Type of change
Testing
One guarded run on this branch (apm 0.37.0):
pytest tests/unit/marketplace/test_catalog_origin.py tests/unit/core/test_remediation_w2_marketplace_catalog.py tests/unit/core/test_remediation_block_proofs.py tests/integration/test_marketplace_update_provenance_lifecycle.py::test_update_restores_or_refuses_altered_marketplace_provenance[source_url-tamper]-> 245 passed, 1 failed. The failure is the pre-existing train redtest_every_block_remediation_has_a_proof_level[test_remediation_w4_frozen_policy_catalog]('policy-fetch-failure-blocked', from #4500), which this PR does not touch.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)