feat: release v0.1.0#2
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new rockspec for api7-lua-resty-simdjson, validates installing that rockspec in CI, and introduces a GitHub Actions release workflow that computes a release version, verifies the matching rockspec, creates a GitHub Release, and uploads the rockspec to LuaRocks. ChangesLuaRocks Package Distribution
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
113-131: ⚡ Quick winPublish to GitHub only after LuaRocks upload succeeds.
Current order can leave a GitHub Release created even when
luarocks uploadfails, producing partial release state.🔧 Suggested change
- - name: Create Release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ steps.release_env.outputs.version }} - name: ${{ steps.release_env.outputs.version }} - draft: false - prerelease: ${{ steps.release_env.outputs.is_prerelease }} - - name: Upload to LuaRocks env: LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }} ROCKSPEC_FILE: ${{ steps.verify_rockspec.outputs.rockspec_file }} shell: bash run: | mkdir -p "$HOME/.luarocks" chmod 700 "$HOME/.luarocks" lua -e 'local token = os.getenv("LUAROCKS_TOKEN"); assert(token and token ~= "", "missing LUAROCKS_TOKEN"); local f = assert(io.open(os.getenv("HOME") .. "/.luarocks/upload_config.lua", "w")); f:write(("key = %q\n"):format(token)); f:write("server = \"https://luarocks.org\"\nversion = \"1.0\"\n"); f:close()' chmod 600 "$HOME/.luarocks/upload_config.lua" luarocks upload "$ROCKSPEC_FILE" + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.release_env.outputs.version }} + name: ${{ steps.release_env.outputs.version }} + draft: false + prerelease: ${{ steps.release_env.outputs.is_prerelease }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml around lines 113 - 131, The workflow currently creates the GitHub Release in the "Create Release" step before running "Upload to LuaRocks", which can leave a release when the LUArocks upload fails; fix it by reordering the steps so the "Upload to LuaRocks" step runs before the "Create Release" step (keep the same step names and inputs like tag_name/name using steps.release_env.outputs.version and prerelease using steps.release_env.outputs.is_prerelease), ensuring the softprops/action-gh-release@v2 invocation only runs after luarocks upload completes successfully.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 9-14: The push-triggered workflow currently hard-fails when the
head commit title doesn't match "feat: release ..." for pushes to branch "main"
with path "rockspec/**"; change the logic so the release-only checks are
conditional/skippable instead of failing the whole job: replace any strict
assertion or failing step that enforces the commit-title pattern with a job- or
step-level conditional (e.g., an if: that checks
contains(github.event.head_commit.message, 'feat: release') or similar) so
non-release commits simply skip the release steps; apply the same change to the
other occurrence that uses the same commit-title gating.
- Line 24: Update all GitHub Action references in the workflow to pinned commit
SHAs instead of floating tags: replace actions/checkout@v4,
actions/setup-node@[...] (the setup-node reference),
actions/upload-artifact@[...] (the upload-artifact reference), and any other
action using `@vX` tags with their specific commit SHAs from their upstream repos;
fetch the canonical commit SHA for each action (from the action's GitHub repo),
substitute the `@tag` with @<full-commit-sha>, and ensure the workflow still
passes — e.g., update the usages for actions/checkout, actions/setup-node,
actions/upload-artifact and the release-related action to pinned SHAs.
---
Nitpick comments:
In @.github/workflows/release.yml:
- Around line 113-131: The workflow currently creates the GitHub Release in the
"Create Release" step before running "Upload to LuaRocks", which can leave a
release when the LUArocks upload fails; fix it by reordering the steps so the
"Upload to LuaRocks" step runs before the "Create Release" step (keep the same
step names and inputs like tag_name/name using steps.release_env.outputs.version
and prerelease using steps.release_env.outputs.is_prerelease), ensuring the
softprops/action-gh-release@v2 invocation only runs after luarocks upload
completes successfully.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 04b5c012-cfc6-40b7-b18a-96871527c3c0
📒 Files selected for processing (3)
.github/workflows/release.yml.github/workflows/tests.ymlrockspec/lua-resty-simdjson-0.1.0-1.rockspec
There was a problem hiding this comment.
Pull request overview
Adds LuaRocks packaging + automated release flow for lua-resty-simdjson, and extends CI to validate the rock installs and loads under OpenResty.
Changes:
- Add initial
lua-resty-simdjsonrockspec for v0.1.0. - Add a GitHub Actions release workflow to create a GitHub release tag and upload the rockspec to LuaRocks.
- Extend CI to build/install the rock locally and sanity-check
require("resty.simdjson")underresty.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| rockspec/lua-resty-simdjson-0.1.0-1.rockspec | Introduces the first rockspec and custom make build + install logic. |
| .github/workflows/tests.yml | Installs LuaRocks and adds a job step to build/install the rock and load it in OpenResty. |
| .github/workflows/release.yml | Adds a release workflow to create vX.Y.Z GitHub releases and upload the rockspec to LuaRocks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/release.yml (1)
114-134:⚠️ Potential issue | 🟠 Major | ⚡ Quick winCreate the Git tag/release before uploading the rockspec.
Upload to LuaRocksruns beforeCreate Release. If release/tag creation fails, LuaRocks can publish a rockspec that points to a non-existentsource.tag, resulting in broken installs.🔧 Minimal fix (reorder steps)
- - name: Upload to LuaRocks - env: - LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }} - ROCKSPEC_FILE: ${{ steps.verify_rockspec.outputs.rockspec_file }} - shell: bash - run: | - mkdir -p "$HOME/.luarocks" - chmod 700 "$HOME/.luarocks" - touch "$HOME/.luarocks/upload_config.lua" - chmod 600 "$HOME/.luarocks/upload_config.lua" - lua -e 'local token = os.getenv("LUAROCKS_TOKEN"); assert(token and token ~= "", "missing LUAROCKS_TOKEN"); local f = assert(io.open(os.getenv("HOME") .. "/.luarocks/upload_config.lua", "w")); assert(f:write(("key = %q\n"):format(token))); assert(f:write("server = \"https://luarocks.org\"\nversion = \"1.0\"\n")); assert(f:close())' - luarocks upload "$ROCKSPEC_FILE" - - name: Create Release uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 with: tag_name: ${{ steps.release_env.outputs.version }} name: ${{ steps.release_env.outputs.version }} draft: false prerelease: ${{ steps.release_env.outputs.is_prerelease }} + + - name: Upload to LuaRocks + env: + LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }} + ROCKSPEC_FILE: ${{ steps.verify_rockspec.outputs.rockspec_file }} + shell: bash + run: | + mkdir -p "$HOME/.luarocks" + chmod 700 "$HOME/.luarocks" + touch "$HOME/.luarocks/upload_config.lua" + chmod 600 "$HOME/.luarocks/upload_config.lua" + lua -e 'local token = os.getenv("LUAROCKS_TOKEN"); assert(token and token ~= "", "missing LUAROCKS_TOKEN"); local f = assert(io.open(os.getenv("HOME") .. "/.luarocks/upload_config.lua", "w")); assert(f:write(("key = %q\n"):format(token))); assert(f:write("server = \"https://luarocks.org\"\nversion = \"1.0\"\n")); assert(f:close())' + luarocks upload "$ROCKSPEC_FILE"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml around lines 114 - 134, The workflow uploads the rockspec before the GitHub release/tag is created (step "Upload to LuaRocks" precedes "Create Release"), risking a rockspec pointing to a non-existent source.tag; fix by reordering the steps so "Create Release" runs before "Upload to LuaRocks" (or otherwise ensure the upload step depends on successful tag/release creation) so the release/tag exists prior to calling luarocks upload.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/release.yml:
- Around line 114-134: The workflow uploads the rockspec before the GitHub
release/tag is created (step "Upload to LuaRocks" precedes "Create Release"),
risking a rockspec pointing to a non-existent source.tag; fix by reordering the
steps so "Create Release" runs before "Upload to LuaRocks" (or otherwise ensure
the upload step depends on successful tag/release creation) so the release/tag
exists prior to calling luarocks upload.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6d23ea72-b7b0-4449-8242-2b380712892c
📒 Files selected for processing (3)
.github/workflows/release.yml.github/workflows/tests.ymlrockspec/api7-lua-resty-simdjson-0.1.0-1.rockspec
|
Adjusted the release order in 419762b so the GitHub Release/tag is created before |
Add LuaRocks publishing support following lua-qjson's release flow.
This publishes the rock as
api7-lua-resty-simdjsonto avoid the existinglua-resty-simdjsonpackage name on LuaRocks. The installed module path remainsresty.simdjson, so users still load it withrequire("resty.simdjson").The PR adds the first rockspec, a release workflow that uploads the rockspec to LuaRocks and then creates the GitHub Release, and a CI check that installs the rock locally and loads it through OpenResty.
Tests run locally:
luarocks --lua-version=5.1 make rockspec/api7-lua-resty-simdjson-0.1.0-1.rockspec --tree /tmp/lua-resty-simdjson-rock-localeval "$(luarocks --lua-version=5.1 path --tree /tmp/lua-resty-simdjson-rock-local)"; resty -e ...zsh -lic 'switch-runtime apisix && make test'Summary by CodeRabbit