Skip to content

test: Increase mock photo count to validate Roborazzi diff pipeline#183

Merged
komodgn merged 2 commits intodevelopfrom
test/comment-bot
Apr 21, 2026
Merged

test: Increase mock photo count to validate Roborazzi diff pipeline#183
komodgn merged 2 commits intodevelopfrom
test/comment-bot

Conversation

@komodgn
Copy link
Copy Markdown
Owner

@komodgn komodgn commented Apr 20, 2026

Related issue

Work Description ✏️

Note

The workflow downloads baseline images from the develop branch for comparison. Since develop still contains the old NLSearchScreenshotTest images, they are fetched as reference files. These will disappear once this PR is merged and the develop baseline is updated.

Unexpected Bulk File Additions

  • Although only PersonDetailMock.kt was modified, over 40 comparison files were committed to the companion branch.
  • Verify in the next test run whether the pipeline correctly stabilizes and only tracks actual delta changes moving forward.

Screenshot 📸

Summary by CodeRabbit

  • Tests

    • Expanded mock photo dataset from 10 to 28 entries.
    • Removed a UI screenshot test that captured the initial search screen.
  • Chores

    • Removed the screenshot-comparison CI workflow and its automated PR comment/branch management.

No user-facing functionality changed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

Expanded person mock photo URIs from 10 to 28 and removed a GitHub Actions workflow for screenshot-diff reporting; also deleted one NLSearch screenshot test.

Changes

Cohort / File(s) Summary
Person detail mock
feature/detail/src/main/java/com/metasearch/android/feature/detail/person/mock/PersonDetailMock.kt
Extended fakePhotoUris range from 1..10 to 1..28 (URI generation only).
Screenshot comparison workflow (removed)
.github/workflows/screenshot-comparison-comment.yml
Workflow file deleted — previously handled downloading diff artifacts, creating a companion branch, pushing PNG diffs, and posting/rewriting PR comments.
Screenshot test removed
feature/search/src/test/java/com/metasearch/android/feature/search/NLSearchScreenshotTest.kt
Deleted a Robolectric/Compose screenshot test that captured screenshots/nl_search_initial_state.png.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Runner as GitHub Actions Runner
  participant Artifacts as Artifact Storage
  participant Repo as Repository
  participant Shell as Workflow Shell

  Note over Runner,Artifacts: (Previous workflow behavior)
  Runner->>Artifacts: download `screenshot-diff-reports` artifact
  Runner->>Shell: read PR number from `diff-reports/*/NR`
  Runner->>Repo: checkout repository (default branch)
  Shell->>Shell: find `*_compare.png` files → set exists flag
  alt PNGs found
    Shell->>Repo: create/checkout `companion_<head>` orphan branch
    Shell->>Repo: copy PNGs → commit → push
    Shell->>Runner: generate markdown with image links
    Runner->>Repo: post or replace PR comment with report
  else no PNGs
    Shell->>Runner: skip report/comment steps
  end
  Shell->>Repo: cleanup old `companion_` branches (>30 days)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

testing

Poem

🐰 I hopped from ten up to twenty-eight,
More tiny photos on my plate.
A workflow hopped away, poof—gone,
A test I nudged to carry on,
I thump the logs and celebrate! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #181 by increasing mock data for testing, but the removal of screenshot tests and workflow contradicts the intent to automate screenshot diff reporting. Clarify why screenshot tests were removed if the goal is to validate Roborazzi diff pipeline. Consider whether these deletions align with automating visual regression testing feedback.
Out of Scope Changes check ⚠️ Warning The PR removes an entire GitHub Actions workflow and a screenshot test class, which appear to be cleanup rather than the primary objective of increasing mock photo count. Justify why the screenshot-comparison-comment workflow and NLSearchScreenshotTest were removed, or move these deletions to a separate cleanup PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly relates to the main change: increasing mock photo count (1..10 to 1..28) to validate the Roborazzi diff pipeline.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/comment-bot

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.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (2m 22s)
  • Code Style Check: ✅ Success (1m 5s)
  • Compose Stability: ✅ Success (40s)

Total Time: 4m 7s

🎉 All steps completed successfully!

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (15s)
  • Code Style Check: ✅ Success (1m 1s)
  • Compose Stability: ✅ Success (1m 1s)

Total Time: 2m 17s

🎉 All steps completed successfully!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/screenshot-comparison-comment.yml (1)

81-87: Prefer a glob over ls | grep to enumerate _compare.png files.

Parsing ls is fragile (breaks on unusual characters, SC2012) and the ls *.png 1>/dev/null guard can be folded in via shopt -s nullglob.

♻️ Suggested refactor
-          if ls *.png 1> /dev/null 2>&1; then
-            for file in $(ls *.png | grep _compare.png); do
-              URL="https://github.com/${REPO}/blob/${BRANCH}/${file}?raw=true"
-              DISPLAY_NAME=$(echo $file | sed -r 's/(.{20})/\1<br>/g')
-              echo "| $DISPLAY_NAME | ![]($URL) |" >> $GITHUB_OUTPUT
-            done
-          fi
+          shopt -s nullglob
+          for file in *_compare.png; do
+            URL="https://github.com/${REPO}/blob/${BRANCH}/${file}?raw=true"
+            DISPLAY_NAME=$(printf '%s' "$file" | sed -r 's/(.{20})/\1<br>/g')
+            echo "| $DISPLAY_NAME | ![]($URL) |" >> "$GITHUB_OUTPUT"
+          done
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/screenshot-comparison-comment.yml around lines 81 - 87,
Replace the fragile ls/grep enumeration with a shell glob using shopt -s
nullglob so the guard is folded in; specifically, in the block that currently
tests "if ls *.png ..." and loops "for file in $(ls *.png | grep _compare.png);
do", enable nullglob, iterate "for file in *_compare.png; do" and remove the
ls-based existence check, then reuse REPO, BRANCH, DISPLAY_NAME and
GITHUB_OUTPUT as before to build URL and append the row; ensure you unset or
restore nullglob if needed after the loop.
🤖 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/screenshot-comparison-comment.yml:
- Around line 49-66: The "Push to Companion Branch" step flattens PNG/NR files
into the repo root causing name collisions, noisy self-copies, and duplicates
the original diff-reports/ when committing; change the copy logic to only search
./diff-reports (avoid find .) and preserve namespace (e.g., map the path under
diff-reports/ into a unique filename or directory by replacing '/' with '_' or
mirroring the folder structure) so basename collisions cannot overwrite files,
and after copying either remove diff-reports/ (rm -rf diff-reports) before
running git add/commit or avoid flattening entirely and commit directly from
diff-reports/ (drop the flatten step); keep BRANCH_NAME handling the same and
ensure the step no longer triggers cp self-copy warnings by scoping find to
./diff-reports.
- Around line 26-28: The current shell step concatenates all matching "NR" files
into PR_NUMBER (using find ... -exec cat {} \;), which yields invalid/ambiguous
numbers when multiple NR markers exist; change the logic so you choose exactly
one NR file (e.g., use find to locate a single file with -print -quit or list
matches and error if count != 1) and fail the job if none are found; update the
step that sets PR_NUMBER (the variable PR_NUMBER and the find invocation) to
explicitly pick one NR file or bail with a clear error message when zero or
multiple matches are detected.

---

Nitpick comments:
In @.github/workflows/screenshot-comparison-comment.yml:
- Around line 81-87: Replace the fragile ls/grep enumeration with a shell glob
using shopt -s nullglob so the guard is folded in; specifically, in the block
that currently tests "if ls *.png ..." and loops "for file in $(ls *.png | grep
_compare.png); do", enable nullglob, iterate "for file in *_compare.png; do" and
remove the ls-based existence check, then reuse REPO, BRANCH, DISPLAY_NAME and
GITHUB_OUTPUT as before to build URL and append the row; ensure you unset or
restore nullglob if needed after the loop.
🪄 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: 11610669-8168-4155-9b9d-211ab0dfaba9

📥 Commits

Reviewing files that changed from the base of the PR and between c9311b8 and 502efe0.

📒 Files selected for processing (1)
  • .github/workflows/screenshot-comparison-comment.yml

Comment thread .github/workflows/screenshot-comparison-comment.yml
Comment thread .github/workflows/screenshot-comparison-comment.yml
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (16s)
  • Code Style Check: ✅ Success (1m 5s)
  • Compose Stability: ✅ Success (1m 5s)

Total Time: 2m 26s

🎉 All steps completed successfully!

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (16s)
  • Code Style Check: ✅ Success (1m 3s)
  • Compose Stability: ✅ Success (1m 0s)

Total Time: 2m 19s

🎉 All steps completed successfully!

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (17s)
  • Code Style Check: ✅ Success (1m 6s)
  • Compose Stability: ✅ Success (1m 4s)

Total Time: 2m 27s

🎉 All steps completed successfully!

@github-actions
Copy link
Copy Markdown

Roborazzi Snapshot Diff Report

File Name Comparison
nl_search_initial_st
ate_compare.png
com.metasearch.andro
id.core.ui.component
.MetaSearchCircleIma
geKt_MetaSearchCircl
eImagePreview_compar
e.png
com.metasearch.andro
id.feature.search.fo
cusing.component.Mor
eButtonKt_MoreButton
Preview_compare.png
com.metasearch.andro
id.feature.detail.pe
rson.component.Perso
nEditDialogContentKt
_PersonEditContentPr
eview_compare.png
com.metasearch.andro
id.feature.search.nl
s.component.NLSearch
TextFieldKt_NLSearch
TextFieldPreview_com
pare.png
com.metasearch.andro
id.feature.graph.Gra
phUiKt_GraphUiErrorP
review_compare.png
com.metasearch.andro
id.feature.search.fo
cusing.FocusingSearc
hUiKt_FocusingSearch
UiPreview_compare.pn
g
com.metasearch.andro
id.feature.graph.Gra
phUiKt_GraphUiWebVie
wPreview_compare.png
com.metasearch.andro
id.feature.detail.gr
aph.component.Explor
eImageListKt_Explore
ImageListPreview_com
pare.png
com.metasearch.andro
id.core.ui.component
.MetaSearchSearchBar
Kt_MetaSearchSearchB
arPreview_compare.pn
g
com.metasearch.andro
id.feature.detail.pe
rson.PersonDetailUiK
t_PersonDetailUiPrev
iew_compare.png
com.metasearch.andro
id.feature.search.fo
cusing.component.Sea
rchResultListKt_Sear
chResultListPreview_
compare.png
com.metasearch.andro
id.feature.person.Pe
rsonUiKt_PersonUiDel
eteDialogPreview_com
pare.png
com.metasearch.andro
id.feature.screens.c
omponent.MetaSearchM
ainBottomBarKt_MetaS
earchMainBottomBarPr
eview_compare.png
com.metasearch.andro
id.feature.search.fo
cusing.FocusingSearc
hUiKt_FocusingSearch
UiLoadingPreview_com
pare.png
com.metasearch.andro
id.core.ui.component
.MetaSearchDialogKt_
MetaSearchDialogPrev
iew_compare.png
com.metasearch.andro
id.feature.home.Home
UiKt_HomeUiLongClick
Preview_compare.png
com.metasearch.andro
id.core.designsystem
.component.MetaSearc
hButtonKt_MetaSearch
ButtonPreview_compar
e.png
com.metasearch.andro
id.feature.home.Home
UiKt_HomeUiPreview_c
ompare.png
com.metasearch.andro
id.feature.detail.ph
oto.component.PhotoD
etailBottomBarKt_Pho
toDetailBottomBarPre
view_compare.png
com.metasearch.andro
id.core.designsystem
.component.NetworkIm
ageKt_NetworkImagePr
eview_compare.png
com.metasearch.andro
id.core.ui.component
.MetaSearchSquareIma
geKt_MetaSearchSquar
eImagePreview_compar
e.png
com.metasearch.andro
id.core.ui.component
.MetaSearchHeaderKt_
FocusingSearchHeader
Preview_compare.png
com.metasearch.andro
id.feature.detail.ph
oto.component.ImageD
escriptionBottomShee
tContentKt_ImageDesc
riptionBottomSheetCo
ntentPreview_compare
.png
com.metasearch.andro
id.core.ui.component
.MetaSearchDividerKt
_MetaSearchDividerPr
eview_compare.png
com.metasearch.andro
id.feature.home.comp
onent.HomeHeaderKt_H
omeHeaderPreview_com
pare.png
com.metasearch.andro
id.core.designsystem
.component.MetaSearc
hToastKt_MetaSearchT
oastPreview_compare.
png
com.metasearch.andro
id.feature.search.fo
cusing.component.Foc
usingSearchBottomBar
Kt_FocusingSearchBot
tomBarPreview_compar
e.png
com.metasearch.andro
id.feature.search.nl
s.NLSearchUiKt_NLSea
rchUiLoadingPreview_
compare.png
com.metasearch.andro
id.feature.home.comp
onent.PersonCircleIt
emKt_PersonCircleIte
mPreview_compare.png
com.metasearch.andro
id.feature.detail.pe
rson.component.Perso
nDetailHeaderKt_Pers
onDetailHeaderPrevie
w_compare.png
com.metasearch.andro
id.feature.person.co
mponent.PersonSearch
TextFieldKt_PersonSe
archTextFieldPreview
_compare.png
com.metasearch.andro
id.feature.home.comp
onent.PartialAccessB
annerKt_PartialAcces
sBannerPreview_compa
re.png
com.metasearch.andro
id.feature.detail.pe
rson.PersonDetailUiK
t_PersonDetailUiEdit
DialogPreview_compar
e.png
com.metasearch.andro
id.feature.home.Home
UiKt_HomeUiCollapsed
Preview_compare.png
com.metasearch.andro
id.core.designsystem
.component.MetaSearc
hTextFieldKt_MetaSea
rchTextFieldPreview_
compare.png
com.metasearch.andro
id.feature.detail.gr
aph.GraphDetailUiKt_
GraphDetailUiPreview
_compare.png
com.metasearch.andro
id.core.ui.component
.MetaSearchLoadingIn
dicatorKt_MetaSearch
LoadingIndicatorPrev
iew_compare.png
com.metasearch.andro
id.feature.person.Pe
rsonUiKt_PersonUiPre
view_compare.png
com.metasearch.andro
id.feature.search.nl
s.NLSearchUiKt_NLSea
rchUiPreview_compare
.png
com.metasearch.andro
id.feature.person.co
mponent.PersonItemKt
_PersonItemPreview_c
ompare.png
com.metasearch.andro
id.feature.detail.pe
rson.PersonDetailUiK
t_PersonDetailUiProf
ileSelectPreview_com
pare.png
com.metasearch.andro
id.feature.splash.Sp
lashUiKt_SplashUiPre
view_compare.png
com.metasearch.andro
id.core.ui.component
.WebViewErrorUiKt_We
bViewErrorUiPreview_
compare.png
com.metasearch.andro
id.feature.detail.ph
oto.PhotoDetailUiKt_
PhotoDetailUiPreview
_compare.png
com.metasearch.andro
id.feature.graph.Gra
phUiKt_GraphUiPrevie
w_compare.png

komodgn added 2 commits April 21, 2026 16:20
- screenshot-comparison-comment.yml
- NLSearchScreenshotTest.kt
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Debug Build: ✅ Success (16s)
  • Code Style Check: ✅ Success (1m 7s)
  • Compose Stability: ✅ Success (1m 4s)

Total Time: 2m 27s

🎉 All steps completed successfully!

@komodgn komodgn merged commit 163be95 into develop Apr 21, 2026
4 checks passed
@komodgn komodgn deleted the test/comment-bot branch April 21, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] Implement automated screenshot diff reporting

1 participant