fix(docs): stop builds from churning tracked docs screenshots#6012
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Bug Fix
Builds repeatedly dirtied the tracked
docs/assets/screenshots/*.png, forcing agit checkoutbefore every commit.Why
syncDocsToComposeResourcescarried a build-timedependsOn(":screenshot-tests:copyDocsScreenshots").copyDocsScreenshotsis aCopytask that writes into the git-trackeddocs/assets/screenshots/. So everyassembleDebug/testrun that built:feature:docsrewrote 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 viasyncDocsToComposeResources. Refresh them on demand instead:…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:copyDocsScreenshotsis 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 (runcopyDocsScreenshots+git diff --exit-code), not re-wiring the build.