Skip to content

fix: stamp nightly Cargo versions portably on macOS - #835

Merged
debba merged 2 commits into
mainfrom
fix/nightly-cargo-version
Sep 29, 2026
Merged

debba merged 2 commits into
mainfrom
fix/nightly-cargo-version

Conversation

@debba

@debba debba commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

Release-artifact verification of nightly 0.25.1-5 found that the signed macOS app and latest.json advertise 0.25.1-5, while tabularis --version reports 0.25.0. The SQL Server 1.0.0-beta.3 plugin is consequently rejected by the runtime version gate. Reproduced against the actual signed arm64 bundle in an isolated MCP home.

The workflow uses the GNU sed address 0,/.../, which silently leaves Cargo.toml unchanged on BSD sed.

Fix

  • Replace the platform-specific sed command with a portable Node script.
  • Stamp Tauri, Cargo package and frontend versions together, validating all inputs before writes.
  • Only change the package version, not dependency versions.
  • Keep stable and preview builds unchanged.

Validation

  • 7 tests covering LF/CRLF, all version sources, dependency preservation, invalid versions and missing literal package versions.
  • TypeScript project check and script ESLint passed.
  • GitNexus: 3 files changed; workflow/new-script hunks are not represented by indexed symbols. Manual scope review: nightly version stamping only.

Rollout

Publish the corrected nightly as 0.25.1-6; do not overwrite already-published 0.25.1-5 binaries. Refs TabularisDB/tabularis-sqlserver-plugin#26.

Comment thread .github/workflows/build.yml Outdated
echo "Patched version to $v"
# One portable implementation keeps the bundle, Rust runtime floor
# checks and frontend aligned. BSD sed does not support GNU's 0,/.../.
run: node scripts/set-nightly-version.mjs '${{ inputs.updater_version }}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Pass the version through env instead of interpolating the expression into the shell command

${{ inputs.updater_version }} is expanded by the Actions runner before bash parses the line, and it is substituted inside single quotes, so a value containing a ' breaks out of the quoting and runs as arbitrary shell. The regex validation in set-nightly-version.mjs happens afterwards and cannot protect the shell step. updater_version is currently produced by the nightly gate from tauri.conf.json, so the practical exposure is low, but the previous sed/inline-node version had the same exposure and the script now makes it easy to close: bind the input to an environment variable on the step and quote the variable.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in a998fc0: the step now binds NIGHTLY_VERSION through env and passes "$NIGHTLY_VERSION" to Node. The runtime validation no longer relies on shell quoting of a GitHub expression.

import { join, resolve } from "node:path";
import { afterEach, describe, expect, it } from "vitest";

const script = resolve("scripts/set-nightly-version.mjs");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Test location does not mirror src/ as required by .rules/testing.md

The rule states that test files live in a tests/ directory mirroring src/, with source logic in src/utils/. This file exercises scripts/set-nightly-version.mjs, so neither tests/utils/ nor a src/utils/ counterpart applies. A tests/scripts/set-nightly-version.test.ts would keep the directory mapping unambiguous and avoid implying a src/utils/nightlyVersion.ts module exists.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved to tests/scripts/set-nightly-version.test.ts in a998fc0. All seven regression tests still pass.

@kilo-code-bot

kilo-code-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The two findings from the previous review are resolved by the latest commit a998fc0f: .github/workflows/build.yml now binds updater_version to the step-level env key NIGHTLY_VERSION and passes it as "$NIGHTLY_VERSION", so the value is no longer spliced into the shell before bash parses it, and the test file was moved to tests/scripts/set-nightly-version.test.ts, matching the source location of scripts/set-nightly-version.mjs.

Re-verified on the current HEAD (a998fc0f): the version regex still rejects malformed nightlies before any write, the [package] section boundary and the single-literal-version check still guard the Cargo edit, CRLF input is still normalized by the split(/\r?\n/) + join("\n") round-trip, and dependency versions stay untouched because only the index inside [package] is rewritten.

Files Reviewed (3 files)
  • .github/workflows/build.yml
  • scripts/set-nightly-version.mjs
  • tests/scripts/set-nightly-version.test.ts

Notes

No new issues in the incremental diff. tests/scripts/ is a valid test location per the tests/**/*.{test,spec}.* include glob in vitest.config.ts, and the script's repo-root-relative paths match the job's default working directory.

Previous Review Summary (commit 84ac156)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 84ac156)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
.github/workflows/build.yml 239 updater_version interpolated into the shell inside single quotes; a quote in the value escapes the quoting before the script's own validation runs. Bind it to env and quote the variable.
tests/utils/nightlyVersion.test.ts 7 Test targets scripts/set-nightly-version.mjs but sits in tests/utils/, which .rules/testing.md reserves for a src/utils/ counterpart. tests/scripts/ would match the source location.
Files Reviewed (3 files)
  • .github/workflows/build.yml - 1 issue
  • scripts/set-nightly-version.mjs - 0 issues
  • tests/utils/nightlyVersion.test.ts - 1 issue

Notes

The core fix is sound: the script validates the version shape and the [package] section before any write, replaces only the literal package version key (leaving dependency versions and rust-version untouched), and normalizes CRLF by splitting on /\r?\n/. Coverage of the LF/CRLF and failure-before-write paths matches the PR description.

One observation outside the inline-comment scope: the script uses repo-root-relative paths, which is correct for the build.yml job (the working directory is the checkout root) and is what the tests exercise via cwd.

Fix these issues in Kilo Cloud


Reviewed by free · Input: 0 · Output: 0 · Cached: 0

@github-actions

Copy link
Copy Markdown
Contributor

Preview build

The preview build of commit a998fc0 failed (skipped). See the workflow run for logs.

@debba
debba merged commit 8d94624 into main Sep 29, 2026
3 checks passed
@debba
debba deleted the fix/nightly-cargo-version branch October 17, 2026 07:34
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