Skip to content

fix: release validation exits silently due to sourced set -e#300

Merged
danielmeppiel merged 1 commit intomainfrom
fix/release-validation-set-e
Mar 14, 2026
Merged

fix: release validation exits silently due to sourced set -e#300
danielmeppiel merged 1 commit intomainfrom
fix/release-validation-set-e

Conversation

@danielmeppiel
Copy link
Collaborator

Problem

Release validation script exits immediately after 'GitHub tokens configured successfully' with exit code 1, blocking the entire release pipeline.

Root Cause

scripts/test-dependency-integration.sh has set -euo pipefail on line 6. When this file is source'd into test-release-validation.sh (line 48), it re-enables -e that the parent script deliberately removed (set -uo pipefail # Removed -e to allow better error handling).

With -e active, ((tests_passed++)) on line 405 (where tests_passed starts at 0) evaluates to 0 (the pre-increment value). In bash, ((0)) has exit code 1. Under set -e, this kills the script.

Classic bash gotcha: post-increment x++ evaluates to the OLD value before incrementing.

Fix

  • Remove -e from sourced file (keep -uo pipefail) with explanatory comment
  • Remove dead code in check_prerequisites() that was unreachable after an early return

Impact

Unblocks the v0.7.9 release pipeline — all integration tests already pass on all 5 platforms.

test-dependency-integration.sh had `set -euo pipefail` which, when
sourced into test-release-validation.sh, re-enabled -e that the parent
script deliberately removed.  This caused `((tests_passed++))` (where
tests_passed starts at 0) to evaluate to 0 → exit code 1 → immediate
script termination under -e.

Fix: remove -e from the sourced file (keep -uo pipefail) and delete
dead code in check_prerequisites that was unreachable after an early
return.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 14, 2026 12:50
@danielmeppiel danielmeppiel merged commit 399a4e1 into main Mar 14, 2026
11 checks passed
@danielmeppiel danielmeppiel deleted the fix/release-validation-set-e branch March 14, 2026 12:50
Copy link
Contributor

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

This PR adjusts the release validation and dependency integration test scripts to avoid unintended shell option side effects when sourcing scripts, and to rely on centralized GitHub token setup.

Changes:

  • Removes redundant token export/logging from check_prerequisites() in the release validation script.
  • Avoids set -e in test-dependency-integration.sh to prevent re-enabling -e in the parent script when sourced.

Reviewed changes

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

File Description
scripts/test-release-validation.sh Simplifies prerequisites by relying on setup_github_tokens (removes redundant env re-exports).
scripts/test-dependency-integration.sh Prevents set -e from leaking into the sourcing script by switching to set -uo pipefail and documenting why.

Comment on lines 86 to 96
check_prerequisites() {
log_test "Prerequisites: GitHub token"

# Use centralized token management
if setup_github_tokens; then
log_success "GitHub tokens configured successfully"
return 0
else
log_error "GitHub token setup failed"
return 1
fi
# error-handling strategy. Setting -e here would re-enable it for the
# sourcing script, causing silent early exits (e.g. `((count++))` when
# count is 0 returns exit-code 1 under -e).
set -uo pipefail
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