Skip to content

fix(docs): stop builds from churning tracked docs screenshots#6012

Merged
jamesarich merged 1 commit into
mainfrom
claude/docs-screenshot-build-churn
Jun 29, 2026
Merged

fix(docs): stop builds from churning tracked docs screenshots#6012
jamesarich merged 1 commit into
mainfrom
claude/docs-screenshot-build-churn

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

🐛 Bug Fix

Builds repeatedly dirtied the tracked docs/assets/screenshots/*.png, forcing a git checkout before every commit.

Why

syncDocsToComposeResources carried a build-time dependsOn(":screenshot-tests:copyDocsScreenshots"). copyDocsScreenshots is a Copy task that writes into the git-tracked docs/assets/screenshots/. So every assembleDebug/test run that built :feature:docs rewrote those PNGs from the CST reference goldens. Because the committed copies had drifted from the current references, the working tree showed them modified on every build.

Rendering is deterministic (layoutlib), so this was never a host/machine issue — it was a generated artifact wired into the build graph against a tracked source path.

Fix

Drop the dependsOn. The app still bundles the committed screenshots as-is via syncDocsToComposeResources. Refresh them on demand instead:

./gradlew :screenshot-tests:copyDocsScreenshots   # regenerate for local viewing
git checkout -- docs/assets/screenshots           # clean up after viewing

…or commit the result deliberately when you actually intend to refresh the docs/Jekyll image set.

No CI task regenerates or gates these images, so removing the build-time refresh changes no CI behavior.

Testing Performed

  • ./gradlew :feature:docs:syncDocsToComposeResources --dry-run — confirms :screenshot-tests:copyDocsScreenshots is no longer in the task graph.
  • ./gradlew :feature:docs:syncDocsToComposeResources — BUILD SUCCESSFUL.
  • git status --porcelain docs/assets/screenshots/ — empty after the build (PNGs no longer touched).

Notes

A ponytail: comment at the change site documents the new workflow. If committed doc images ever drift, the follow-up is a CI staleness gate (run copyDocsScreenshots + git diff --exit-code), not re-wiring the build.

syncDocsToComposeResources had a build-time dependsOn :screenshot-tests:
copyDocsScreenshots, a Copy task that writes into the git-tracked
docs/assets/screenshots/. As a result every assembleDebug/test that built
:feature:docs rewrote those PNGs from the CST reference goldens. The
committed copies had drifted from the references, so the working tree
showed them modified on every build — recurring noise we kept having to
git-checkout before committing.

Rendering is deterministic (layoutlib), so this was never a host issue;
it was a generated artifact wired into the build graph against a tracked
source path. Drop the dependsOn. The app bundles the committed screenshots
as-is via syncDocsToComposeResources; regenerate on demand for local
viewing (./gradlew :screenshot-tests:copyDocsScreenshots) and git-checkout
to clean, or commit deliberately when refreshing the docs/Jekyll image set.

No CI task regenerates or gates these images, so removing the build-time
refresh changes no CI behavior. Add a staleness gate later if drift bites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the bugfix PR tag label Jun 29, 2026
@jamesarich jamesarich merged commit fef124b into main Jun 29, 2026
15 checks passed
@jamesarich jamesarich deleted the claude/docs-screenshot-build-churn branch June 29, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant