Skip to content

docs: Non-Rails setup, GitHub Actions integration, animation tip#168

Merged
pftg merged 1 commit into
masterfrom
docs/non-rails-and-ci-integration
Apr 12, 2026
Merged

docs: Non-Rails setup, GitHub Actions integration, animation tip#168
pftg merged 1 commit into
masterfrom
docs/non-rails-and-ci-integration

Conversation

@pftg

@pftg pftg commented Apr 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • P2.3: Document Non-Rails usage (Hugo/Jekyll/static sites) with Rack app setup
  • P3.4: GitHub Actions workflow example for uploading HTML report as artifact
  • P2.4: Document Capybara.disable_animation = true in Troubleshooting (no code change — Capybara already has it)

Test plan

  • Docs only — no code changes
  • Unit tests pass (175 runs, 0 failures)

🤖 Generated with Claude Code

Summary by Sourcery

Document additional usage patterns and CI integration for capybara-screenshot-diff, and expand troubleshooting guidance for flaky diffs.

Documentation:

  • Add setup instructions for using capybara-screenshot-diff with non-Rails Rack-based and static sites, including Hugo and Jekyll.
  • Document a GitHub Actions workflow example for uploading the HTML screenshot diff report as a CI artifact.
  • Clarify troubleshooting guidance for animation-related flaky diffs, including use of Capybara.disable_animation and stability_time_limit.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for using the library outside Rails with Capybara configuration examples
    • Included GitHub Actions workflow example for test execution and artifact uploads
    • Simplified HTML report activation instructions
    • Enhanced animation troubleshooting with updated recommendations for CSS and JavaScript animations

@sourcery-ai

sourcery-ai Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the README to document non-Rails/static-site usage via a Rack app, add a GitHub Actions example for uploading the HTML screenshot diff report as an artifact, and expand troubleshooting guidance for flaky diffs by recommending Capybara.disable_animation and clarifying stability_time_limit usage.

Flow diagram for non-Rails Rack static site Capybara setup

flowchart TD
  A["Developer configures Gemfile\ncapybara-screenshot-diff, rack, puma"] --> B["Configure Capybara in test_helper"]
  B --> C["Capybara.app set to Rack::Builder\nRack::Static serves from public or _site"]
  C --> D["Run tests (Minitest)"]
  D --> E["Capybara requests pages via Rack app"]
  E --> F["Screenshots captured by capybara-screenshot-diff"]
  F --> G["Screenshots stored under\nCapybara::Screenshot.root / save_path"]
Loading

File-Level Changes

Change Details Files
Document non-Rails/static-site usage using a minimal Rack app configuration for Capybara and screenshot storage.
  • Describe that the gem works with generic Rack apps, not only Rails, including static sites like Hugo/Jekyll.
  • Provide Gemfile dependencies and a sample Capybara/Rack setup that serves static content from the public directory.
  • Show an alternate Rack::Static configuration for sites with a build step (e.g., Jekyll output in _site).
README.md
Add GitHub Actions workflow example for publishing the HTML screenshot diff report as a CI artifact.
  • Introduce a YAML snippet illustrating a test job step followed by an upload-artifact step conditioned on failure().
  • Specify artifact name, report directory path, and retention-days for screenshot diff reports.
  • Document that enabling the HTML report requires requiring capybara_screenshot_diff/reporters/html in the test helper.
README.md
Clarify troubleshooting guidance for flaky diffs caused by animations by recommending Capybara.disable_animation and refining stability_time_limit usage.
  • Change the existing advice about animations to prefer Capybara.disable_animation = true as a global setting in the test helper for CSS animations.
  • Retain and reframe stability_time_limit: 1 as specifically useful for JS animations, explaining that the gem compares multiple screenshots until two consecutive ones match.
README.md

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 21 minutes and 40 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 21 minutes and 40 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: 54e0f374-150f-4693-bf86-93f6a4734ed2

📥 Commits

Reviewing files that changed from the base of the PR and between 53956bb and 3877f39.

📒 Files selected for processing (3)
  • README.md
  • lib/capybara_screenshot_diff/static.rb
  • test/unit/static_test.rb
📝 Walkthrough

Walkthrough

Updated README.md with comprehensive documentation covering Capybara setup outside Rails environments, GitHub Actions integration for test workflows, clarified HTML reporter activation, and improved animation troubleshooting guidance replacing stability-based approach with CSS animation disabling recommendations.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md
Added sections for non-Rails Rack setup with Capybara.app and path configuration examples; included GitHub Actions workflow steps with artifact upload on failure; clarified HTML reporter requirement statement; updated animation troubleshooting to recommend Capybara.disable_animation = true for CSS animations alongside stability_time_limit: 1 guidance for JS animations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • PR #164: Directly referenced in the README clarification showing the require 'capybara_screenshot_diff/reporters/html' statement for HTML reporter activation, which implements the feature being documented.
  • PR #138: Related to GitHub Actions artifact upload behavior for snapshot/screenshot outputs; both PRs address CI/CD workflow documentation and artifact handling patterns.

Poem

🐰 A rabbit hops through Rails and beyond,
With screenshots clear, a bond so fond,
No more fuzzy diffs, animations tamed,
GitHub Actions blessed, the workflow's framed,
Documentation blooms—our testing's grand!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title concisely and accurately summarizes the three main documentation additions: non-Rails setup guidance, GitHub Actions integration example, and animation troubleshooting tip.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/non-rails-and-ci-integration

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 left some high level feedback:

  • In the Rack example for static sites, consider using a more conventional urls setting (e.g. urls: ["/"]) instead of an empty string array to avoid surprising routing behavior with Rack::Static.
  • The Hugo/Jekyll example currently comments # Jekyll output while mentioning Hugo in the heading; it may be clearer to either split out separate examples or note the default output directory for each (e.g. _site for Jekyll, public for Hugo).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the Rack example for static sites, consider using a more conventional `urls` setting (e.g. `urls: ["/"]`) instead of an empty string array to avoid surprising routing behavior with `Rack::Static`.
- The Hugo/Jekyll example currently comments `# Jekyll output` while mentioning Hugo in the heading; it may be clearer to either split out separate examples or note the default output directory for each (e.g. `_site` for Jekyll, `public` for Hugo).

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 docs/non-rails-and-ci-integration branch from 53956bb to fc2419a Compare April 12, 2026 02:40
- Non-Rails section: Rack-based setup for Hugo/Jekyll/static sites
- GitHub Actions: upload HTML report as artifact on failure
- Troubleshooting: mention Capybara.disable_animation for CSS animations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pftg pftg force-pushed the docs/non-rails-and-ci-integration branch from fc2419a to 3877f39 Compare April 12, 2026 02:41
@pftg pftg merged commit b97f576 into master Apr 12, 2026
7 checks passed
@pftg pftg deleted the docs/non-rails-and-ci-integration branch April 12, 2026 02:44
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