Skip to content

fix(ci): resolve CI/CD release failures - #25

Merged
rfxlamia merged 4 commits into
mainfrom
fix-ci-cd-release
Mar 8, 2026
Merged

fix(ci): resolve CI/CD release failures#25
rfxlamia merged 4 commits into
mainfrom
fix-ci-cd-release

Conversation

@rfxlamia

@rfxlamia rfxlamia commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Summary

Fix 3 CI/CD failures in release.yml:

1. Ubuntu - Observer Test Race Condition

Problem: Environment variable tests (test_detect_backend_*) run in parallel, causing race conditions.
Fix: Add serial_test crate and #[serial] attribute to all 5 backend detection tests.

2. macOS - tauri-action Schema Error

Problem: tauri-action@v0 fails with "overlay" is not valid schema error.
Fix: Upgrade to tauri-action@dev which has proper schema support.

3. Windows - Pre-commit Hook Test Failure

Problem: test_commit_changes_pre_commit_hook_failure fails on Windows CI runners.
Fix: Skip this test on Windows with #[cfg_attr(windows, ignore)].

Bonus

  • Added rust-test job to ci.yml to catch test failures before release

Changes

File Change
src-tauri/Cargo.toml Add serial_test = "3.0" to dev-dependencies
src-tauri/src/bin/observer.rs Add #[serial] to 5 test functions
src-tauri/src/commands/git.rs Skip pre-commit hook test on Windows
.github/workflows/release.yml Use tauri-action@dev
.github/workflows/ci.yml Add rust-test job

Testing

  • CI passes on all platforms
  • Release workflow succeeds

Summary by CodeRabbit

  • Tests

    • Added multi-platform Rust test runs (Linux, macOS, Windows) to CI for parallelized coverage.
    • Ensured serialized test execution to avoid race conditions.
    • Added Windows-specific test handling for flaky Git-hook-related tests.
  • Chores

    • Updated CI workflows and release action configuration.
    • Added a development test dependency to support the new test setup.

rfxlamia added 3 commits March 8, 2026 13:19
test(git): skip pre-commit hook test on Windows CI
fix(observer): add serial_test to prevent race conditions in env var tests
@coderabbitai

coderabbitai Bot commented Mar 8, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97125588-066b-4d28-b89e-5dc489f2c979

📥 Commits

Reviewing files that changed from the base of the PR and between e25c774 and 206710b.

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

📝 Walkthrough

Walkthrough

Adds a multi-platform rust-test CI job, updates the release workflow's tauri action reference, introduces serial_test as a dev dependency, serializes observer tests, and marks a Git-hook-related test to be ignored on Windows.

Changes

Cohort / File(s) Summary
CI Workflows
.github/workflows/ci.yml, .github/workflows/release.yml
Added a rust-test job that runs cargo test across ubuntu-latest, macos-latest, and windows-latest; updated tauri-action reference in release workflow.
Tauri tests & deps
src-tauri/Cargo.toml, src-tauri/src/bin/observer.rs
Added serial_test = "3.0" to [dev-dependencies]; annotated observer tests with #[serial] to enforce serialized execution.
Git command tests
src-tauri/src/commands/git.rs
Added a Windows-specific ignore attribute (#[cfg_attr(windows, ignore = "Windows CI runners don't support Git hooks consistently")]) to the Git-hook-related test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through CI, three lanes to test,
I tucked the runners so they sleep in rest,
Serial whispers keep each trial in line,
Windows skips the hook — the rest align,
A tiny rabbit cheers this tidy vine. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes fixing CI/CD release failures, which is the main objective of this PR, but doesn't specify the key fixes (race conditions, schema errors, platform-specific tests).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-ci-cd-release

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 and usage tips.

Comment thread .github/workflows/release.yml Outdated

- name: Build and release
uses: tauri-apps/tauri-action@v0
uses: tauri-apps/tauri-action@dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔥 The Roast: Using @dev branch for a CI/CD action is like choosing "trust me, bro" as your deployment strategy. This is the digital equivalent of Russian roulette with your release pipeline — except the gun always has at least one bullet.

🩹 The Fix: Pin to a specific version tag like tauri-apps/tauri-action@v0.3.0 or wait for the next stable release. Your future self (and your users) will thank you when the build doesn't mysteriously break because someone pushed a commit to dev.

📏 Severity: critical

@kilo-code-bot

kilo-code-bot Bot commented Mar 8, 2026

Copy link
Copy Markdown

Code Review Roast 🔥

Verdict: Issues Addressed | Recommendation: Merge

Overview

Severity Count
🚨 critical 0
⚠️ warning 0
💡 suggestion 1
🤏 nitpick 0

Note: The previously reported critical issue (unpinned @dev branch in release.yml) has been FIXED in this PR. The action is now pinned to a specific commit SHA (850c373b94f35e16e4de61cbb9f6e4876af8c0b4), which addresses the supply chain risk.

Issue Details (click to expand)
File Line Roast
.github/workflows/ci.yml 202 Suggestion: The rust-test job omits libxdo-dev present in other Linux jobs — not blocking since x11rb doesn't require it, but worth noting for consistency

🏆 Best part: Where do I start? The pinned SHA in release.yml (850c373b94f35e16e4de61cbb9f6e4876af8c0b4) finally puts the supply chain concerns to rest — someone actually listened! The new rust-test job bringing multi-platform CI (Ubuntu, macOS, Windows) is chefs kiss. And adding serial_test for proper test isolation? That's the kind of attention to detail that prevents 3 AM pagers.

💀 Worst part: The libxdo-dev inconsistency between jobs is a nitpick that barely registers on the severity scale — the project uses x11rb (pure Rust), not libxdo, so it's technically unnecessary. But hey, consistency is consistency.

📊 Overall: This PR is a net positive — fixes the critical security concern, adds robust test infrastructure, and improves test reliability with serial execution. The only remaining "issue" is a cosmetic dependency inconsistency that has zero runtime impact. Merge with confidence.

Files Reviewed (6 files)
  • .github/workflows/ci.yml - 1 suggestion
  • .github/workflows/release.yml - Critical issue FIXED
  • src-tauri/Cargo.toml - No issues
  • src-tauri/Cargo.lock - Auto-generated (excluded)
  • src-tauri/src/bin/observer.rs - No issues
  • src-tauri/src/commands/git.rs - No issues

Note: The existing inline comments about @dev branch are now outdated — the PR was updated to use a pinned SHA, which is the correct fix.

@greptile-apps

greptile-apps Bot commented Mar 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR addresses three CI/CD failures in release.yml — an environment variable race condition in observer tests (fixed with serial_test), a tauri-action schema error (worked around by switching to @dev), and a flaky Windows pre-commit hook test (skipped via #[cfg_attr(windows, ignore)]) — and adds a new cross-platform rust-test job to ci.yml to catch test failures earlier.

  • Race condition fix (observer.rs): Adding #[serial] to all 5 detect_backend_* tests is the correct approach; the tests mutate process-wide environment variables and must not run in parallel.
  • Windows test skip (git.rs): #[cfg_attr(windows, ignore)] is a pragmatic workaround; the test still runs on Linux and macOS where Git hooks behave predictably.
  • tauri-action@dev (release.yml): Switching from @v0 to @dev resolves the schema validation error but replaces one problem with a more serious one — @dev is a mutable branch reference. Any commit pushed to that branch (including a malicious one) will execute in the release pipeline with access to GITHUB_TOKEN and other secrets. This should be pinned to a specific release tag or commit SHA before merging.
  • New rust-test CI job (ci.yml): Well-structured addition that mirrors the cargo-check job; note that it omits libxdo-dev from the Linux dependency list, unlike release.yml and the build job.
  • Bundled version bump: The package version change from 0.1.0-alpha to 0.1.0-beta in Cargo.toml/Cargo.lock is unrelated to the CI fixes and should ideally live in its own commit.

Confidence Score: 2/5

  • Not safe to merge until tauri-action@dev is replaced with a pinned, immutable reference to avoid supply chain risk in the release pipeline.
  • The Rust-side fixes (serial tests, Windows skip, new CI job) are sound, but the core release workflow change swaps a broken stable pin for an unpinned mutable branch that could be silently updated at any time — including by a malicious actor — and executes with GITHUB_TOKEN during every release. This single issue in release.yml is enough to block merging.
  • .github/workflows/release.yml — the tauri-apps/tauri-action@dev reference must be replaced with a pinned tag or SHA before this goes to production.

Important Files Changed

Filename Overview
.github/workflows/release.yml Changed tauri-apps/tauri-action@v0 to @dev — fixes the schema error but introduces a mutable branch reference that is a supply chain security risk; should be pinned to a specific tag or SHA instead.
.github/workflows/ci.yml Added rust-test cross-platform job running cargo test --lib --bin ronin-observer; omits libxdo-dev on Linux compared to other jobs, which may cause issues, but is otherwise well-structured.
src-tauri/src/bin/observer.rs Added #[serial] to all 5 backend-detection tests that mutate environment variables — correctly fixes the race condition.
src-tauri/src/commands/git.rs Added #[cfg_attr(windows, ignore)] to test_commit_changes_pre_commit_hook_failure — pragmatically skips the unreliable Windows hook test; the test is still executed on Linux and macOS.
src-tauri/Cargo.toml Added serial_test = "3.0" dev-dependency and bumped the package version from 0.1.0-alpha to 0.1.0-beta; the version bump is unrelated to the CI fix and should ideally be in a separate commit.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[git push tag v*] --> B[release.yml triggered]

    B --> C{Matrix platform}
    C --> D[ubuntu-22.04]
    C --> E[macos-latest]
    C --> F[windows-latest]

    D & E & F --> G[Checkout + Setup Node + Rust]
    G --> H[Install deps]
    H --> I[npm ci + npm test]
    I --> J["cargo test\n(all tests)"]

    J -->|Windows| J1["test_commit_changes_pre_commit_hook_failure\n→ IGNORED via #[cfg_attr(windows,ignore)]"]
    J -->|Linux| J2["observer backend tests\n→ run SERIALLY via #[serial]"]
    J -->|macOS| J3[All tests run normally]

    J1 & J2 & J3 --> K["tauri-apps/tauri-action@dev ⚠️\n(mutable branch — security risk)"]
    K --> L[Build & upload release artifacts]
    L --> M[GitHub Release Draft]

    subgraph ci.yml [ci.yml — new rust-test job]
        N[push to main/develop or PR] --> O{Matrix platform}
        O --> P[ubuntu-latest]
        O --> Q[macos-latest]
        O --> R[windows-latest]
        P & Q & R --> S["cargo test --lib --bin ronin-observer"]
    end
Loading

Comments Outside Diff (1)

  1. src-tauri/Cargo.toml, line 2 (link)

    Unrelated version bump bundled in CI fix PR

    The package version was bumped from 0.1.0-alpha to 0.1.0-beta as part of this PR. This change is visible in both Cargo.toml and Cargo.lock but is unrelated to the three CI/CD failures being fixed. Bundling a version bump with a CI fix can make it harder to trace when the version change was intentional and why. Consider keeping version bumps in a separate commit or PR for clearer history.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Last reviewed commit: e25c774

Comment thread .github/workflows/release.yml Outdated

- name: Build and release
uses: tauri-apps/tauri-action@v0
uses: tauri-apps/tauri-action@dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unpinned mutable branch reference is a supply chain risk

Using tauri-apps/tauri-action@dev pins to the tip of a mutable branch rather than an immutable tag or commit SHA. This means any commit pushed to the dev branch — including a potentially malicious one — will silently execute in your release pipeline on the next run with full access to GITHUB_TOKEN and other secrets.

The original @v0 issue was a schema validation error, which is likely already resolved in a newer stable release. The safer alternatives are:

  1. Pin to a specific commit SHA (most secure):
Suggested change
uses: tauri-apps/tauri-action@dev
uses: tauri-apps/tauri-action@5def7825be7cd2d62e7b0c3f6cf4ab3d93db68e
  1. Pin to a newer release tag (if available):
Suggested change
uses: tauri-apps/tauri-action@dev
uses: tauri-apps/tauri-action@v0.5

Please check the tauri-action releases for the latest stable tag that includes the schema fix, and pin to that instead.

Comment thread .github/workflows/ci.yml
Comment on lines +193 to +202
- name: Install system dependencies (Linux only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing libxdo-dev compared to other Linux jobs

The release.yml Linux step and the existing build job in ci.yml both install libxdo-dev, but the new rust-test job omits it. If any crate compiled during cargo test --lib --bin ronin-observer links against libxdo, the Linux runner will fail to compile.

Currently the cargo-check job also omits libxdo-dev and presumably works, so this may not be an immediate issue — but for consistency and to avoid future surprises consider adding it:

Suggested change
- name: Install system dependencies (Linux only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install system dependencies (Linux only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 77-78: Replace the unstable branch pin in the "Build and release"
step: instead of uses: tauri-apps/tauri-action@dev, pin the action to a specific
commit SHA that contains the schema fix (replace the `@dev` suffix with
@<commit-sha>) so the workflow uses a reproducible, immutable version; update
the "Build and release" step (the one with uses: tauri-apps/tauri-action@dev) to
reference that commit SHA and commit the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f371a8b6-4630-4e6e-9675-e3abe0caac32

📥 Commits

Reviewing files that changed from the base of the PR and between f398aec and e25c774.

⛔ Files ignored due to path filters (1)
  • src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • src-tauri/Cargo.toml
  • src-tauri/src/bin/observer.rs
  • src-tauri/src/commands/git.rs

Comment thread .github/workflows/release.yml Outdated
Replace @dev with specific commit SHA for reproducible builds.
Commit: 850c373b94f35e16e4de61cbb9f6e4876af8c0b4
@rfxlamia
rfxlamia merged commit 206710b into main Mar 8, 2026
9 of 10 checks passed
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