Skip to content

Add private mount state directory support#216

Merged
khaliqgant merged 3 commits into
mainfrom
codex/mount-state-dir
May 28, 2026
Merged

Add private mount state directory support#216
khaliqgant merged 3 commits into
mainfrom
codex/mount-state-dir

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • add mountsync private state path resolution with --state-dir, exact --state-file override precedence, and mount-kind-separated state IDs
  • keep CLI and relayfile-mount command surfaces on private state outside the mounted tree, while preserving legacy in-root defaults for direct internal NewSyncer embedders
  • quarantine only the legacy private state file and its known temp variants from the mount root

Scope

Relayfile-first implementation for the PR #1289 mount-state path recursion spec. Cloud mount-script wiring, snapshot pinning, and deploy/release follow-ups are intentionally left for the next sequence.

Tests

  • go test ./internal/mountsync ./cmd/relayfile-mount ./cmd/relayfile-cli -count=1

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 26 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eab126f9-6b40-404a-993c-f15c273048c5

📥 Commits

Reviewing files that changed from the base of the PR and between 0f6b856 and d6c5d98.

📒 Files selected for processing (7)
  • cmd/relayfile-cli/main.go
  • cmd/relayfile-cli/setup_e2e_test.go
  • cmd/relayfile-mount/main.go
  • cmd/relayfile-mount/main_test.go
  • internal/mountsync/state_path.go
  • internal/mountsync/state_path_test.go
  • internal/mountsync/syncer.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mount-state-dir

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a robust state path resolution and validation mechanism for relayfile mounts, adding support for custom state directories (--state-dir) and mount kinds (--mount-kind), while quarantining legacy state files outside the local mount root. The code review highlights critical issues: sharing a single explicit state file across concurrent scoped mounts can lead to state corruption, and using os.Rename to move legacy state files can fail with EXDEV across different filesystems. Additionally, the reviewer suggests making the legacy quarantine step non-fatal on failure and simplifying the home directory lookup logic.

Comment thread cmd/relayfile-mount/main.go
Comment thread internal/mountsync/state_path.go Outdated
Comment thread internal/mountsync/syncer.go
Comment thread internal/mountsync/state_path.go
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-05-28T12-17-16-260Z-HEAD-provider
Mode: provider
Git SHA: e6b1aed

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@khaliqgant khaliqgant marked this pull request as ready for review May 28, 2026 10:15
@khaliqgant
Copy link
Copy Markdown
Member Author

Addressed the Gemini review feedback in 86c6134:\n\n- reject sharing one explicit --state-file across multiple concurrent scoped mounts; users should use --state-dir for scoped mounts\n- make legacy quarantine robust across filesystems by falling back from rename to copy/remove\n- keep quarantine non-fatal at Syncer startup; it now warns and continues\n\nRe-ran: go test ./internal/mountsync ./cmd/relayfile-mount ./cmd/relayfile-cli -count=1

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cmd/relayfile-mount/main_test.go
Comment thread internal/mountsync/state_path.go Outdated
@khaliqgant khaliqgant merged commit 846b890 into main May 28, 2026
9 checks passed
@khaliqgant khaliqgant deleted the codex/mount-state-dir branch May 28, 2026 12:20
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.

1 participant