Skip to content

feat: release v0.1.0#45

Merged
nic-6443 merged 13 commits into
mainfrom
feat/lua-qjson-luarocks-release
May 19, 2026
Merged

feat: release v0.1.0#45
nic-6443 merged 13 commits into
mainfrom
feat/lua-qjson-luarocks-release

Conversation

@jarvis9443
Copy link
Copy Markdown
Contributor

@jarvis9443 jarvis9443 commented May 18, 2026

Add LuaRocks packaging for the first lua-qjson release. The rock name is lua-qjson, while the Lua module remains require("qjson"), so it avoids the existing qjson package name on LuaRocks.

This also adds a small FFI loader that keeps local LD_LIBRARY_PATH usage working and can load the native library from LuaRocks package.cpath after install. The loader now validates the full FFI symbol set before accepting a shared object, and the Lua test suite covers loader failure diagnostics.

The release workflow publishes from feat: release vX.Y.Z[-prerelease] commits, validates the version before using it in tags or filenames, marks prereleases correctly, chooses the matching checked-in rockspec revision with numeric revision ordering, validates LUAROCKS_TOKEN before creating a GitHub release, and writes the token to the LuaRocks upload config instead of passing it as a command-line argument. CI validates LuaRocks installs on Ubuntu and macOS.

Validated locally with:

  • cargo test --release
  • cargo test --release --no-default-features
  • cargo test --features test-panic --release
  • LD_LIBRARY_PATH="$PWD/target/release" LUA_CPATH="./vendor/lua-cjson/?.so;./target/release/lib?.so;;" busted --lua="$(which luajit)" tests/lua --lpath="./lua/?.lua"
  • luarocks make rockspec/lua-qjson-0.1.0-1.rockspec --tree /tmp/lua-qjson-rock
  • installed-rock busted suite with /tmp/lua-qjson-rock and no LD_LIBRARY_PATH
  • luarocks lint rockspec/lua-qjson-0.1.0-1.rockspec

Summary by CodeRabbit

  • New Features

    • Added automated release workflow and LuaRocks package upload for releases.
    • Added packaging metadata to distribute a prebuilt rock.
  • Improved Reliability

    • Enhanced native-library loader with more exhaustive discovery, validation, and clearer errors.
    • CI now validates the LuaRocks package and runtime smoke tests.
  • Documentation

    • Added installation instructions for LuaRocks.
  • Tests

    • Added tests covering native loader behavior.

Review Change Stack

Copilot AI review requested due to automatic review settings May 18, 2026 14:32
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48026d4a-36ff-4a0c-bd89-18cd086a5940

📥 Commits

Reviewing files that changed from the base of the PR and between ffc82a2 and 703dc35.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • lua/qjson.lua
  • lua/qjson/lib.lua
  • lua/qjson/table.lua
  • tests/lua/loader_spec.lua
✅ Files skipped from review due to trivial changes (2)
  • lua/qjson.lua
  • lua/qjson/table.lua
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/lua/loader_spec.lua
  • .github/workflows/ci.yml
  • lua/qjson/lib.lua

📝 Walkthrough

Walkthrough

Adds a cached native FFI loader (lua/qjson/lib.lua), updates consumers to require("qjson.lib"), introduces a rockspec and CI package-validation steps, provides a release workflow to publish rockspecs, and adds installation docs plus loader tests.

Changes

LuaRocks Packaging for lua-qjson

Layer / File(s) Summary
FFI Library Resolution Module
lua/qjson/lib.lua
New module encapsulates native library loading with fallback logic: defines ffi.cdef, tries ffi.load("qjson")/ffi.load("libqjson"), probes package.cpath templates, caches attempts, verifies all required exported symbols, and errors with diagnostic attempts when no candidate succeeds.
Update FFI Consumers to Use New Loader
lua/qjson.lua, lua/qjson/table.lua
Both modules now obtain the native library handle via require("qjson.lib") instead of direct ffi.load("qjson").
LuaRocks Package Definition
rockspec/lua-qjson-0.1.0-1.rockspec
Defines lua-qjson package metadata, pins lua == 5.1, runs CARGO_TARGET_DIR=target cargo build --release, installs Lua wrapper files and the compiled native shared library with .so/.dylib fallback and an explicit missing-artifact failure.
CI Package Validation
.github/workflows/ci.yml
Adds a Validate LuaRocks package step that builds the rockspec into a temporary tree, evals luarocks path, unsets LD_LIBRARY_PATH (and DYLD_LIBRARY_PATH on macOS package job), performs a luajit smoke test requiring qjson, and runs busted under luajit.
Release Workflow
.github/workflows/release.yml
Release workflow triggers on pushes to main affecting rockspec/**, installs pinned Lua and LuaRocks, extracts version from the head commit message, validates the versioned rockspec exists, creates a GitHub Release, and publishes the rockspec to LuaRocks using secrets.LUAROCKS_TOKEN.
Installation docs and tests
README.md, tests/lua/loader_spec.lua
Adds an “Installing” subsection documenting LuaRocks installation (notes Rust/Cargo and LuaJIT required) and tests verifying loader failure diagnostics and successful resolution when alternate candidates provide required symbols.

Sequence Diagram(s)

sequenceDiagram
  participant Consumer as lua/qjson.lua (consumer)
  participant Loader as lua/qjson/lib.lua (loader)
  participant FFI as LuaJIT FFI (ffi.load)
  Consumer->>Loader: require("qjson.lib")
  Loader->>FFI: ffi.load("qjson") / ffi.load("libqjson")
  Loader->>FFI: ffi.load(resolved package.cpath paths)
  FFI-->>Loader: library handle or error
  Loader-->>Consumer: return handle or diagnostic error (attempts + last_error)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
E2e Test Quality Review ⚠️ Warning Insufficient E2E & unit test coverage. Tests missing: cpath loading, symbol validation failures, loadall.so filtering. Complex single-line Lua in release.yml reduces readability. Add tests for: cpath loading, symbol failures, loadall.so filtering. Refactor release.yml line 109 to multi-line Lua with comments.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: release v0.1.0' directly describes the main change—packaging lua-qjson for the first release on LuaRocks with version 0.1.0. It aligns with the PR's primary objective and is specific and clear.
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.
Security Check ✅ Passed No security issues found across all 7 categories. Token handled securely, no credential exposure, no auth bypasses, no TLS errors detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/lua-qjson-luarocks-release

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/release.yml (2)

10-13: ⚡ Quick win

Declare workflow token permissions explicitly.

softprops/action-gh-release needs contents: write; relying on repository defaults makes this workflow fragile across environments.

Proposed fix
 name: Release
 
 on:
   push:
@@
       - "rockspec/**"
+
+permissions:
+  contents: write
🤖 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 10 - 13, The workflow currently
relies on repo defaults for permissions; explicitly declare permissions for the
release job so softprops/action-gh-release has contents: write. Add a
permissions block (at top-level or within the release job) that includes
contents: write to ensure the GitHub token used by the action can create
releases; reference the release job and the softprops/action-gh-release action
when making the change so the permission is scoped for that job.

33-35: ⚡ Quick win

Use v? instead of v* in the release-version regex for correct semantics.

The regex ^feat: release v*(\S+) will match commit titles, but v* (zero or more) allows unintended patterns like feat: release vv0.1.0. Use v? (zero or one) to properly match optional single-v prefix. Note: \S is supported in bash, so that is not a concern.

🤖 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 33 - 35, Update the release-title
regex stored in the variable re so it uses v? instead of v* (change the pattern
from ^feat: release v*(\S+) to ^feat: release v?(\S+)) to ensure only an
optional single "v" is allowed; keep the same match usage against title and the
downstream BASH_REMATCH[1] assignment to build v (v=${BASH_REMATCH[1]}).
🤖 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 31-33: The script injects github.event.head_commit.message
directly into the shell which risks command injection; fix by passing
github.event.head_commit.message into the runner as an environment variable and
reference that safe variable (e.g., set an env like COMMIT_MSG from
github.event.head_commit.message) then use quoted parameter expansion when
assigning title (title="${COMMIT_MSG}") and keep the regex variable re
unchanged; ensure all uses of github.event.head_commit.message in this job use
the env var and always quote the variable expansions.

In `@rockspec/lua-qjson-0.1.0-1.rockspec`:
- Around line 20-22: The rockspec currently declares "lua >= 5.1" which is too
permissive for this package because multiple modules (lua/qjson.lua,
lua/qjson/lib.lua, lua/qjson/table.lua) rely on LuaJIT's FFI; update the
dependencies table to require LuaJIT explicitly (e.g. replace or add an entry
like "luajit >= 2.1" or the appropriate LuaRocks luajit package name/version) so
installs on plain Lua runtimes are prevented and ensure the dependency change is
applied in the dependencies = { ... } block of the rockspec.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 10-13: The workflow currently relies on repo defaults for
permissions; explicitly declare permissions for the release job so
softprops/action-gh-release has contents: write. Add a permissions block (at
top-level or within the release job) that includes contents: write to ensure the
GitHub token used by the action can create releases; reference the release job
and the softprops/action-gh-release action when making the change so the
permission is scoped for that job.
- Around line 33-35: Update the release-title regex stored in the variable re so
it uses v? instead of v* (change the pattern from ^feat: release v*(\S+) to
^feat: release v?(\S+)) to ensure only an optional single "v" is allowed; keep
the same match usage against title and the downstream BASH_REMATCH[1] assignment
to build v (v=${BASH_REMATCH[1]}).
🪄 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: 867c993c-e932-4e08-9522-e8643e3ef73f

📥 Commits

Reviewing files that changed from the base of the PR and between b526d58 and 9813fee.

📒 Files selected for processing (6)
  • .github/workflows/release.yml
  • README.md
  • lua/qjson.lua
  • lua/qjson/lib.lua
  • lua/qjson/table.lua
  • rockspec/lua-qjson-0.1.0-1.rockspec

Comment thread .github/workflows/release.yml Outdated
Comment thread rockspec/lua-qjson-0.1.0-1.rockspec
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds LuaRocks packaging and release automation for the first lua-qjson release, while keeping the Lua module name as qjson.

Changes:

  • Adds a LuaRocks rockspec for building/installing the Rust native library and Lua modules.
  • Adds a qjson.lib FFI loader and routes existing Lua wrappers through it.
  • Adds install documentation and a GitHub Actions release/upload workflow.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
rockspec/lua-qjson-0.1.0-1.rockspec Defines LuaRocks package metadata, build, and install commands.
README.md Documents LuaRocks installation and module name.
lua/qjson/lib.lua Adds native-library loading via ffi.load and package.cpath.
lua/qjson.lua Uses the shared native-library loader.
lua/qjson/table.lua Uses the shared native-library loader.
.github/workflows/release.yml Adds release creation and LuaRocks upload automation.
Comments suppressed due to low confidence (4)

.github/workflows/release.yml:32

  • Interpolating github.event.head_commit.message directly into a bash script lets quotes or command substitutions in the commit message alter the generated script. Pass the commit message through an environment variable (or another escaped input mechanism) before parsing it so a crafted squash/merge commit cannot execute arbitrary shell commands in the release job.
          title="${{ github.event.head_commit.message }}"

.github/workflows/release.yml:33

  • Bash uses extended regular expressions here, not PCRE, so \S is not a non-whitespace character class. As written, the release commit message feat: release v0.1.0 will not match and the workflow exits before creating/uploading the release; use a Bash-compatible character class such as [^[:space:]]+.
          re="^feat: release v*(\S+)"

lua/qjson/lib.lua:22

  • package.cpath can contain literal all-in-one entries such as .../loadall.so that do not include ?. This code still passes those unchanged paths to ffi.load; if such a shared object exists, the loader can accept a library that does not export the qjson symbols and fail later with an unrelated symbol lookup error instead of continuing to search or reporting that qjson was missing. Skip templates without ? or validate a qjson symbol after loading.
            local path = string.gsub(template, "%?", name)
            local lib = try_load(path)

lua/qjson/lib.lua:31

  • The new package.cpath fallback is not exercised by the existing Lua CI path, which still loads the library through LD_LIBRARY_PATH. Because this fallback is what makes installed LuaRocks usage work without LD_LIBRARY_PATH, add an automated Lua/LuaRocks test (or a CI variant that clears LD_LIBRARY_PATH and points LUA_CPATH at the built library) so regressions in the release loader are caught before publishing.
local lib = try_load("qjson") or try_load("libqjson") or load_from_cpath()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rockspec/lua-qjson-0.1.0-1.rockspec Outdated
Comment thread README.md
Comment thread lua/qjson/lib.lua
Comment thread rockspec/lua-qjson-0.1.0-1.rockspec Outdated
Comment thread .github/workflows/release.yml
Copilot AI review requested due to automatic review settings May 18, 2026 14:41
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

99-99: ⚡ Quick win

Avoid hard-coding the rockspec version in package validation.

This locks CI to 0.1.0 and can miss regressions when the release version changes.

Proposed change
-          luarocks make rockspec/lua-qjson-0.1.0-1.rockspec --tree /tmp/lua-qjson-rock
+          ROCKSPEC="$(ls -1 rockspec/lua-qjson-*-1.rockspec | sort -V | tail -n1)"
+          luarocks make "$ROCKSPEC" --tree /tmp/lua-qjson-rock
🤖 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/ci.yml at line 99, In the CI step that runs "luarocks make
rockspec/lua-qjson-0.1.0-1.rockspec --tree /tmp/lua-qjson-rock" avoid
hard-coding the version; change it to pick the rockspec dynamically (e.g., use a
shell glob like rockspec/lua-qjson-*.rockspec or an env var such as $ROCKSPEC or
a simple find/ls to select the rockspec file) so CI validates whatever release
version is present instead of being locked to 0.1.0.
🤖 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 38-45: The current regex re="^feat: release v?(\S+)" in the
release workflow is too permissive; replace it with a stricter SemVer capture
(e.g. re="^feat: release v?([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?)$") and use
that capture for v and version_without_v when matching title; update the
matching block that sets v=${BASH_REMATCH[1]} and writes to GITHUB_OUTPUT so
only validated SemVer strings are emitted for the GitHub tag and rockspec
filename.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 99: In the CI step that runs "luarocks make
rockspec/lua-qjson-0.1.0-1.rockspec --tree /tmp/lua-qjson-rock" avoid
hard-coding the version; change it to pick the rockspec dynamically (e.g., use a
shell glob like rockspec/lua-qjson-*.rockspec or an env var such as $ROCKSPEC or
a simple find/ls to select the rockspec file) so CI validates whatever release
version is present instead of being locked to 0.1.0.
🪄 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: dcb5cc9e-fd37-4c37-bb03-6cf977930630

📥 Commits

Reviewing files that changed from the base of the PR and between 9813fee and df2d55d.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml

Comment thread .github/workflows/release.yml Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Comment thread rockspec/lua-qjson-0.1.0-1.rockspec
Comment thread .github/workflows/release.yml
Comment thread rockspec/lua-qjson-0.1.0-1.rockspec
Comment thread lua/qjson/lib.lua
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

48-61: ⚡ Quick win

Consider uploading to LuaRocks before creating the GitHub release.

Creating the GitHub release (line 48) before uploading to LuaRocks (line 56) means that if the upload fails, the repository will have a release tag without a corresponding LuaRocks package. While the workflow can be re-run, this creates a window of inconsistency where users might see the GitHub release but cannot install via LuaRocks.

Reordering so that LuaRocks upload happens first would ensure that only successful uploads result in a GitHub release:

🔄 Suggested reordering
           fi

-      - 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: false
-
       - name: Upload to LuaRocks
         env:
           LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
         run: |
           luarocks install dkjson
           luarocks upload rockspec/lua-qjson-${{ steps.release_env.outputs.version_without_v }}-1.rockspec --api-key=${LUAROCKS_TOKEN}
+
+      - 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 }}

This ensures that the GitHub release is only created after a successful LuaRocks upload.

🤖 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 48 - 61, Swap the "Create
Release" and "Upload to LuaRocks" steps so the LUAROCKS upload runs before the
softprops/action-gh-release step; specifically move the entire "Upload to
LuaRocks" step (the step that sets LUAROCKS_TOKEN and runs "luarocks install
dkjson" + "luarocks upload rockspec/lua-qjson-${{
steps.release_env.outputs.version_without_v }}-1.rockspec
--api-key=${LUAROCKS_TOKEN}") above the "Create Release" step that uses
softprops/action-gh-release@v2 (which uses tag_name and name from
steps.release_env.outputs.version), ensuring the upload succeeds before creating
the GitHub release and that both steps still reference the same release_env
outputs.
🤖 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 56-61: Add a pre-release verification step that checks the
expected rockspec file exists using the same version token used later
(steps.release_env.outputs.version_without_v) before the "Create Release" job
runs; specifically, insert a step (e.g., "Verify rockspec exists") prior to the
"Create Release" step that tests for the file rockspec/lua-qjson-${{
steps.release_env.outputs.version_without_v }}-1.rockspec and fails the workflow
with a clear message if missing so the subsequent "Create Release" and "Upload
to LuaRocks" steps (referenced by their names) are not executed when the
rockspec is absent.
- Around line 37-46: The current matcher uses the full HEAD_COMMIT_MESSAGE
stored in title, which can include additional lines and breaks the ^...$ regex;
before applying the re match, extract just the first line (the commit title)
from title and use that single-line string for the regex match so the existing
re, BASH_REMATCH and subsequent v/BASH_REMATCH[1] logic work unchanged.
- Around line 48-54: The release job currently always sets prerelease: false in
the "Create Release" step (uses: softprops/action-gh-release@v2) so prerelease
tags like 1.0.0-rc1 get published as stable; update the "Extract release name"
step to emit a prerelease output (e.g., steps.release_env.outputs.prerelease) by
testing the version string for a dash/semver prerelease identifier, and then
change the "Create Release" step to use that output for the prerelease field
(prerelease: ${{ steps.release_env.outputs.prerelease }}), ensuring prerelease
releases are marked correctly.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 48-61: Swap the "Create Release" and "Upload to LuaRocks" steps so
the LUAROCKS upload runs before the softprops/action-gh-release step;
specifically move the entire "Upload to LuaRocks" step (the step that sets
LUAROCKS_TOKEN and runs "luarocks install dkjson" + "luarocks upload
rockspec/lua-qjson-${{ steps.release_env.outputs.version_without_v }}-1.rockspec
--api-key=${LUAROCKS_TOKEN}") above the "Create Release" step that uses
softprops/action-gh-release@v2 (which uses tag_name and name from
steps.release_env.outputs.version), ensuring the upload succeeds before creating
the GitHub release and that both steps still reference the same release_env
outputs.
🪄 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: 62bf3413-6836-4422-a588-b9233f9d648e

📥 Commits

Reviewing files that changed from the base of the PR and between 485ba65 and 93f9953.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • lua/qjson/lib.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • lua/qjson/lib.lua

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Copilot AI review requested due to automatic review settings May 18, 2026 14:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Comment thread rockspec/lua-qjson-0.1.0-1.rockspec Outdated
Comment thread lua/qjson/lib.lua
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread rockspec/lua-qjson-0.1.0-1.rockspec Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
@jarvis9443
Copy link
Copy Markdown
Contributor Author

I addressed the pre-merge findings from the CodeRabbit summary.

The LuaRocks token is no longer passed as --api-key; the workflow writes ~/.luarocks/upload_config.lua from LUAROCKS_TOKEN and then runs luarocks upload without the token in argv.

I also added tests/lua/loader_spec.lua to cover loader failure diagnostics, including attempted library names, the last ffi.load error, and skipping fixed package.cpath entries.

@jarvis9443
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI review requested due to automatic review settings May 18, 2026 15:10
@jarvis9443
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jarvis9443
Copy link
Copy Markdown
Contributor Author

The failed LuaRocks package jobs were caused by the new validation job using leafo/gh-actions-lua@v10 with the luajit alias, which returned 404 while installing LuaJIT.

I pinned that job to leafo/gh-actions-lua@v13 and luajit-2.1.0-beta3, matching the action's documented LuaJIT version format. Waiting for the rerun now.

@jarvis9443
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:136

  • This duplicates the lexicographic rockspec selection used above, so the macOS/Linux package job can validate an older version once filenames such as 0.9.0 and 0.10.0 coexist. Use version-aware sorting or pass the exact rockspec to avoid silently testing the wrong package.
          ROCKSPEC="$(ls -1 rockspec/lua-qjson-*.rockspec | sort | tail -n1)"

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread lua/qjson/lib.lua Outdated
@jarvis9443
Copy link
Copy Markdown
Contributor Author

The package jobs got past the LuaJIT install after pinning the version, then failed because the action exposes the LuaJIT runtime as lua, not luajit.

I changed the package smoke test to use lua -e 'assert(jit, "LuaJIT required"); ...', so it still verifies the runtime is LuaJIT while using the command the action actually installs.

@jarvis9443
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI review requested due to automatic review settings May 18, 2026 15:31
@jarvis9443
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:164

  • This duplicate selector has the same raw-string prerelease ordering issue: rc.2 will sort after rc.10, even though SemVer orders rc.10 later. The package job could therefore build and smoke-test the wrong prerelease rockspec once multiple prereleases are checked in.
                  major, minor, patch, prerelease, revision = match.groups()
                  matches.append((int(major), int(minor), int(patch), prerelease is None, prerelease or "", int(revision), str(path)))
          if not matches:
              raise SystemExit("no lua-qjson rockspec found")
          print(max(matches)[-1])

Comment thread lua/qjson/lib.lua
Comment thread .github/workflows/ci.yml Outdated
@jarvis9443
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nic-6443 nic-6443 merged commit 208fce6 into main May 19, 2026
7 checks passed
@nic-6443 nic-6443 deleted the feat/lua-qjson-luarocks-release branch May 19, 2026 00:56
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.

3 participants