one file permission does not cause failure - #1097
Merged
Merged
Conversation
kireetivar
approved these changes
Sep 18, 2026
ankit2995
self-requested a review
September 18, 2026 06:48
ankit2995
approved these changes
Sep 18, 2026
rsenden
approved these changes
Sep 18, 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.
FileWriteCoordinator.java: commitRemediationWrites now only records a rollback entry for a file after its write succeeds, instead of before attempting it. A file whose write itself fails is already in its original state and needs no rollback — so the rollback path no longer retries writing to the same permission-denied file, which is what previously escalated into a batch-aborting RollbackRemediationException. That specific remediation is now skipped (SOURCE_WRITE_FAILED) and every other remediation — for other files, other issues — proceeds normally. The whole batch no longer aborts.
RemediationProcessorTest.java: added a regression test (readOnlyFileWriteFailureIsSkippedAndOtherRemediationsStillApply) that makes one file read-only, runs two remediations (one targeting it, one targeting a normal file), and asserts the read-only one is skipped on its own while the other still applies.
Note: if a multi-file remediation successfully writes file A and then fails writing file B (permission denied), it still needs to roll back A's already-written change. If that rollback of A also fails (e.g., A independently became read-only too), we will still hit the batch-aborting RollbackRemediationException — because at that point a file has genuinely been left modified and the code can't safely undo it, so halting is arguably still the right call rather than silently continuing over an inconsistent source tree.