Skip to content

fix(releasekit): ensure command output is visible in CI on failure#4666

Merged
yesudeep merged 3 commits intomainfrom
yesudeep/fix/releasekit-output-visibility
Feb 14, 2026
Merged

fix(releasekit): ensure command output is visible in CI on failure#4666
yesudeep merged 3 commits intomainfrom
yesudeep/fix/releasekit-output-visibility

Conversation

@yesudeep
Copy link
Contributor

With set -euo pipefail, the pattern OUTPUT=$(cmd 2>&1) causes the shell to exit immediately when the command fails — before echo "$OUTPUT" ever runs. This makes CI logs show only "Process completed with exit code 1" with zero diagnostic info, as seen in run #22007335034.

Root cause: set -e treats a non-zero exit from a command substitution as an immediate error. The output is captured into $OUTPUT but the script exits before printing it.

Fix: Temporarily disable set -e around the capture, save the exit code into $EXIT_CODE, re-enable set -e, always print the output, then exit with the saved code if non-zero. Also emits a GitHub Actions ::error:: annotation for better visibility in the workflow summary.

Applied to all five capture sites across three workflow files:

  • .github/workflows/releasekit-uv.yml (prepare + release)
  • releasekit/github/workflows/releasekit-uv.yml (prepare + release)
  • releasekit/github/workflows/releasekit-pnpm.yml (2× prepare + release)

With `set -euo pipefail`, the pattern `OUTPUT=$(cmd 2>&1)` causes
the shell to exit immediately when the command fails, before
`echo "$OUTPUT"` ever runs. This makes CI logs show only
"Process completed with exit code 1" with zero diagnostic info.

Fix by temporarily disabling `set -e` around the capture, saving
the exit code, always printing the output, then exiting with the
original code. Also emits a GitHub Actions `::error::` annotation
for better visibility in the workflow summary.

Applied to all five capture sites across the three workflow files:
- .github/workflows/releasekit-uv.yml (prepare + release)
- releasekit/github/workflows/releasekit-uv.yml (prepare + release)
- releasekit/github/workflows/releasekit-pnpm.yml (2x prepare + release)
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yesudeep, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue in CI workflows where set -euo pipefail caused shell scripts to exit prematurely on command failure, leading to a lack of diagnostic output. The changes implement a robust error handling mechanism by temporarily disabling set -e during command execution, capturing the output and exit code, and then re-enabling set -e to ensure the output is always printed and the job fails with proper context. This significantly improves the debuggability of releasekit prepare and release steps in CI.

Highlights

  • Improved CI Diagnostics: CI workflows now capture and display command output even when commands fail, preventing silent exits caused by set -e and providing better diagnostic information.
  • Enhanced Error Reporting: Added GitHub Actions ::error:: annotations for failed releasekit prepare and release steps, enhancing visibility in workflow summaries.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • py/tools/releasekit/github/workflows/releasekit-pnpm.yml
    • Updated prepare step to temporarily disable set -e, capture command output and exit code, print the output, and then exit with the captured code if non-zero, along with a GitHub Actions error annotation.
    • Updated release step to temporarily disable set -e, capture command output and exit code, print the output, and then exit with the captured code if non-zero, along with a GitHub Actions error annotation.
  • py/tools/releasekit/github/workflows/releasekit-uv.yml
    • Updated prepare step to temporarily disable set -e, capture command output and exit code, print the output, and then exit with the captured code if non-zero, along with a GitHub Actions error annotation.
    • Updated release step to temporarily disable set -e, capture command output and exit code, print the output, and then exit with the captured code if non-zero, along with a GitHub Actions error annotation.
  • releasekit.toml
    • Relocated the bootstrap_sha configuration for the Python workspace.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/releasekit-uv.yml
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an important issue in the CI workflows where command failures would cause the script to exit before printing diagnostic output, making debugging difficult. The proposed solution correctly captures and displays the output even on failure.

My review focuses on refining the implementation. The changes use set +e and set -e to temporarily disable error checking. I've suggested a more idiomatic approach using an || list, which is more localized and avoids modifying the global shell state. This is a minor refinement to an otherwise solid fix.

@yesudeep yesudeep enabled auto-merge (squash) February 14, 2026 00:39
@yesudeep yesudeep disabled auto-merge February 14, 2026 00:39
@yesudeep yesudeep enabled auto-merge (squash) February 14, 2026 00:39
@github-actions github-actions bot added docs Improvements or additions to documentation python Python config fix root labels Feb 14, 2026
Per reviewer feedback, the `|| EXIT_CODE=$?` idiom is more localized
than toggling global shell state with set +e / set -e. The `||` list
only fires on failure, and `${EXIT_CODE:-0}` gracefully defaults to
0 on success (when EXIT_CODE is unset).
@yesudeep yesudeep force-pushed the yesudeep/fix/releasekit-output-visibility branch from 163ac05 to d4b2b3e Compare February 14, 2026 00:43
@yesudeep yesudeep disabled auto-merge February 14, 2026 00:51
@yesudeep
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an important issue with CI visibility on command failures. The core change, which involves capturing command output and exit codes even when set -e is active, is well-implemented and consistently applied across all relevant workflow files. This will significantly improve diagnostics for failed CI runs. The pull request also includes several beneficial changes, such as adding timeouts to jobs and improving command portability by replacing grep -oP with sed. My review includes a suggestion to restore the collapsible log groups in the CI output, which were removed as part of the changes, to maintain log readability.

…ublish output capture

Addresses several reliability and portability issues found during audit:

1. Add timeout-minutes to all jobs (prepare: 10, release: 10, publish: 30,
   notify: 5) to prevent runaway jobs from burning runner minutes.

2. Replace grep -oP (GNU Perl regex) with portable sed for URL parsing.
   grep -P is not available on BSD/macOS grep — sed works everywhere.

3. Add output capture (|| EXIT_CODE=$?) to publish steps, matching the
   pattern already applied to prepare and release.

4. Use uv sync --no-dev for workspace install in publish jobs — dev
   dependencies are not needed for building and publishing.

5. Add comments documenting GITHUB_TOKEN scope limitation for cross-repo
   dispatch in notify jobs.

6. Add comments documenting inputs.skip_publish behavior on PR-merge
   events (undefined evaluates to empty string, which is != true).
@yesudeep yesudeep force-pushed the yesudeep/fix/releasekit-output-visibility branch from 8007c7a to a8c2f23 Compare February 14, 2026 01:01
@yesudeep
Copy link
Contributor Author

/gemini review

@yesudeep yesudeep requested a review from huangjeff5 February 14, 2026 01:01
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the reliability and debuggability of the releasekit CI workflows. By ensuring that command output is always visible even on failure, it will be much easier to diagnose issues in the CI environment. The changes are implemented consistently across all relevant jobs in both the pnpm and uv workflow files.

Key improvements:

  • Error Handling: The core change to capture command output and exit codes correctly when set -e is active is a robust solution to the problem of suppressed error messages.
  • Portability: Replacing grep -oP with a more portable sed and tail combination for parsing output is a good practice.
  • Robustness: Adding timeout-minutes to jobs prevents them from running indefinitely and consuming resources.
  • Consistency: The addition of set -euo pipefail to steps that were missing it improves script consistency and safety.

The changes are well-executed and a clear improvement to the CI process. I have no further suggestions.

@yesudeep yesudeep enabled auto-merge (squash) February 14, 2026 01:03
@yesudeep yesudeep merged commit a58c2f2 into main Feb 14, 2026
25 checks passed
@yesudeep yesudeep deleted the yesudeep/fix/releasekit-output-visibility branch February 14, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation fix python Python root

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants