Skip to content

fix(vendor): discard displaced tree after rollback - #410

Open
codeforester wants to merge 1 commit into
mainfrom
bug/352-20260903-bug-do-not-orphan-the-displaced-vendor-tree-after-rollback
Open

fix(vendor): discard displaced tree after rollback#410
codeforester wants to merge 1 commit into
mainfrom
bug/352-20260903-bug-do-not-orphan-the-displaced-vendor-tree-after-rollback

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Summary

Make successful vendor rollback destructive by contract: after restoring the previous tree, remove the displaced current tree and report that cleanup. If either move fails, preserve both trees and leave the rollback directory for inspection.

Issue

Fixes #352

Validation

  • git diff --check
  • shfmt -d -ln bash -i 4 -sr scripts/vendor
  • bats tests/vendor.bats -f rollback (2/2)
  • env -u BASE_HOME BASE_CACHE_DIR=/private/tmp/base-bash-train-352 ./tests/validate.sh (616 BATS tests and all repository contracts passed)

Demo Impact

None.

Docs Impact

Updated docs/vendor-workflow.md with rollback deletion, failure, disk-usage, and recovery semantics.

API Impact

The scripts/vendor rollback behavior is now explicit: successful rollback discards the displaced tree; failed moves retain recoverable state.

CI Impact

Adds injected move-failure coverage to the vendor contract.

Security Notes

Cleanup remains scoped to the private rollback directory created by the command; move failures fail closed without deleting either tree.

Notes

The rollback contract intentionally does not retain a roll-forward copy after success.

Checklist

  • Branch name follows <category>/<issue>-<YYYYMMDD>-<slug>.
  • Branch category matches the issue label.
  • Pull request is scoped to one issue.
  • Pull request body explains changes and validation.
  • Documentation is updated for behavior changes.
  • Impact sections are complete.
  • Pull request includes Fixes #352.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: do not orphan the displaced vendor tree after rollback

1 participant