Skip to content

Add release fast preflight#59

Merged
filipeforattini merged 2 commits into
mainfrom
agent/release-fast-preflight
Jun 23, 2026
Merged

Add release fast preflight#59
filipeforattini merged 2 commits into
mainfrom
agent/release-fast-preflight

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a reusable RedDB release asset preflight script
  • make the full Release workflow fail early when pinned RedDB sidecar assets are missing
  • add a Linux-only Release Fast workflow that smoke-packages a .deb artifact
  • update CLAUDE.md with release/build performance discipline

Validation

  • node --check scripts/check-reddb-release-assets.mjs
  • actionlint -ignore 'label "blacksmith-.*" is unknown' .github/workflows/release.yml .github/workflows/release-fast.yml
  • pnpm build
  • pnpm check
  • pnpm test
  • git diff --check
  • REDDB_VERSION=v1.11.0 node scripts/check-reddb-release-assets.mjs x86_64-unknown-linux-gnu x86_64-pc-windows-msvc (expected failure today: pinned RedDB release/assets are not visible)

Note

The current pinned RedDB release assets are not visible through the GitHub releases API, so the new preflight catches the same release blocker before expensive matrix work starts.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Added an expedited release workflow enabling faster manual Linux desktop builds with configurable build component versions
    • Introduced automated pre-release asset validation checks to verify all required build components are available before starting production releases
    • Updated development documentation with guidance on optimized release processes and build profile configurations

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@filipeforattini, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 48 minutes and 3 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 90ff6058-e99c-4db2-a2c4-1b7319a41ada

📥 Commits

Reviewing files that changed from the base of the PR and between 8512495 and 8dfdb56.

📒 Files selected for processing (3)
  • .github/workflows/release-fast.yml
  • .github/workflows/release.yml
  • scripts/check-reddb-release-assets.mjs
📝 Walkthrough

Walkthrough

Adds a Node.js preflight script (scripts/check-reddb-release-assets.mjs) that validates RedDB sidecar release assets on GitHub for given target triples. This script is wired as a reddb:preflight npm script, integrated as a blocking preflight job in the existing Release workflow, and embedded directly in a new manual release-fast.yml workflow that produces a Linux .deb bundle.

Changes

RedDB Preflight Check and Release Fast Workflow

Layer / File(s) Summary
RedDB asset preflight script and package wiring
scripts/check-reddb-release-assets.mjs, package.json
Introduces the CLI script that maps target triples to expected asset filenames, queries the GitHub Releases API for the pinned or latest RedDB release, and exits with code 1 if required assets are missing. The reddb:preflight script entry in package.json invokes it for Linux and Windows targets.
Release Fast workflow (manual, linux-deb)
.github/workflows/release-fast.yml
New workflow_dispatch workflow with a reddb_version input. Defines a single linux-deb job that sets up pnpm/Node/Bun/Rust, runs the RedDB asset check, builds the core contract and engine sidecar, fetches the RedDB sidecar, builds the Tauri .deb bundle, and uploads artifacts.
Preflight integration in Release workflow and docs
.github/workflows/release.yml, CLAUDE.md
Adds a preflight job to the existing Release workflow that runs the asset check for both target triples before the build job. Adds CLAUDE.md bullets on using Release Fast for smoke tests and treating LTO/PGO/allocator changes as measured experiments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A rabbit checks the shelves before the build begins,
"Are all the RedDB assets here?" — it grins and grins.
With exit codes and triples, it scans each release tag,
No missing .deb or .exe shall slip past in the bag.
Then off the fast lane fires, a Linux bundle bright —
The warren ships with confidence, everything's alright! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: adding a release fast preflight validation system for RedDB assets, which is central to all modifications across workflows, scripts, and documentation.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/release-fast-preflight

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (1)
.github/workflows/release-fast.yml (1)

26-27: 🔒 Security & Privacy | 🔵 Trivial

Consider pinning action versions to commit SHAs and set persist-credentials: false for checkout.

This workflow uses mutable action tags (e.g., @v7, @v6) and does not disable credential persistence on the checkout step. While both are common patterns, pinning by commit SHA improves supply chain hardening.

🔒 Hardening pattern
-      - uses: actions/checkout@v7
+      - uses: actions/checkout@<full_commit_sha>
+        with:
+          persist-credentials: false

-      - uses: actions/setup-node@v6
+      - uses: actions/setup-node@<full_commit_sha>

Apply the same approach to each uses: step: lines 26, 36, 40, 45, 49, 53, and 87.

🤖 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-fast.yml around lines 26 - 27, The workflow file
uses mutable action version tags (like `@v7`) and does not disable credential
persistence on the checkout action, which reduces supply chain security. Replace
the mutable version tags with pinned commit SHAs for all uses steps throughout
the file (including the actions/checkout@v7 step and the other actions at the
lines mentioned). Additionally, add persist-credentials: false to the checkout
action to prevent unnecessary credential persistence. This applies to all uses
directives in the workflow to maintain consistent security hardening.

Source: Linters/SAST tools

🤖 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 33-40: The actions/checkout@v7 and actions/setup-node@v6 in the
preflight job are not pinned to immutable commit SHAs, creating supply chain
attack risks since this job accesses secrets. Replace the version tags (v7 and
v6) with their full commit SHAs to harden against tampering. Additionally,
disable package-manager caching in the setup-node action by adding the cache
configuration set to false, since this preflight job does not require dependency
caching.

In `@scripts/check-reddb-release-assets.mjs`:
- Around line 35-37: The fetch call to the GitHub API in the preflight check
lacks a timeout mechanism and can hang indefinitely during network stalls,
blocking the CI/CD pipeline. Add a timeout to the fetch call by using
AbortController with a reasonable timeout duration (typically 30 seconds or less
for API calls). Create an AbortController instance, set up a timeout that aborts
the request if it takes too long, and pass the abort signal to the fetch options
alongside the existing headers parameter. This ensures the preflight fails fast
as intended rather than hanging the entire pipeline.

---

Nitpick comments:
In @.github/workflows/release-fast.yml:
- Around line 26-27: The workflow file uses mutable action version tags (like
`@v7`) and does not disable credential persistence on the checkout action, which
reduces supply chain security. Replace the mutable version tags with pinned
commit SHAs for all uses steps throughout the file (including the
actions/checkout@v7 step and the other actions at the lines mentioned).
Additionally, add persist-credentials: false to the checkout action to prevent
unnecessary credential persistence. This applies to all uses directives in the
workflow to maintain consistent security hardening.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96fc3363-077a-48dd-b3e4-d5ae08c8bad2

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9dd6a and 8512495.

📒 Files selected for processing (5)
  • .github/workflows/release-fast.yml
  • .github/workflows/release.yml
  • CLAUDE.md
  • package.json
  • scripts/check-reddb-release-assets.mjs

Comment on lines +33 to +40
- uses: actions/checkout@v7
with:
ref: ${{ github.event.inputs.tag || github.ref }}

- uses: actions/setup-node@v6
with:
node-version: "22"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/release.yml | head -60

Repository: reddb-io/red-request

Length of output: 2305


🏁 Script executed:

# Check what the actual commit SHAs are for the recommended action versions
# First, let's see if there are any GitHub Actions versioning details or security scanning in the repo

fd -e yml -e yaml . --max-depth 3 | grep -E "(workflow|action|security)" | head -20

Repository: reddb-io/red-request

Length of output: 158


🏁 Script executed:

# Let's verify the actual commit SHAs for actions/checkout@v7 and actions/setup-node@v6
# by checking GitHub's official releases

curl -s https://api.github.com/repos/actions/checkout/releases/tags/v7 | jq -r '.target_commitish' 2>/dev/null || echo "API check failed"
curl -s https://api.github.com/repos/actions/setup-node/releases/tags/v6 | jq -r '.target_commitish' 2>/dev/null || echo "API check failed"

Repository: reddb-io/red-request

Length of output: 168


🏁 Script executed:

# Let's also search for any existing hardening patterns or zizmor config in the repo

fd -name "*.mjs" -o -name "*.js" -o -name ".zizmor*" -o -name "*zizmor*" . --max-depth 3
rg "zizmor|persist-credentials|package-manager-cache" . --type yml --type yaml -C 2

Repository: reddb-io/red-request

Length of output: 417


🏁 Script executed:

# Check if there are other workflows in the repo and how they pin actions
rg "actions/(checkout|setup-node)" .github/workflows/ -A 2

Repository: reddb-io/red-request

Length of output: 2172


🏁 Script executed:

# Let's check if there's any documentation or comments in the repo about action pinning or security policies
rg "persist-credentials|package-manager-cache|full.commit.sha|SHA-pinned" . -i --type yaml -B 2 -A 2

Repository: reddb-io/red-request

Length of output: 158


🏁 Script executed:

# Check the .github directory structure to see if there are any security or dependabot configs
ls -la .github/

Repository: reddb-io/red-request

Length of output: 392


🏁 Script executed:

# Let's also verify whether these are legitimate security concerns by checking if there's any known vulnerability or recommendation
# for these specific action versions
cat .github/workflows/release.yml | grep -A 5 "checkout@v7\|setup-node@v6"

Repository: reddb-io/red-request

Length of output: 826


🌐 Web query:

actions/checkout@v7 SHA pinning security best practices GitHub Actions

💡 Result:

Pinning actions/checkout@v7 (or any third-party GitHub Action) to a full-length commit SHA is a recommended security best practice to prevent supply chain attacks [1][2][3]. ### Why SHA Pinning is Required By default, referencing actions by a tag (like @v7) is mutable, meaning the tag can be moved or deleted by an attacker who gains access to the repository, potentially leading to the execution of malicious code [1][2][3]. Pinning to an immutable, full-length commit SHA ensures that your workflow always executes the exact code you have audited [1][2][3]. ### How to Pin Correctly To maintain both security and readability, use the following pattern in your workflow files [3][4]: - uses: actions/checkout@9c091bb # v7.0.0 The full 40-character SHA provides security against repository compromise, while the trailing comment serves as a human-readable reference for version tracking [3][4]. You can retrieve the correct SHA for any tag using standard Git commands or the GitHub CLI [3]: # Using Git git ls-remote --tags https://github.com/actions/checkout.git v7.0.0 # Using GitHub CLI gh api repos/actions/checkout/git/ref/tags/v7.0.0 --jq '.object.sha' ### Operational Best Practices - Automation: Use tools like Dependabot or Renovate to manage these pins [5][3][4]. These tools can automatically open pull requests to update the SHA and comment when a new version is released, reducing the maintenance burden while maintaining security [5][3][6]. - Policy Enforcement: If you are an administrator, you can enforce SHA pinning at the repository, organization, or enterprise level via GitHub’s "allowed actions" policies [2][7][8]. When enabled, any workflow using a tag instead of a SHA will fail automatically [7][8]. - Security Context: Note that actions/checkout@v7 specifically introduces enhanced security protections against insecure pull request checkout patterns (such as in pull_request_target workflows) [9]. While upgrading to v7 provides these native safeguards, pinning remains a fundamental best practice for all actions to ensure supply chain integrity [1][3][9].

Citations:


🌐 Web query:

actions/setup-node package-manager-cache security risk cache poisoning

💡 Result:

The actions/setup-node action includes a feature that automatically caches dependencies by default when using npm [1][2]. This automatic caching introduces a potential security risk related to cache poisoning, particularly in privileged workflows [3][4]. If a workflow is compromised or if an attacker can manipulate the environment, they may be able to poison the cache [3]. A poisoned cache could lead to the execution of malicious code or the exfiltration of sensitive information, such as credentials or secrets, during subsequent workflow runs [3][5]. This is a particular concern in workflows that have elevated privileges or access to high-value secrets [3][1]. To mitigate this risk, the following recommendations are provided by the official documentation: 1. Disable automatic caching: For workflows with elevated privileges or access to sensitive information, it is strongly recommended to set package-manager-cache: false in your setup-node step [1][2]. This prevents the action from automatically caching or restoring dependencies [3]. 2. Use explicit configurations: By disabling automatic caching, you maintain more control over the caching process [3]. If you require caching for performance, ensure it is configured explicitly and securely [3]. 3. Maintain lockfiles: Always commit your package manager's lockfile (e.g., package-lock.json). This ensures consistent dependency resolution and is a best practice for security and performance [1][6]. The maintainers of actions/setup-node have noted that the action cannot automatically detect if it is running in a privileged context, making manual configuration by the workflow author the primary defense [4]. Consequently, disabling automatic caching is the most effective way to eliminate this specific attack vector in sensitive environments [3][5].

Citations:


Harden the preflight job actions: SHA-pin to full commit SHA and disable setup-node package-manager cache.

actions/checkout@v7 and actions/setup-node@v6 are not pinned to immutable commit SHAs. The preflight job accesses secrets and makes API calls, making it sensitive to supply chain attack and cache poisoning risks. Disable package-manager caching here since this job does not need it.

🔧 Suggested hardening changes
-      - uses: actions/checkout@v7
+      - uses: actions/checkout@<full_commit_sha>
         with:
           ref: ${{ github.event.inputs.tag || github.ref }}
+          persist-credentials: false

-      - uses: actions/setup-node@v6
+      - uses: actions/setup-node@<full_commit_sha>
         with:
           node-version: "22"
+          package-manager-cache: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 33-35: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 33-33: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 37-37: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 37-37: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default

(cache-poisoning)

🤖 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 - 40, The actions/checkout@v7
and actions/setup-node@v6 in the preflight job are not pinned to immutable
commit SHAs, creating supply chain attack risks since this job accesses secrets.
Replace the version tags (v7 and v6) with their full commit SHAs to harden
against tampering. Additionally, disable package-manager caching in the
setup-node action by adding the cache configuration set to false, since this
preflight job does not require dependency caching.

Source: Linters/SAST tools

Comment thread scripts/check-reddb-release-assets.mjs Outdated
@filipeforattini filipeforattini merged commit a60e543 into main Jun 23, 2026
3 checks passed
@filipeforattini filipeforattini deleted the agent/release-fast-preflight branch June 23, 2026 15:22
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