Skip to content

fix(ci): prevent bash -e from killing release gate on skipped desktop tests#259

Merged
FSM1 merged 1 commit into
mainfrom
fix/release-gate-bash-e
Mar 3, 2026
Merged

fix(ci): prevent bash -e from killing release gate on skipped desktop tests#259
FSM1 merged 1 commit into
mainfrom
fix/release-gate-bash-e

Conversation

@FSM1

@FSM1 FSM1 commented Mar 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes the release gate failing on the release-please PR even though desktop E2E tests passed on main
  • Root cause: GitHub Actions uses bash -e, so when run_executed_tests returns 1 (tests were skipped), the script exits before rc=$? can capture the return code
  • The fallback search for an in-range run that actually executed tests never gets a chance to run
  • Fix: use && rc=0 || rc=$? pattern to capture the return code without triggering set -e

Test plan

  • Merge this PR, then verify the release-please PR's release gate passes
  • The desktop E2E verification step should fall through to find an in-range run with executed tests

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved exit code handling in the release workflow to formalize error state tracking while maintaining functional equivalence.

GitHub Actions uses `bash -e`, so when `run_executed_tests` returns 1
(tests skipped), the script exits before reaching `rc=$?`. Use
`&& rc=0 || rc=$?` pattern to capture the return code without
triggering set -e.

This was causing the release gate to fail even though desktop E2E
tests passed on main — the HEAD run had skipped desktop jobs (no
desktop changes detected by the e2e-desktop workflow), and the
fallback search for an in-range run never executed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: a1c6de460be5
@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b641ca and 2c0dc08.

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

Walkthrough

Modified exit code handling in the release gate workflow by chaining the run_executed_tests function call with conditional assignment (&&/||). The change replaces separate rc=$? captures with explicit conditional logic that sets rc=0 on success and propagates non-zero codes on failure across two invocations.

Changes

Cohort / File(s) Summary
Release Gate Workflow
.github/workflows/release-gate.yml
Modified two instances of exit code capture from run_executed_tests to chain assignment using conditional operators (run_executed_tests "<id>" && rc=0 || rc=$?) instead of separate rc=$? statements. Maintains functional equivalence while formalizing success/failure exit code propagation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 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 directly addresses the main change: using a bash pattern to prevent set -e from exiting prematurely when tests are skipped, which is exactly what the PR fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/release-gate-bash-e

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.

@FSM1 FSM1 requested a review from Copilot March 3, 2026 22:13
@FSM1 FSM1 merged commit 13d805f into main Mar 3, 2026
22 checks passed

Copilot AI left a comment

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.

Pull request overview

Fixes the release gate workflow so that “desktop E2E tests were skipped” (exit code 1 from run_executed_tests) doesn’t prematurely terminate the step under GitHub Actions’ default bash -e, allowing the fallback search for an in-range run with executed tests to proceed.

Changes:

  • Captures run_executed_tests exit codes without triggering set -e early-exit by using cmd && rc=0 || rc=$?.
  • Applies the same exit-code capture fix both for the HEAD run check and the in-range run fallback loop.

You can also share your feedback on Copilot code review. Take the survey.

@codecov

codecov Bot commented Mar 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.68%. Comparing base (ef90514) to head (2c0dc08).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
+ Coverage   46.31%   46.68%   +0.37%     
==========================================
  Files         106      106              
  Lines        8266     8255      -11     
  Branches      591      594       +3     
==========================================
+ Hits         3828     3854      +26     
+ Misses       4271     4233      -38     
- Partials      167      168       +1     
Flag Coverage Δ
api 84.55% <ø> (+0.68%) ⬆️
crypto 84.55% <ø> (+0.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants