Repository navigation
fix(migrate): skip git hooks setup when already configured - #3118
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Could we remove the Keep/Skip prompt and handle existing hooks automatically?
The detection should distinguish these cases, since files in |
|
Thanks, that makes sense. I'll do that and update the tests to cover both cases and push to this PR. |
|
@codex review |
|
Thanks for the review! Updated: I removed the Keep/Skip prompt. If hooks are fully configured ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21d3b2140f
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20f2aa0bb5
ℹ️ 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".
Drop the Keep/Skip prompt for existing .vite-hooks/ hooks. When hooks are fully configured (prepare runs `vp config`, core.hooksPath points at .vite-hooks/_, and the dispatcher is installed), skip the hooks step without asking. When hook files exist but setup is incomplete, keep them and finish setup through the existing preflight checks.
- Print the skip message through utils/terminal.ts. - Accept a postinstall script running `vp config` as well as prepare, and don't add a redundant prepare script when postinstall already runs it. - On POSIX, treat a non-executable dispatcher or hook stub as incomplete.
- Compare .vite-hooks/_ dispatcher and stubs with what `vp config` writes, reusing hookScript and the exported HOOK_STUB_SCRIPT; stale content means setup is incomplete. - Don't count `vp config --no-hooks` in prepare/postinstall as a dispatcher refresh, for both detection and the redundant-prepare check.
…epending When prepare already runs `vp config --no-hooks`, drop the flag from that invocation in place rather than adding a second `vp config` command.
7a79213 to
d9f9d2f
Compare
|
Thanks for the review and for taking care of the cleanup! @fengmk2 |
vp migratepreviously prompted for hook setup when.vite-hooks/already contained project hooks. It now skips complete setups and completes partial setups without prompting.A complete setup requires project hooks and a
prepareorpostinstallscript that runsvp configwith hooks enabled. It also requires valid dispatcher files andcore.hooksPathset to.vite-hooks/_at the repository root. Partial setups use the existing safety checks and preserve project hook files. Explicit--hooksand--no-hooksoptions take precedence.Lifecycle detection distinguishes actual commands from text such as
echo vp config. When needed, setup removes--no-hooksfrom a recognizedvp configcommand inprepare, or adds avp configcommand. It preserves unrelated script text and avoids an extrapreparecommand whenpostinstallalready enables hooks.Hooks and Vitest migration share the existing parser for literal commands. Reuse of the native shell parser is tracked in #3136.
Closes #3096.