Skip to content

- B Fix MultiReporter.report returning None instead of bool - #296

Merged
JayBazuzi merged 5 commits into
mainfrom
copilot/fix-multireporter-report-return-value
Dec 1, 2026
Merged

JayBazuzi merged 5 commits into
mainfrom
copilot/fix-multireporter-report-return-value

Conversation

@JayBazuzi

@JayBazuzi JayBazuzi commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

MultiReporter.report is annotated -> bool but had no return, so it always returned None. FirstWorkingReporter treats that as "not working". With ReportOnCyberDojo (which wraps a MultiReporter) as the default reporter, a failing verify() raised ReporterNotWorkingException instead of ApprovalException, after the diff had already been reported.

MultiReporter(Works()).report("r.received.txt", "r.approved.txt")  # was None, now True
  • multi_reporter.py: report now returns any([...]) over the child reporters' results. A list, not a generator, is used deliberately so every reporter still runs and none are short-circuited after the first success.
  • tests/reporters/test_multi_reporter.py: new regression test covering the case above.

Co-author: Claude

Summary by Sourcery

Return an accurate success result from MultiReporter.report while continuing to run all child reporters.

Bug Fixes:

  • Make MultiReporter.report return whether any child reporter reports successfully, preventing callers from treating a successful report as a failure.

Tests:

  • Add a regression test verifying MultiReporter.report returns True when a child reporter succeeds.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@JayBazuzi JayBazuzi changed the title [WIP] Fix MultiReporter.report to return a boolean value Fix MultiReporter.report returning None instead of bool Dec 1, 2026
@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Make MultiReporter.report return whether any child reporter succeeds while still invoking every child reporter.

  • approvaltests/reporters/multi_reporter.py L20-24

Remove the now-unnecessary mypy suppression for MultiReporter's return type.

  • mypy.ini L105 (removed lines)

Tests

Add a regression test confirming that MultiReporter.report returns True when a child reporter succeeds.

  • tests/reporters/test_multi_reporter.py L1-14

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

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@JayBazuzi
JayBazuzi marked this pull request as ready for review December 1, 2026 19:41
@JayBazuzi JayBazuzi changed the title Fix MultiReporter.report returning None instead of bool - B Fix MultiReporter.report returning None instead of bool Dec 1, 2026
@JayBazuzi
JayBazuzi merged commit 27210ad into main Dec 1, 2026
55 of 63 checks passed
@JayBazuzi
JayBazuzi deleted the copilot/fix-multireporter-report-return-value branch December 1, 2026 19:43
@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit b40249a

#295 MultiReporter.report returns None, so ReportOnCyberDojo raises ReporterNotWorkingException · 1 of 1 met

# Requirement Status Notes
1 Make MultiReporter.report return whether any child reporter succeeded, so ReportOnCyberDojo is recognized as working. ✅ Met The implementation collects every child result and returns any(results), so it returns a bool and still runs all reporters.

@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 assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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.

MultiReporter.report returns None, so ReportOnCyberDojo raises ReporterNotWorkingException

2 participants