Make LuaRocks installation the default for supported Unix installs#15
Conversation
Agent-Logs-Url: https://github.com/yeshan333/vfox-lua/sessions/e5ae6e5b-f652-45b7-881e-81b8a4b1149b Co-authored-by: yeshan333 <39296814+yeshan333@users.noreply.github.com>
The mise_luarocks_tests job invoked `mise use -g vfox:yeshan333/vfox-lua@$LUA_VERSION`,
which clones the plugin from the default branch — not the branch under review. As
a result, this PR's "luarocks by default" change was never exercised and the
verification step failed with `luarocks: No such file or directory`.
Pre-install the plugin from `${{ github.head_ref || github.sha }}` so mise tests
the code in this PR (mirrors what the vfox-based jobs already do via
`vfox add --source .../archive/${GITHUB_REF}.zip`).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add luarocks_optout_tests job (Linux + macOS, matrix over "0" and "false") that installs Lua with VFOX_LUA_LUAROCKS set and asserts luarocks is NOT on PATH and $LUA_PREFIX/luarocks does not exist. Guards against regressions in the opt-out branch in post_install.lua (e.g. dropped string.lower or inverted truthiness check) that current tests would not catch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4dbbe8e46
ℹ️ 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".
| # Pin the plugin to this PR's ref so mise tests the branch under review, | ||
| # not whatever is on the default branch. | ||
| PLUGIN_NAME="vfox-$(echo '${{ github.repository }}' | tr '/' '-')" | ||
| $HOME/.local/bin/mise plugins install --force "$PLUGIN_NAME" "https://github.com/${{ github.repository }}.git#${PLUGIN_REF}" |
There was a problem hiding this comment.
Fetch plugin ref from PR head repository
This install command can fail on pull_request workflows from forks: PLUGIN_REF is set from github.head_ref (the fork’s branch name), but the git URL is hardcoded to ${{ github.repository }} (the base repo). For forked PRs that branch does not exist in the base repo, so mise plugins install ...#${PLUGIN_REF} cannot resolve the ref and the mise_luarocks_tests job fails before testing anything. Use the PR head repo/SHA (github.event.pull_request.head.repo.full_name + head.sha) when github.event_name == 'pull_request'.
Useful? React with 👍 / 👎.
LuaRocks was only installed when
VFOX_LUA_LUAROCKS=1was set, which made the default install path inconsistent with expected plugin behavior. This change flips the default on Linux/macOS for Lua 5.x+ and keeps an explicit opt-out for users who do not want LuaRocks.Runtime behavior
hooks/post_install.luafor non-Windows Lua 5.x+ installs.VFOX_LUA_LUAROCKS=0orVFOX_LUA_LUAROCKS=false.Documentation
Workflow coverage
VFOX_LUA_LUAROCKS=1requirement from the LuaRocks E2E workflow paths so CI exercises the new default behavior directly.