fix: release validation exits silently due to sourced set -e#300
Merged
danielmeppiel merged 1 commit intomainfrom Mar 14, 2026
Merged
fix: release validation exits silently due to sourced set -e#300danielmeppiel merged 1 commit intomainfrom
danielmeppiel merged 1 commit intomainfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
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 -eintest-dependency-integration.shto prevent re-enabling-ein 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shhasset -euo pipefailon line 6. When this file issource'd intotest-release-validation.sh(line 48), it re-enables-ethat the parent script deliberately removed (set -uo pipefail # Removed -e to allow better error handling).With
-eactive,((tests_passed++))on line 405 (wheretests_passedstarts at 0) evaluates to 0 (the pre-increment value). In bash,((0))has exit code 1. Underset -e, this kills the script.Classic bash gotcha: post-increment
x++evaluates to the OLD value before incrementing.Fix
-efrom sourced file (keep-uo pipefail) with explanatory commentcheck_prerequisites()that was unreachable after an early returnImpact
Unblocks the v0.7.9 release pipeline — all integration tests already pass on all 5 platforms.