Skip to content

fix(setup): reject parent hooks directories - #107

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-setup-hooks-dir-validation
Jul 30, 2026
Merged

fix(setup): reject parent hooks directories#107
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-setup-hooks-dir-validation

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Jul 30, 2026

Copy link
Copy Markdown
Member

rs setup --hooks-dir currently accepts parent directory paths, allowing generated Git hook files to be written outside the current project.

This PR rejects paths containing .., adds CLI regression coverage, and documents the restriction.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c0fe6b
Status: ✅  Deploy successful!
Preview URL: https://c442f1d6.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-fix-setup-hooks-d-mdt4.rstack-cli.pages.dev

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c0fe6b2e1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rstack/src/setup/install.ts
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The setup installation flow now rejects normalized hooksDir values containing .. with an invalid-hooks-directory failure. CLI tests cover empty, absolute, and parent-directory traversal values. English and Chinese setup documentation now state that --hooks-dir paths must not contain ...

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly and concisely describes rejecting parent-directory hooks paths.
Description check ✅ Passed The description matches the change set by describing the path validation, CLI coverage, and docs update.
✨ 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 chenjiahan/fix-setup-hooks-dir-validation

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.

@chenjiahan
chenjiahan merged commit 1d1d8e6 into main Jul 30, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/fix-setup-hooks-dir-validation branch July 30, 2026 03:45
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