feat: GitHub Actions artifact integration with inline HTML report#171
feat: GitHub Actions artifact integration with inline HTML report#171
Conversation
Reviewer's GuideAdds first-class GitHub Actions support for the HTML screenshot diff report, including inline artifact rendering, full downloadable report, reusable composite action improvements, and an optional PR comment with a stable link to the report. Sequence diagram for GitHub Actions failure handling and screenshot report artifactssequenceDiagram
actor Developer
participant GitHubActions
participant TestJob
participant UploadScreenshotsAction
participant UploadArtifact
participant FindCommentAction
participant CreateOrUpdateCommentAction
participant GitHubPR
Developer->>GitHubActions: Push changes / open pull request
GitHubActions->>TestJob: Run tests with HTML reporter enabled
TestJob-->>GitHubActions: Test status failure
GitHubActions->>UploadScreenshotsAction: Run upload SnapDiff screenshots (if failure)
UploadScreenshotsAction->>UploadArtifact: Upload name-diffs (screenshot diffs)
UploadScreenshotsAction->>UploadArtifact: Upload name-capybara-fails
UploadScreenshotsAction->>UploadArtifact: Upload name-report (index.html, archive false)
UploadScreenshotsAction->>UploadArtifact: Upload name-report-full (full HTML report directory)
UploadArtifact-->>GitHubActions: Artifacts available in run
GitHubActions->>FindCommentAction: find-comment (on pull_request failure)
FindCommentAction-->>GitHubActions: Existing comment id or empty
GitHubActions->>CreateOrUpdateCommentAction: create-or-update-comment with artifacts link
CreateOrUpdateCommentAction->>GitHubPR: Create or replace PR comment with stable report link
Developer->>GitHubPR: Open PR and follow report link
Developer->>GitHubActions: Open run artifacts to view inline or full report
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUpdates GitHub Actions and a composite upload action to conditionally upload SnapDiff HTML reports and artifacts with configurable report path and retention; adds PR comment lifecycle for screenshot diffs; expands workflow triggers/permissions; adds many docs pages; and makes small VCS/test and reporter return-value adjustments. Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as CI Runner
participant UploadAction as Upload Action (composite)
participant ArtifactStore as GitHub Artifacts
participant GitHubAPI as GitHub PR API
Runner->>UploadAction: invoke (inputs: report-path, retention-days) after tests
UploadAction->>UploadAction: check `${{ inputs.report-path }}/index.html` exists
alt index.html exists
UploadAction->>ArtifactStore: upload `index.html` (archive:false, retention: ${{ inputs.retention-days }})
end
UploadAction->>ArtifactStore: upload full `${{ inputs.report-path }}/` (retention: ${{ inputs.retention-days }})
Runner->>GitHubAPI: search for PR comment containing "Screenshot diffs"
GitHubAPI-->>Runner: return comment id (found / not found)
Runner->>GitHubAPI: create or update PR comment linking to artifacts (detected / resolved)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The PR comment logic for screenshot reports is duplicated between the README example and
.github/workflows/test.yml; consider extracting this into a small reusable composite/action or a single reusable workflow snippet to avoid drift and make future changes easier. - In the composite action, both report upload steps gate on
hashFiles(format('{0}/index.html', inputs.report-path)) != ''; if you expect non-standard report layouts in future, you may want to key this check off the directory itself or make the report filename configurable to avoid tightly coupling toindex.html.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The PR comment logic for screenshot reports is duplicated between the README example and `.github/workflows/test.yml`; consider extracting this into a small reusable composite/action or a single reusable workflow snippet to avoid drift and make future changes easier.
- In the composite action, both report upload steps gate on `hashFiles(format('{0}/index.html', inputs.report-path)) != ''`; if you expect non-standard report layouts in future, you may want to key this check off the directory itself or make the report filename configurable to avoid tightly coupling to `index.html`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
eb0913c to
081bbbf
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/actions/upload-screenshots/action.yml (1)
17-30: Addif-no-files-foundhandling for non-screenshot failures.If tests fail before screenshot generation, Line 22 and Line 29 paths may be absent and produce noisy artifact warnings. Consider making these uploads explicitly tolerant.
♻️ Suggested patch
- name: Upload screenshot diffs uses: actions/upload-artifact@v7 with: name: ${{ inputs.name }}-diffs retention-days: ${{ inputs.retention-days }} path: test/fixtures/app/doc/screenshots/ + if-no-files-found: ignore - name: Upload Capybara failure screenshots uses: actions/upload-artifact@v7 with: name: ${{ inputs.name }}-capybara-fails retention-days: ${{ inputs.retention-days }} path: tmp/capybara/screenshots-diffs/ + if-no-files-found: ignore🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/upload-screenshots/action.yml around lines 17 - 30, The artifact upload steps "Upload screenshot diffs" and "Upload Capybara failure screenshots" currently emit warnings when the specified paths are missing; update each actions/upload-artifact@v7 usage in the action.yml (the steps named "Upload screenshot diffs" and "Upload Capybara failure screenshots") to include the with key if-no-files-found: ignore so these uploads tolerate absent paths (add the if-no-files-found: ignore entry under the existing with block for both steps).README.md (1)
890-900: Consider naming the two artifact labels in the PR comment snippet.Adding the exact artifact names reduces ambiguity for first-time users following the README.
📝 Suggested wording tweak
body: | ### Screenshot diffs detected [View report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts) + Click `screenshot-report` for inline preview, or download `screenshot-report-full` for images.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 890 - 900, Update the PR comment body used by the "Comment PR with report link" step (uses: peter-evans/create-or-update-comment@v5) to explicitly name the two artifacts when constructing the report links; modify the multi-line body under the body: | block so the markdown lists the artifact names (e.g., "Screenshot diffs report" and "Full artifacts archive") and uses those labels in the links instead of a generic "View report" to remove ambiguity for first-time users.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/actions/upload-screenshots/action.yml:
- Around line 17-30: The artifact upload steps "Upload screenshot diffs" and
"Upload Capybara failure screenshots" currently emit warnings when the specified
paths are missing; update each actions/upload-artifact@v7 usage in the
action.yml (the steps named "Upload screenshot diffs" and "Upload Capybara
failure screenshots") to include the with key if-no-files-found: ignore so these
uploads tolerate absent paths (add the if-no-files-found: ignore entry under the
existing with block for both steps).
In `@README.md`:
- Around line 890-900: Update the PR comment body used by the "Comment PR with
report link" step (uses: peter-evans/create-or-update-comment@v5) to explicitly
name the two artifacts when constructing the report links; modify the multi-line
body under the body: | block so the markdown lists the artifact names (e.g.,
"Screenshot diffs report" and "Full artifacts archive") and uses those labels in
the links instead of a generic "View report" to remove ambiguity for first-time
users.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f23b869e-6cb0-4a0b-a32e-c232b1606753
📒 Files selected for processing (3)
.github/actions/upload-screenshots/action.yml.github/workflows/test.ymlREADME.md
081bbbf to
a56e392
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/test.yml (1)
95-100: Avoid hardcoded artifact names in the PR message (and fix Line 98 length warning).The message assumes
base-screenshots-*; if the upload prefix changes, the instructions become stale. Recommend centralizing the prefix in one variable and reusing it in both upload and comment text.Proposed refactor
functional-test: name: Functional Test runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: read pull-requests: write + env: + SCREENSHOT_ARTIFACT_PREFIX: base-screenshots @@ - uses: ./.github/actions/upload-screenshots if: failure() with: - name: base-screenshots + name: ${{ env.SCREENSHOT_ARTIFACT_PREFIX }} @@ - name: Comment PR with report link if: failure() && github.event_name == 'pull_request' uses: peter-evans/create-or-update-comment@v5 with: @@ body: | ### Screenshot diffs detected - [View HTML report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts) in Actions artifacts. + [View HTML report]( + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts + ) in Actions artifacts. - Click `base-screenshots-report` for inline preview, or download `base-screenshots-report-full` for images. + Click `${{ env.SCREENSHOT_ARTIFACT_PREFIX }}-report` for inline preview, or download `${{ env.SCREENSHOT_ARTIFACT_PREFIX }}-report-full` for images.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/test.yml around lines 95 - 100, Centralize the artifact upload prefix into a single variable/output and reference that variable in the comment body instead of hardcoding "base-screenshots-report" and "base-screenshots-report-full"; update the upload step (e.g., the step that creates the artifacts) to set an output or env like screenshots_prefix and then interpolate that variable into the workflow job comment body where the artifacts are referenced, and shorten or wrap the comment line that includes the artifact link to resolve the line-length warning (the multi-line YAML string for body should reference the variable and be reformatted to keep lines under the limit).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/actions/upload-screenshots/action.yml:
- Around line 31-35: The step with name "Check for HTML report" and id
check-report uses a chained &&/|| shell command that can produce incorrect
outputs; replace the single-line test with a short explicit if/then/else block
in the run script that tests for the file ("${{ inputs.report-path
}}/index.html") and writes "exists=true" or "exists=false" to $GITHUB_OUTPUT
accordingly (using echo "exists=..." >> "$GITHUB_OUTPUT"), ensuring each branch
is its own command and the line length is short.
---
Nitpick comments:
In @.github/workflows/test.yml:
- Around line 95-100: Centralize the artifact upload prefix into a single
variable/output and reference that variable in the comment body instead of
hardcoding "base-screenshots-report" and "base-screenshots-report-full"; update
the upload step (e.g., the step that creates the artifacts) to set an output or
env like screenshots_prefix and then interpolate that variable into the workflow
job comment body where the artifacts are referenced, and shorten or wrap the
comment line that includes the artifact link to resolve the line-length warning
(the multi-line YAML string for body should reference the variable and be
reformatted to keep lines under the limit).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c71b16eb-d1ca-43c1-81e0-aff40d7d5250
📒 Files selected for processing (3)
.github/actions/upload-screenshots/action.yml.github/workflows/test.ymlREADME.md
✅ Files skipped from review due to trivial changes (1)
- README.md
Screenshot diffs resolvedAll screenshots match their baselines. Previous diffs have been fixed. |
aa885f5 to
86e0468
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (1)
.github/actions/upload-screenshots/action.yml (1)
33-37:⚠️ Potential issue | 🟡 MinorReplace chained
&& ... || ...with explicitif/else.This pattern is brittle and was already flagged earlier; it can emit the wrong output if the “true branch” command fails.
Proposed fix
- - name: Check for HTML report - id: check-report - shell: bash - run: test -f "${{ inputs.report-path }}/index.html" && echo "exists=true" >> "$GITHUB_OUTPUT" || echo "exists=false" >> "$GITHUB_OUTPUT" + - name: Check for HTML report + id: check-report + shell: bash + run: | + if test -f "${{ inputs.report-path }}/index.html"; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + fi#!/bin/bash set -euo pipefail # Demonstrates &&/|| hazard: condition is true, but a failing true-branch command # still triggers the false branch. tmp="$(mktemp)" bash -c 'test -f /etc/passwd && { false; } || echo "exists=false" >> "$1"' _ "$tmp" echo "Observed output:" cat "$tmp" rm -f "$tmp" # Inspect current workflow line rg -n 'run:\s*test -f .*&&.*\|\|.*' .github/actions/upload-screenshots/action.yml🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/upload-screenshots/action.yml around lines 33 - 37, The step named "Check for HTML report" (id: check-report) uses a brittle chained `test ... && ... || ...` pattern; replace its run script with an explicit if/else block that tests for the file and writes the appropriate value to $GITHUB_OUTPUT, e.g. use `if [ -f "${{ inputs.report-path }}/index.html" ]; then echo "exists=true" >> "$GITHUB_OUTPUT"; else echo "exists=false" >> "$GITHUB_OUTPUT"; fi`; keep `shell: bash` and consider adding `set -euo pipefail` at the top of the script for strictness.
🧹 Nitpick comments (1)
docs/organization.md (1)
23-29: Fix markdownlint issues in code blocks.Add language identifiers to fenced blocks (e.g.,
text) and convert the indented code block at Line 34 into fenced style to satisfy MD040/MD046.Also applies to: 34-34, 56-63, 93-100, 157-170, 185-198
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/organization.md` around lines 23 - 29, Convert the indented code block showing the site tree (the block starting with ``` and containing "doc screenshots action_performed feature_index welcome_index") into a fenced code block with a language identifier (use "text"), and similarly add language identifiers ("text") to the other fenced blocks referenced (the blocks at the other locations containing similar directory/tree listings). Ensure all formerly indented blocks are replaced with triple-backtick fenced blocks and each fenced block begins with ```text to satisfy MD040/MD046.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/test.yml:
- Line 16: In the GitHub Actions workflow (.github/workflows/test.yml) the
pull_request trigger uses the invalid key "type" instead of "types"; update the
trigger key name from "type" to "types" and keep the array of event types
(opened, synchronize, reopened, review_requested) so the pull_request event
filtering works correctly.
In `@docs/configuration.md`:
- Around line 80-84: The example assigns ENV['TAKE_SCREENSHOTS'] directly to
Capybara::Screenshot.enabled which treats any non-empty string (including
"false" or "0") as truthy; change to parse the environment value to a real
boolean before assignment (e.g., use a boolean casting helper or normalize and
check against allowed true values) so Capybara::Screenshot.enabled only becomes
true for explicit truthy strings; apply the same fix to the analogous diffs
example referenced around lines 94–98.
In `@docs/organization.md`:
- Around line 60-63: Update the sequence filename examples to use an underscore
after the numeric counter to match the formatter `%02i_%s`; replace entries like
"00-welcome_index", "98-99" style examples and similar occurrences with
"00_welcome_index" (and analogous fixes for the examples around lines referenced
such as 98–99, 162–164, 190–192, 196–197) so all sample filenames follow the
"NN_name" pattern (e.g., 00_welcome_index, 01_feature_index,
02_action_performed).
- Around line 65-66: The docs incorrectly state that screenshot_group deletes
files; update the documentation to say that screenshot_group only sets the group
name (the method screenshot_group in lib/capybara_screenshot_diff/dsl.rb) and
does not perform deletion, and either (a) document the separate deletion
behavior provided by the deletion method in
lib/capybara_screenshot_diff/screenshot_namer.rb (the method that actually
removes files) or (b) change the implementation to call that deletion method
from screenshot_group if automatic deletion is intended—adjust the docs
accordingly to reflect the actual behavior.
In `@README.md`:
- Around line 51-54: The fenced code block containing the screenshot mismatch
message for 'homepage' is missing a language tag; update that fenced block (the
triple-backtick block showing "Screenshot does not match for 'homepage':
({"area_size":1250,...})") to include a language such as text (change ``` to
```text) so markdownlint MD040 is satisfied.
---
Duplicate comments:
In @.github/actions/upload-screenshots/action.yml:
- Around line 33-37: The step named "Check for HTML report" (id: check-report)
uses a brittle chained `test ... && ... || ...` pattern; replace its run script
with an explicit if/else block that tests for the file and writes the
appropriate value to $GITHUB_OUTPUT, e.g. use `if [ -f "${{ inputs.report-path
}}/index.html" ]; then echo "exists=true" >> "$GITHUB_OUTPUT"; else echo
"exists=false" >> "$GITHUB_OUTPUT"; fi`; keep `shell: bash` and consider adding
`set -euo pipefail` at the top of the script for strictness.
---
Nitpick comments:
In `@docs/organization.md`:
- Around line 23-29: Convert the indented code block showing the site tree (the
block starting with ``` and containing "doc screenshots action_performed
feature_index welcome_index") into a fenced code block with a language
identifier (use "text"), and similarly add language identifiers ("text") to the
other fenced blocks referenced (the blocks at the other locations containing
similar directory/tree listings). Ensure all formerly indented blocks are
replaced with triple-backtick fenced blocks and each fenced block begins with
```text to satisfy MD040/MD046.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d00420ef-b462-4ed5-acef-7a907e2e2297
📒 Files selected for processing (10)
.github/actions/upload-screenshots/action.yml.github/workflows/test.ymlREADME.mddocs/ci-integration.mddocs/configuration.mddocs/docker-testing.mddocs/drivers.mddocs/framework-setup.mddocs/organization.mddocs/reporters.md
✅ Files skipped from review due to trivial changes (5)
- docs/docker-testing.md
- docs/framework-setup.md
- docs/reporters.md
- docs/drivers.md
- docs/ci-integration.md
4bbb450 to
a08ee63
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/configuration.md`:
- Line 218: Replace the misspelled metric name "eucledian" with the correct
spelling "euclidean" in the documentation sentence that currently reads "The
difference is calculated as the eucledian distance. You can also set this
globally:"—search for the literal token "eucledian" and update it to "euclidean"
so the distance metric name is spelled correctly.
- Around line 274-290: The DSL docs incorrectly describe the `crop` and
`skip_area` tuples as `[x, y, width, height]`; change the wording in
lib/capybara_screenshot_diff/dsl.rb (around the current lines 41–42) to state
they are edge coordinates in `[left, top, right, bottom]` (matching
Region.from_edge_coordinates and area_calculator.rb), and update any example and
explanatory text for both `crop` and `skip_area` to use the edge-coordinate
terminology and format so the DSL docs align with the implementation.
In `@lib/capybara/screenshot/diff/vcs.rb`:
- Around line 12-13: git_root is being resolved outside the method's
Dir.chdir(root) and uses a hardcoded "2>/dev/null" redirection; change
resolution to run git rev-parse inside the repository root and avoid shell
redirection so SILENCE_ERRORS can control error output. Specifically, inside the
block that uses root (the same scope that will later compute vcs_file_path from
screenshot_path), run the git command from that directory (e.g., via
Dir.chdir(root) { ... } or an equivalent) and capture stderr in a cross-platform
way (Open3.capture3 or similar) so you can conditionally suppress or log errors
based on SILENCE_ERRORS; then build git_root from the captured stdout and
compute vcs_file_path relative to that git_root.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: df29f756-ee88-493c-9918-ccb73b0e3612
📒 Files selected for processing (14)
.github/actions/upload-screenshots/action.yml.github/workflows/test.yml.gitignoreREADME.mddocs/ci-integration.mddocs/configuration.mddocs/docker-testing.mddocs/drivers.mddocs/framework-setup.mddocs/organization.mddocs/reporters.mdlib/capybara/screenshot/diff/vcs.rbscripts/generate_sample_report.rbtest/unit/vcs_test.rb
✅ Files skipped from review due to trivial changes (8)
- .gitignore
- scripts/generate_sample_report.rb
- docs/docker-testing.md
- docs/reporters.md
- docs/drivers.md
- docs/framework-setup.md
- README.md
- docs/ci-integration.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/actions/upload-screenshots/action.yml
5934456 to
b6382aa
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/configuration.md (1)
233-233: Update test name to match the section context.The test is in the "Allowed shift distance" section but is named
'color threshold'. For consistency and clarity, it should be named'shift threshold'.📝 Proposed fix
-test 'color threshold' do +test 'shift threshold' do🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/configuration.md` at line 233, The test name string is incorrect for the "Allowed shift distance" section—rename the test declaration test 'color threshold' do to test 'shift threshold' do so the test name matches the section context; update the test declaration (the test 'color threshold' do block) to use 'shift threshold' without changing the test body or assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/configuration.md`:
- Line 227: Replace the misspelled library name "jquer-tablesorter" with the
correct "jquery-tablesorter" in the docs content (look for the string
"jquer-tablesorter" in the text around the example about allowing small
movements in images) so the documentation references the proper library name.
In `@lib/capybara_screenshot_diff/reporters/html.rb`:
- Around line 99-110: The at_exit registration is currently placed inside the
guard that only adds a new CapybaraScreenshotDiff::Reporters::HTML when none
exists, so if an HTML reporter is already registered the at_exit block never
gets installed; move the at_exit block out of the unless block so it always
registers regardless of whether CapybaraScreenshotDiff::Reporters::HTML was
newly appended, keeping the logic that iterates
CapybaraScreenshotDiff.reporters, calls reporter.finalize, prints the Pathname
result via $stdout.puts and rescues/logs failures (warn ...) unchanged and still
referencing CapybaraScreenshotDiff.reporters and
CapybaraScreenshotDiff::Reporters::HTML.
---
Nitpick comments:
In `@docs/configuration.md`:
- Line 233: The test name string is incorrect for the "Allowed shift distance"
section—rename the test declaration test 'color threshold' do to test 'shift
threshold' do so the test name matches the section context; update the test
declaration (the test 'color threshold' do block) to use 'shift threshold'
without changing the test body or assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7c6a0722-1ace-4955-916a-d45baed11c6e
📒 Files selected for processing (16)
.github/actions/upload-screenshots/action.yml.github/workflows/test.yml.gitignoreREADME.mddocs/ci-integration.mddocs/configuration.mddocs/docker-testing.mddocs/drivers.mddocs/framework-setup.mddocs/organization.mddocs/reporters.mdlib/capybara/screenshot/diff/vcs.rblib/capybara_screenshot_diff/dsl.rblib/capybara_screenshot_diff/reporters/html.rbscripts/generate_sample_report.rbtest/unit/vcs_test.rb
✅ Files skipped from review due to trivial changes (9)
- .gitignore
- scripts/generate_sample_report.rb
- test/unit/vcs_test.rb
- lib/capybara_screenshot_diff/dsl.rb
- docs/docker-testing.md
- docs/reporters.md
- docs/drivers.md
- docs/framework-setup.md
- docs/ci-integration.md
🚧 Files skipped from review as they are similar to previous changes (4)
- lib/capybara/screenshot/diff/vcs.rb
- .github/workflows/test.yml
- README.md
- .github/actions/upload-screenshots/action.yml
7fa5cfc to
16de749
Compare
- upload-screenshots action: v6→v7, base64 HTML report with archive: false, direct artifact-url outputs for PR comment links - test.yml: PR comment with direct artifact URLs (find+update, no spam), resolves on success, path filters on push, workflow_dispatch test job - Sample report: bin/rake 'report:sample[embed]' for base64 images Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
README: 970→149 lines with docs/ folder (7 files). Quick Start with single include + git commit step. Failure message before file table. Tuning Flaky Tests after Next Steps. CI fail_if_new note. Reporter: embed_images option (base64 in CI, relative paths locally). Convention over configuration — require auto-registers at_exit hook. Fix crop/skip_area YARD docs to edge coordinates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
expand_path before Dir.chdir, git rev-parse inside chdir, early return when not in git repo. Fixes mixed absolute/relative path errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
db72a48 to
84de311
Compare
Summary
archive: false(upload-artifact@v7) for inline preview in Actions UIHow it works
Inline preview (2 clicks):
screenshot-report→ HTML renders in browserFull review (download):
screenshot-report-full→ open locally with imagesResearch findings
archive: falseonly supports single files (v7.0.0 release)archive: false(inline preview) AND the full directory as zip (images included)peter-evans/find-comment@v3+create-or-update-comment@v5to update existing comment instead of creating new onesCustomer setup (zero friction)
Add to test helper:
Add to workflow — copy-paste from README.
Test plan
Generated with Claude Code
Summary by Sourcery
Add GitHub Actions HTML screenshot report artifacts with inline preview support and PR comment integration for failed test runs.
New Features:
Enhancements:
Summary by CodeRabbit
New Features
Documentation
Bug Fixes