Re-land staging-folder export on main (PR 26 merged into its stacked base)#29
Merged
Conversation
…ront Export To Files previously ran shutil.rmtree on the target folder before writing anything. A locked folder (open Explorer window, IDE, git client, antivirus) aborted the export at the start, and a mid-export crash left the on-disk copy destroyed with no replacement. The export now writes into <target>.codescribe_staging and is swapped in only after it completes: the old target is renamed to <target>.codescribe_backup, the staging folder is renamed to the target, and the backup is deleted (a failure deleting the backup only prints a warning). If a rename fails because the target is locked, the staged files are synced into the target file by file instead; files that disappeared from staging are not deleted. If the sync also fails, ExportFolderLockedError reports the staging folder path where the completed export is preserved. Credit: reimplemented from ipfedor/codescribe commits bc6ec89, 1141d7d. Refs #24.
Stage exports and swap on success instead of rmtree up front
This was referenced Jun 12, 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.
PR #26 was approved and merged while its base still pointed at backport/ws1-bugfixes, so the staging-export changes landed on that branch instead of main (GitHub only retargets a stacked PR when its base branch is deleted, and #25 left the branch alive). This PR carries exactly that content to main; the diff is the #26 staging work plus its validation-driven fixes, nothing else. Validation evidence is on #26.