ci: flatten device render captures to survive spaces in AGP's output path - #155
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe screenshot workflow now flattens device captures into ChangesScreenshot workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Snapshot diff report✅ 8 screenshots verified, no changes.
Full screenshot report (artifact) ScreenshotsCommitted reference screenshots each spec verifies against (current expected state).
|








Problem
The device render gallery never showed up in the PR comment, even when the emulator jobs produced captures. On #152 the "Device render (API 30/34)" jobs passed and uploaded non-empty artifacts, but the comment's "Generate device render gallery" step was skipped.
Root cause
AGP's
additionalTestOutputDirpull nests the captures under a device-named subdirectory that contains a space, e.g.androidDeviceTest/connected/emulator-5554 - 11/band_api30_duotone_actual.png. The gallery's safe-set filter,^[a-zA-Z0-9_./-]+$, rejects any path with a space, so it treats every device capture as untrusted and silently drops it. Goldens and diff images sit in a flat, space-free path, so they were unaffected, which is why the goldens gallery has been showing up fine while the device gallery stayed empty.Fix
Flatten the device captures into a space-free directory before filtering:
find device-screenshots -name "*.png" -exec cp {} device-flat/ \;, then run the existing check/push/gallery filters against that flat tree. A flat, space-free path keeps the blob URL, the push step, and the check step all consistent with the filters already in place, and the original subdirectory carries no information the gallery uses (it only parses theband_api<SDK>_<case>_<kind>basename).Verified against a reproduction of the actual artifact tree from the bug report, plus an adversarial case (a space inside the filename itself, not just the directory), which is still rejected.
Summary by CodeRabbit