Repository navigation
Accept user-owned symlinked source snapshot directory - #789
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
[Medium impact] The PR appears safe to merge; launch and cleanup now accept the same linked roots. SummaryThe PR lets snapshot-based launches and cleanup use linked directories.
Reviews (2) · Last reviewed commit: "Allow artifact cleanup through symlinked..." · Reviewed by Greptile |
|
|
||
| let metadata = std::fs::symlink_metadata(path)?; | ||
| // Follow symlinks: a user-owned link to a user-owned directory is fine. | ||
| let metadata = std::fs::metadata(path)?; |
There was a problem hiding this comment.
Deletion still rejects directory links
Accepting a symlinked source-snapshots directory fixes launch, but cleanup still rejects that newly supported setup. Store::validate_run_artifact_roots uses symlink_metadata and returns “Refusing artifact cleanup through …” for the same directory. After a run finishes, users cannot delete its experiment or project, and orphan cleanup also fails.
Update the cleanup checks to safely accept the same owned directory targets, and add a test that covers launch through deletion.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/compute.rs
Line: 157
Comment:
**Deletion still rejects directory links**
Accepting a symlinked `source-snapshots` directory fixes launch, but cleanup still rejects that newly supported setup. `Store::validate_run_artifact_roots` uses `symlink_metadata` and returns “Refusing artifact cleanup through …” for the same directory. After a run finishes, users cannot delete its experiment or project, and orphan cleanup also fails.
Update the cleanup checks to safely accept the same owned directory targets, and add a test that covers launch through deletion.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Valid. Fixed in d2f0a17: validate_run_artifact_roots now follows links for source-snapshots and submission-handles (the two roots prepare_snapshot_dir accepts), while other roots such as local-runs still refuse links. Added artifact_cleanup_follows_symlinked_snapshot_roots_only.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@greptileai review |
Fixes OR-617.
Summary
prepare_snapshot_dirinsrc/compute.rschecked ownership withstd::fs::symlink_metadata. That call describes the link itself, which is never a directory, so a user-owned symlink to a user-owned directory always failed with "Source snapshot directory … is not owned by the current user." As a result,orx exp run --backend ssh(and every other snapshot-based launch) could not start.std::fs::metadata, so the directory and ownership check runs on the resolved target. The uid check and0700permissions are unchanged. The same helper also guardssubmission-handles, so that root gets the same fix.Store::validate_run_artifact_rootsrefused experiment/project deletion and orphan cleanup when the root was a symlink. It now follows links only forsource-snapshotsandsubmission-handles, the two rootsprepare_snapshot_diraccepts. Every other run-artifact root (for examplelocal-runs) still refuses links.snapshot_dir_accepts_a_user_owned_symlinked_directoryandartifact_cleanup_follows_symlinked_snapshot_roots_only. Both fail against the old lines and pass here.No linked contributor PR existed for this issue.
Test plan
cargo fmt --check,cargo clippy --all-targets --locked -- -D warningscargo test --locked -- store:: snapshot_dir(109 passed)main: withsource-snapshotssymlinked,orx exp run --backend ssh --host labfails with the ownership errord2f0a177: live Claude Code dashboard chat repliedCLAUDE_OK, SSH hostlabwas Ready, the same launch ran todoneand printedhello from ssh runwith the snapshot tar written into the link target, andorx exp deleteexited 0 and removed the tarBug reproduction on
main:Post-fix functionality on this branch:
Automation improvements
token_expired. Refresh theCODEX_AUTH_JSONrepository secret so the Codex subscription check can pass.Link to Devin session: https://app.devin.ai/sessions/aa62a8a8cc0b4411a59c5dd608719611
Open in Devin Desktop: https://app.devin.ai/desktop/session/aa62a8a8cc0b4411a59c5dd608719611?variant=devin