Repository navigation
Clarify recovery hints and file-operation diagnostics - #4346
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
The new GitHub 404 hint doesn't follow the project's pattern for hints that suggest a command. See the inline suggestion.
worktrunk-bot
left a comment
There was a problem hiding this comment.
codecov/patch fails at this head: 87.25% of the diff is hit, against a 98.39% target. The new test covers the metadata, create-directory, copy, and create-symlink arms. All of the remaining misses are in src/copy.rs, on error arms this PR rewrote to call format_path_for_display, where rustfmt split each .context(...) over several lines:
reading symlink {}incopy_leaf, which needsread_linkto fail with something other thanNotFoundright after a successful statreading metadata for {}onentry.file_type()incopy_dir_recursivereading permissions for {}andsetting permissions on {}in the phase-3 permissions loop
None of these is reachable through an ordinary filesystem setup, so they aren't gaps that more tests would close. Under the Coverage section of AGENTS.md, a failing codecov/patch still needs explicit maintainer approval before merge. That decision is what remains here.
Foreground cancellation intentionally reaches every active scope in one process. A signal-producing run_custom unit test could therefore cancel the parallel missing-binary unit test under cargo test. Move raw custom-child SIGTERM coverage to the existing CLI PTY matrix, where each invocation owns its cancellation state, and retain the spawn-failure trace test.
worktrunk-bot
left a comment
There was a problem hiding this comment.
Holding this for a maintainer decision rather than approving, because the diff widens what --force can overwrite. On main, Windows' forced copy_leaf called remove_if_exists, whose fs::remove_file fails on a read-only destination, so the existing file was kept and the copy errored. Now publish_leaf in src/copy/windows.rs handles that PermissionDenied with replace_readonly (FILE_RENAME_IGNORE_READONLY_ATTRIBUTE), so wt step copy-ignored --force replaces read-only ignored files on Windows. That matches Unix, where rename ignores the file's mode, and the documented "--force overwrites them". It is still a deletion the read-only attribute used to block, and the running-tend review reference holds that kind of change for a human. I found no correctness defects in the staging or publication paths.
Cover blocked destinations and denied source cleanup with real filesystem regressions. Require reflink-copy 0.1.30 to keep mode preservation in its owning dependency. Share directory-write applicability probes and strengthen adjacent assertions for privileged runners.
|
@worktrunk-bot Please review final head c859a3c. It integrates main's isolated signal unit test, retains the raw TERM subprocess regression, exercises real copy/promote publication and cleanup failures, and gives permission preservation to reflink-copy 0.1.30. Permission-denial tests now share the actual write-applicability probe and strengthened assertions. The complete local canonical run passed 5,277 tests; its single stderr-owner guard failure is repaired and included in 262 passing final targeted tests. Final pre-commit, Clippy, formatting, lockfile, documentation and doctest checks pass. Independent final-delta review approves the code. The PR description records the exact composed validation basis. Maintainer decision remains pending for the Windows read-only
|
worktrunk-bot
left a comment
There was a problem hiding this comment.
Nothing new to flag at c859a3c. The only thing still holding this PR is the Windows read-only --force behavior from my previous review, which needs a maintainer decision.
…RM (#4434) reflink-copy 0.1.30's `reflink_or_copy` passes `PermissionDenied` from the clone attempt straight through instead of falling back to `fs::copy` (it does the same for `NotFound` and `AlreadyExists`). On the reporter's kernel `FICLONE` returns `EPERM` rather than `EOPNOTSUPP`, so `wt step copy-ignored` failed with "Operation not permitted" on a file that `cp --reflink=auto` copies without trouble. `copy_leaf` now goes through a small wrapper that retries with a byte copy when the reflink attempt returns `PermissionDenied`. The file is then reported as written in full rather than reflinked. A real permission problem on the source or destination fails the retry with the same error, so it is still reported. The crate's `AutoRemovedFile` deletes the destination it created before returning the error, so the retry doesn't call `fs::copy`, which could overwrite a file another process puts there in that gap. It copies into a temp file beside the destination, gives it the source's mode, and moves it into place with a no-clobber rename (`persist_noclobber`, as `utils::write_new_atomically` does). The destination only ever appears complete. If something already occupies it, the retry fails with `AlreadyExists`, which `copy_leaf` already skips. A failed copy removes only its own temp file, and if that removal fails the error says so. No CI filesystem rejects `FICLONE` with `EPERM`, so the regression test `test_reflink_rejected_with_eperm_falls_back_to_copy` covers the retry decision with synthetic errors: `PermissionDenied` falls back, a failing retry still errors, and success and `AlreadyExists` pass through without a retry. `test_rejected_reflink_fallback_does_not_overwrite_racing_destination` creates a file at the destination between the rejected reflink and the retry, and checks that the file survives. `test_failed_copy_cleanup_leaves_racing_destination` checks that a failed copy leaves a file at the destination alone and leaves no temp file. `test_discard_temp_reports_cleanup_failure` checks that a failed temp-file removal is reported. `test_copy_to_new_file_copies_contents_and_mode` checks the contents and mode. The full path was not run on an EPERM-rejecting filesystem. #4346 also edits this call site in `src/copy.rs` and keeps the bare `reflink_copy::reflink_or_copy`. Whichever lands second should route its call through the wrapper. Closes #4433 — automated triage --------- Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude <[email protected]>
|
@worktrunk-bot Please refresh this PR branch against current main and resolve its mechanical merge conflicts so it can get current CI. Preserve the proposed behavior and the current draft state, run the focused checks for the resulting diff, and report any conflict that requires a semantic or product decision. This requests branch maintenance; the outstanding maintainer review remains pending.
|
Route the staged leaf copy through main's EPERM reflink fallback (#4434) and keep both Windows-only dependencies (windows-sys, dirs).
Prepare copied leaves in their final parent. Use owned Linux FICLONE and macOS atomic clonefile, and let Windows' ordinary copy API own metadata and native acceleration. Preserve atomic forced replacement and no-clobber creation, with an exclusive-create fallback when the filesystem cannot publish by exclusive rename. Exercise direct-child Windows inheritance, directory-symlink publication, partial-file cleanup and actual Unix ENOTSUP. Keep ordinary-copy summaries accurate when filesystem acceleration is opaque.
|
I merged current Two files conflicted:
At 461cbf2,
CI never finished on 461cbf2: your push cancelled |
worktrunk-bot
left a comment
There was a problem hiding this comment.
copied_leaf_inherits_from_final_parent, the Windows test added in the merge commit 76ae926, fails in CI at this head. In affected tests (windows, advisory), SetSecurityInfo in direct_child_permissions returns 5 (ERROR_ACCESS_DENIED), failing the assertion at src\copy\windows.rs:221. The required full-tests (windows-2025, windows) job runs the same test and was still pending when I reviewed, so expect it to fail the same way. The log can't tell whether the denial came from the call on the parent directory or the later one on the forced destination. One thing to check: both calls open their handle with only WRITE_DAC. I haven't confirmed whether SetSecurityInfo also needs READ_CONTROL to apply a protected DACL to a file object.
A smaller point is inline: a doc comment sits on the wrong test.
Let SetNamedSecurityInfoW acquire the filesystem security handle instead of choosing its access mask in the fixture. Preserve the protected ACL and inheritance comparisons, report the path and returned error, and attach the inheritance documentation to the correct test. Cover unsupported publication of dangling symlinks and owned staging cleanup, and distinguish permission-probe fixture errors from writable fixtures. Production copy behavior is unchanged.
|
make any fixes pls @worktrunk-bot |
|
I found nothing to fix at f765a6e, so I haven't pushed. Every CI check passes except
Covering these would mean adding test seams to the copy code, which In the bot sandbox, |
GitHub PR-not-found errors keep the selected repository and its source in the diagnosis, preserve the CLI error, and render
gh repo set-defaultas a separate recovery hint. Relocation warnings identify the blocking path and explain that--clobberbacks it up; config migration hints name the command that applies the updates.Copy and promote failures use the shared path formatter and retain their underlying I/O errors. Failed copies name both source and destination, including when the source is readable and the destination is invalid. Promote recovery commands use shell-quoted paths.
Validation: the required local pre-merge gate passes 5,392 tests (one skipped), Clippy, formatting, locked dependencies, documentation and doctests. Focused error-path tests check quoted paths, destination context and retained I/O causes; command snapshots cover the recovery hints. Independent review found no remaining issues.
Remote patch coverage is 90.06% (136/151 lines) against a 98.55% gate. The 15 misses are existing filesystem-failure paths whose diagnostic formatting changed; exercising most would require races, fault injection or special permission/ownership fixtures. The maintainer approved landing with this coverage gap and the independent subagent review after the automated review job completed without posting a verdict. Linux, macOS and Windows CI, including all advisory affected-tests jobs, passed.