fix(ci): Fix cosign signing loop and release notes generation#16
Merged
fix(ci): Fix cosign signing loop and release notes generation#16
Conversation
The heredoc in the "Generate release notes" step had a premature EOF terminator at line 588, which closed the heredoc early. This caused installation instructions (lines 590-621) to execute as actual shell commands instead of being written to the markdown file. The commands included curl downloads and tar extractions that failed because the archives didn't exist yet, resulting in "gzip: stdin: not in gzip format" and "tar: Error is not recoverable" errors. Removed the premature EOF to ensure the entire markdown content is properly captured in the heredoc. $fix
📊 Coverage Report
View detailed reportGenerated by cargo-tarpaulin |
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.
Summary
This PR fixes two critical bugs in the release workflow that prevented successful GitHub releases:
Key Changes
🐛 Critical Bug Fixes
Fix cosign signing loop arithmetic error (.github/workflows/release.yml:459)
((SIGNED_COUNT++))withset -ecaused exit after first fileSIGNED_COUNT=0, the expression((SIGNED_COUNT++))returns pre-increment value (0) as exit status, which bash interprets as failure (exit code 1)SIGNED_COUNT=$((SIGNED_COUNT + 1))which always returns exit code 0Fix heredoc premature EOF in release notes (.github/workflows/release.yml:588)
EOFterminator that closed the heredoc early🛡️ Defensive Programming Improvements
Add file/directory existence checks (all workflows)
Affected workflows:
.github/workflows/ci.yml: audit.json, coverage XML, package.json verification.github/workflows/release.yml: artifacts directory, archive files, cosign outputs.github/workflows/release-plz.yml: Cargo.toml existence checks.github/workflows/publish-crate.yml: Release existence, Cargo.toml validation📝 Documentation Updates
Add development guidelines (CLAUDE.md:452-463)
Workflow analysis report (docs/reports/130-analyze-workflows.md)
🔧 Tooling Configuration
Update Claude Code settings (.claude/settings.json)
Edittool to safe tool list for workflow maintenanceTesting
All quality checks passed locally:
cargo fmt --all -- --check- Code formatting verified (no Rust code changes)cargo clippy --all-targets --all-features -- -D warnings- No linting issuescargo test- All 158 tests passcargo tarpaulin- Coverage maintained at ≥70%Workflow validation:
set -eCI/CD Status
This PR will trigger the following CI checks:
Note: This PR does not modify any Rust source code, only workflow files and documentation.
Type of Change
Related Issues
This PR fixes the following release workflow failures:
Breaking Changes
None - this PR only fixes CI/CD workflows and does not change any user-facing functionality or API.
Release Impact
Version bump: patch
Changelog category: CI/CD improvements (likely with
$no-changelogsince internal)Footer tags used:
$fix,$ci,$docs,$choreThis PR will be included in the next release created by release-plz. Changes are internal (CI/CD only) and do not affect the published crate functionality.
Pre-merge Checklist
/ccommand)cargo fmt --all(N/A - no Rust code changes)cargo clippy --all-targets --all-features -- -D warningscargo testcargo tarpaulinAdditional Context
Root Cause Analysis
Cosign signing bug:
This is a subtle bash gotcha that occurs when combining arithmetic expressions with
set -e(exit on error):The fix uses assignment form which always succeeds:
Heredoc bug:
The heredoc was closed prematurely at line 588:
The fix removes the premature EOF so the entire markdown content is captured.
Testing Strategy
Both bugs were discovered through GitHub Actions failure analysis:
Implementation Approach
The defensive checks follow a consistent pattern across all workflows:
This pattern ensures:
Dependencies
No changes to dependencies in
Cargo.toml.