Skip to content

workflow(release): surface subprocess output and improve error handling in backport operations - #4056

Merged
rickeylev merged 6 commits into
bazel-contrib:mainfrom
rickeylev:debug_backport_changelog_errors
Aug 15, 2026
Merged

workflow(release): surface subprocess output and improve error handling in backport operations#4056
rickeylev merged 6 commits into
bazel-contrib:mainfrom
rickeylev:debug_backport_changelog_errors

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

When backporting changes or creating pull requests during release
automation, subprocess errors frequently hid command failure details
because stdout and stderr were not captured in the raised exceptions.
Additionally, process logging relied on raw print statements and
cleanup operations lacked diagnostic logs.

To improve debuggability and observability:

  • Capture and surface stdout and stderr in backport errors and
    CreatePrError exceptions when PR creation fails.
  • Transition print calls to standard logging in backport processing.
  • Log cleanup actions explicitly within the changelog sync finally
    block.

Subprocess failures during `process-backports` swallowed stderr and stdout details because top-level error handling only printed the exception message without notes or traceback. Print tracebacks on unexpected errors and add a `format_exception` helper to include attached PEP 678 notes.
Release operations rely on structured logs for diagnostics and debugging.
Configure logging to stderr with line numbers in the release CLI entry point
and replace print calls in process_backports with logger methods.
Branch checkouts and resets during error handling or dry runs in sync
changelog were unlogged. Add info logging for resetting main and
restoring the release branch.
…failure

Define a custom CreatePrError exception raised when GitHub PR creation fails,
capturing the command, error details, and formatted stdout/stderr blocks.
@rickeylev
rickeylev marked this pull request as ready for review August 15, 2026 18:16
@rickeylev
rickeylev requested a review from aignas as a code owner August 15, 2026 18:16
@rickeylev
rickeylev enabled auto-merge August 15, 2026 18:16
Ensure runfiles.Create() result is not None before accessing Rlocation,
resolving Pyrefly type checking errors in CI.
@rickeylev
rickeylev merged commit ade3edf into bazel-contrib:main Aug 15, 2026
5 checks passed
@rickeylev
rickeylev deleted the debug_backport_changelog_errors branch August 15, 2026 19:35
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.

1 participant