Skip to content

fix: make e2e built CLI executable#623

Open
qiffang wants to merge 1 commit into
mainfrom
dat9-dev2/e2e-cli-bin-executable
Open

fix: make e2e built CLI executable#623
qiffang wants to merge 1 commit into
mainfrom
dat9-dev2/e2e-cli-bin-executable

Conversation

@qiffang

@qiffang qiffang commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • chmod the temporary CLI binary after make build-cli CLI_BIN="$CLI_BIN" in E2E scripts
  • apply the fix across E2E helpers that build into mktemp paths
  • add scripts/verify_e2e_cli_bin_chmod.py to catch future regressions

Root cause

mktemp creates files with mode 0600. When go build -o "$CLI_BIN" writes to that existing temp path, the output can remain non-executable. Later helpers call the CLI via env DRIVE9_SERVER=... "$CLI_BIN" ..., so env reports Permission denied on /tmp/tmp.* because it is trying to execute the non-executable CLI binary.

Validation

  • python3 scripts/verify_e2e_cli_bin_chmod.py
  • python3 -m py_compile scripts/verify_e2e_cli_bin_chmod.py
  • tmp=$(mktemp); make build-cli CLI_BIN="$tmp"; test -x "$tmp" reproduces non-executable before chmod; chmod +x "$tmp" makes it executable
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability of end-to-end checks by ensuring locally built CLI binaries are executable before they’re used.
    • Reduced the chance of smoke tests and stress tests failing due to permission issues on temporary binaries.
  • Tests

    • Added automated validation to catch missing executable permissions in end-to-end test scripts, helping prevent regressions.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de127c7d-32ae-4398-9807-c6cd4317e43e

📥 Commits

Reviewing files that changed from the base of the PR and between 0261ab0 and 3977146.

📒 Files selected for processing (17)
  • e2e/_feature-matrix-runner.sh
  • e2e/cli-smoke-test.sh
  • e2e/fuse-concurrency-stress.sh
  • e2e/fuse-correctness-workload.sh
  • e2e/fuse-crash-recovery-test.sh
  • e2e/fuse-performance-baseline.sh
  • e2e/fuse-posix-fsx-gate.sh
  • e2e/fuse-smoke-test.sh
  • e2e/fuse-sqlite-correctness.sh
  • e2e/fuse-write-perf-budget-test.sh
  • e2e/git-ops-smoke-test.sh
  • e2e/git-workspace-smoke-test.sh
  • e2e/layer-fs-smoke-test.sh
  • e2e/native-smoke-test.sh
  • e2e/portable-pack-unpack-e2e.sh
  • e2e/posix-permission-smoke-test.sh
  • scripts/verify_e2e_cli_bin_chmod.py

📝 Walkthrough

Walkthrough

E2E shell scripts now set executable permissions on temporary CLI binaries in build mode, and a new Python script checks e2e/*.sh for that step.

Changes

E2E CLI executable-bit updates

Layer / File(s) Summary
Shell build paths chmod CLI
e2e/*.sh
Build-mode CLI preparation in the e2e shell scripts now runs chmod +x "$CLI_BIN" after the temporary binary is created.
Chmod verifier script
scripts/verify_e2e_cli_bin_chmod.py
A new Python script scans e2e shell scripts for make build-cli lines that are not followed by chmod +x "$CLI_BIN" and reports the missing cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • mem9-ai/drive9#421: Adds the POSIX permission smoke test script that this PR also updates with the same chmod +x "$CLI_BIN" build-path handling.
  • mem9-ai/drive9#497: Introduces e2e/_feature-matrix-runner.sh and its prepare_cli_binary flow that this PR modifies in the same build branch.
  • mem9-ai/drive9#513: Adds e2e/fuse-posix-fsx-gate.sh, one of the scripts whose build branch now includes the executable-bit step.

Suggested reviewers

  • mornyx
  • srstack

Poem

I hopped through the shells at dawn,
and gave each temp CLI a little yawn.
A verifier sniffed the trail just right,
so build-birthed binaries run in the light.
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: making built E2E CLI binaries executable.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dat9-dev2/e2e-cli-bin-executable

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.

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