Skip to content

. e print TCR output on failure#267

Merged
JayBazuzi merged 2 commits into
approvals:mainfrom
JayBazuzi:main
Jul 16, 2026
Merged

. e print TCR output on failure#267
JayBazuzi merged 2 commits into
approvals:mainfrom
JayBazuzi:main

Conversation

@JayBazuzi

@JayBazuzi JayBazuzi commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Extract TCR subprocess output printing into a reusable helper and ensure TCR results are printed whenever a commit or revert fails.

Enhancements:

  • Refactor subprocess output printing into a dedicated helper function used by failure paths.
  • Extend TCR loop to print stdout and stderr when TCR reverts, improving debugging visibility.

devin-ai-integration Bot and others added 2 commits July 16, 2026 01:47
Co-Authored-By: Jay Bazuzi <jay@bazuzi.com>
@sourcery-ai

sourcery-ai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors duplicated subprocess output printing into a helper and ensures TCR command output is printed on failure as well as on script failures.

Sequence diagram for subprocess failure output printing refactor

sequenceDiagram
    actor Developer
    participant ai_fixer_loop
    participant subprocess
    participant _print_output

    Developer->>ai_fixer_loop: run_script(script_path, display_name)
    ai_fixer_loop->>subprocess: run(script_path)
    subprocess-->>ai_fixer_loop: CompletedProcess result
    ai_fixer_loop->>ai_fixer_loop: [result.returncode != 0]
    ai_fixer_loop->>_print_output: _print_output(result)
    _print_output->>_print_output: print stdout / stderr

    Developer->>ai_fixer_loop: main()
    ai_fixer_loop->>subprocess: run(tcr_command)
    subprocess-->>ai_fixer_loop: tcr_result
    ai_fixer_loop->>ai_fixer_loop: [tcr_result.returncode != 0]
    ai_fixer_loop->>_print_output: _print_output(tcr_result)
    _print_output->>_print_output: print stdout / stderr
Loading

File-Level Changes

Change Details Files
Extracted subprocess output printing into a reusable helper function and used it in the script runner failure path.
  • Introduced a private helper that prints stdout and stderr of a CompletedProcess if present.
  • Replaced inline stdout/stderr printing in the script failure branch with calls to the new helper.
internal_documentation/scripts/ai_fixer_loop.py
Ensured TCR command output is printed when TCR reverts, improving debuggability for failures.
  • Added a call to the new output-printing helper when the TCR run results in a revert/failure.
  • Left success path unchanged while enhancing logging only on failure.
internal_documentation/scripts/ai_fixer_loop.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@JayBazuzi JayBazuzi merged commit a180f5b into approvals:main Jul 16, 2026
31 checks passed
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