Skip to content

fix(scripts): ramdisk-orchestrator resolves its mount point after argument parsing - #949

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/rust-ci-codeac-improvements-395dus
Oct 20, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/rust-ci-codeac-improvements-395dus

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

scripts/ramdisk-orchestrator.sh computed its default mount point when the script loaded, from $HOME. Under set -u that meant any run with HOME unset died with HOME: unbound variable before it got to --help or --mount. That includes cron, systemd units and env -i.

This PR keeps the only part of #929 that main doesn't already have. The rest of #929 is superseded by main; see the closing comment there.

  • Resolved after parse_args. The default is XDG_RUNTIME_DIR, else XDG_STATE_HOME, else ~/.local/state, always under hypatia/workspace. That is the path main already uses, so an existing mount is still found and reused. ci: repin standards callers to 75bd599, whose own lock GitHub accepts #929 had renamed it to hypatia-workspace, which would have orphaned that mount; this PR does not carry the rename.
  • No base and no --mount. The script logs No XDG_RUNTIME_DIR, XDG_STATE_HOME or HOME; pass --mount PATH and exits 1, instead of an unbound-variable crash.
  • No-sudo scratch fallback. It now uses mktemp -d -t hypatia-workspace.XXXXXXXX in the system temp dir. Before, it used a predictable $$-suffixed path inside XDG_RUNTIME_DIR, which is itself a small tmpfs.

Test

tests/ramdisk-orchestrator-test.sh (new) runs the script with env -i, so the environment holds only PATH, the variables under test and an empty repos dir. Every run is --dry-run with a repo name that doesn't exist, so nothing is cloned, mounted or scanned. It is wired into tests/e2e.sh, which tests.yml runs.

Case main's script this PR
--help with no HOME/XDG FAIL (unbound HOME) PASS
no HOME/XDG, no --mount → refusal naming --mount FAIL PASS
--mount PATH with no HOME/XDG FAIL PASS
default under XDG_RUNTIME_DIR PASS PASS
default under XDG_STATE_HOME PASS PASS
default under HOME/.local/state PASS PASS

Local checks:

  • bash -n is clean on all three files.
  • shellcheck -S warning on the script reports only SC2034 and SC2155. Both are already on main and neither is in the lines this PR touches.
  • I could not run tests/e2e.sh end to end here: there is no Elixir in this container, so it stops at preflight. CI's tests.yml installs Elixir before running it.

Generated by Claude Code

…ument parsing

The default mount point was computed at load time from $HOME, so under
`set -u` the script died with "HOME: unbound variable" before --help or
--mount could run whenever HOME was unset (cron, systemd, env -i).

The default is now resolved after parse_args: XDG_RUNTIME_DIR, then
XDG_STATE_HOME, then HOME/.local/state, each under hypatia/workspace (the
path main already uses, so an existing mount is still found). With none
of them set and no --mount, it says so and stops. The no-sudo scratch
fallback moves to an unpredictable mktemp directory in the system temp
dir instead of a $$-suffixed path inside XDG_RUNTIME_DIR, which is itself
a small tmpfs.

tests/ramdisk-orchestrator-test.sh covers each case in a bare env -i
environment with --dry-run (nothing cloned, mounted or scanned) and is
wired into tests/e2e.sh. Against main's script it fails 3 of 6.

Ported from #929, which is otherwise superseded by main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xn9nqHVbUTRLgBdedoXAc8
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0ee85dcd-26bc-43e1-9e49-6508c842047d
📥 Commits

Reviewing files that changed from the base of the PR and between 23dc74d and 34dfc03.

📒 Files selected for processing: 3
  • scripts/ramdisk-orchestrator.sh
  • tests/e2e.sh
  • tests/ramdisk-orchestrator-test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T13:54:04.614207Z 34dfc03 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hyperpolymath
hyperpolymath merged commit 552d048 into main Oct 20, 2026
87 of 89 checks passed
@hyperpolymath
hyperpolymath deleted the claude/rust-ci-codeac-improvements-395dus branch October 20, 2026 14:26
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.

2 participants