Skip to content

chore: preserve and log full error backtraces in generate-updates - #27556

Open
torreypayne wants to merge 2 commits into
mainfrom
fix/generate-updates-logging
Open

chore: preserve and log full error backtraces in generate-updates#27556
torreypayne wants to merge 2 commits into
mainfrom
fix/generate-updates-logging

Conversation

@torreypayne

@torreypayne torreypayne commented Aug 5, 2026

Copy link
Copy Markdown
Member

Part of stack to address b/542740217 (Apiary library generation errors preventing releases)

See bug for artifacts showing validation of the error output

Summary

When toys generate-updates encounters an error generating a gem (e.g. bin/generate-api exits non-zero), the exit code and error backtraces were not captured or printed in the final summary output.

Fix

  1. Updated regen_single_gem and clean_old_gems in .toys/generate-updates.rb to capture stdout and stderr stream output via out: [:capture, :inherit], err: [:capture, :inherit].
  2. When generation fails, the error details and exit code are logged immediately and stored in @errors.
  3. Updated the end-of-run summary in generate-updates.rb to print full error messages and backtraces for all failed gems.
  4. Passed through --verbose to bin/generate-api if Toys verbosity is enabled (verbosity > 0).

@torreypayne
torreypayne requested a review from a team as a code owner August 5, 2026 20:50
@torreypayne
torreypayne marked this pull request as draft August 5, 2026 20:54
@torreypayne
torreypayne marked this pull request as ready for review August 6, 2026 18:32

@aandreassa aandreassa 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.

Please change it to chore since it doesn't affect clients.

Make sure to double check the commit message before you merge too (since it was originally pushed as a fix commit and that differs from the title).

Comment thread .toys/generate-updates.rb Outdated
@torreypayne
torreypayne force-pushed the fix/generate-updates-logging branch from da02fc0 to 3d5e146 Compare August 6, 2026 21:53
@torreypayne torreypayne changed the title fix: preserve and log full error backtraces in generate-updates chore: preserve and log full error backtraces in generate-updates Aug 6, 2026
@torreypayne
torreypayne force-pushed the fix/generate-updates-logging branch from 6fa1b44 to a13eae5 Compare August 7, 2026 04:33
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