Skip to content

fix: ChunkyPNG median filter bug + remove SVN support#169

Merged
pftg merged 3 commits into
masterfrom
fix/chunky-png-bug-and-ci-docs
Apr 12, 2026
Merged

fix: ChunkyPNG median filter bug + remove SVN support#169
pftg merged 3 commits into
masterfrom
fix/chunky-png-bug-and-ci-docs

Conversation

@pftg

@pftg pftg commented Apr 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ChunkyPNG bug: filter_image_with_median defined but raised NotImplementedError, making supports? return true incorrectly. Removed the method so supports? returns false naturally.
  • SVN removal: Delete 25 lines of SVN support code (pristine file lookup, svn info parsing). No Ruby projects use SVN since ~2015.

Test plan

  • Full suite with CI=true (204 runs, 0 failures)

🤖 Generated with Claude Code

Summary by Sourcery

Remove unused SVN support code and align the ChunkyPNG driver API by dropping an unimplemented median filter method.

Bug Fixes:

  • Ensure ChunkyPNG median filter support is not falsely advertised by removing the unimplemented filter method.

Enhancements:

  • Simplify VCS handling by assuming Git and deleting legacy SVN checkout logic.

The method existed but raised NotImplementedError, causing
supports?(:filter_image_with_median) to return true incorrectly.
Removing the method lets supports? return false naturally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Apr 12, 2026

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

Reviewer's Guide

Removes unused/incorrect features: drops SVN-based VCS support in favor of always using Git for screenshot diffs, and deletes an unimplemented median filter hook from the ChunkyPNG driver so capability detection reflects reality.

Sequence diagram for Git-only screenshot checkout flow

sequenceDiagram
  actor TestRunner
  participant ScreenshotDiff as ScreenshotDiff
  participant Vcs as Vcs
  participant Git as GitRepository

  TestRunner->>ScreenshotDiff: request_diff(old_screenshot, new_screenshot)
  ScreenshotDiff->>Vcs: checkout_vcs(project_root, screenshot_path, checkout_path)
  Vcs->>Git: restore_git_revision(screenshot_path, checkout_path, root)
  Git-->>Vcs: previous_version_copied
  Vcs-->>ScreenshotDiff: checkout_completed
  ScreenshotDiff-->>TestRunner: diff_result
Loading

Updated class diagram for Vcs and ChunkyPngDriver

classDiagram
  class Capybara_Screenshot_Diff_Vcs {
    <<module>>
    +String SILENCE_ERRORS
    +checkout_vcs(root, screenshot_path, checkout_path)
    +restore_git_revision(screenshot_path, checkout_path, root)
  }

  class Capybara_Screenshot_Diff_Drivers_ChunkyPngDriver {
    <<class>>
    +load_images(old_file_name, new_file_name)
    +add_black_box(image, region)
  }

  Capybara_Screenshot_Diff_Vcs <.. Capybara_Screenshot_Diff_Drivers_ChunkyPngDriver : used_by
Loading

File-Level Changes

Change Details Files
Always use Git for VCS checkout and remove dead SVN support code.
  • Simplified VCS checkout to unconditionally call the Git restore helper rather than branching on repository type.
  • Removed SVN detection based on presence of a .svn directory.
  • Deleted the SVN restore implementation that tried to locate pristine files via .svn/text-base, svn info, and .svn/pristine paths.
lib/capybara/screenshot/diff/vcs.rb
Remove unimplemented median filter hook from ChunkyPNG driver to fix incorrect capability reporting.
  • Deleted the filter_image_with_median method that only raised NotImplementedError, so median filter support is no longer advertised.
  • Left other driver behaviors (image loading, add_black_box, etc.) unchanged.
lib/capybara/screenshot/diff/drivers/chunky_png_driver.rb

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

@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@pftg has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 46 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 46 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1657165-be0d-4786-983a-4e4001d966dd

📥 Commits

Reviewing files that changed from the base of the PR and between b97f576 and bed7cd8.

📒 Files selected for processing (5)
  • lib/capybara/screenshot/diff/drivers/chunky_png_driver.rb
  • lib/capybara/screenshot/diff/vcs.rb
  • test/system_test_case.rb
  • test/unit/drivers/chunky_png_driver_test.rb
  • test/unit/vcs_test.rb
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/chunky-png-bug-and-ci-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai sourcery-ai Bot 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.

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.

@pftg pftg force-pushed the fix/chunky-png-bug-and-ci-docs branch from 0034187 to aa7b06d Compare April 12, 2026 02:50
No Ruby projects have used SVN since ~2015. Removes 25 lines of
dead code including svn info parsing and pristine file lookup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pftg pftg force-pushed the fix/chunky-png-bug-and-ci-docs branch from a65ec47 to 9294bd5 Compare April 12, 2026 02:53
Single method, no delegation. The SVN branch is gone so checkout_vcs
no longer needs to dispatch. Updated 3 callers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pftg pftg merged commit 9a4309c into master Apr 12, 2026
7 checks passed
@pftg pftg deleted the fix/chunky-png-bug-and-ci-docs branch April 12, 2026 02:59
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