ADFA-5264: Stop tracking the test project's sync cache - #1740
Conversation
testing/resources/test-project/.cg/gradle-sync/{project.pb,sync.pb,sync.lock}
were tracked, and a test run rewrites them with the local machine's absolute
paths. So they turn up modified in everyone's working tree, and a `git add -A`
buries them in an unrelated commit -- including a 13 MB binary. That is how they
last changed: the most recent commit touching them is an AI-plugin extraction
refactor that had no reason to.
They are a cache, not a fixture. ProjectSyncHelper writes them, and the only
test that mentions the cache is "WHEN sync files are unreadable THEN sync
anyway" -- it exercises their absence. Nothing reads a committed copy.
A lock file was tracked too.
Verified: with them untracked and ignored, running :lsp:java:testV8DebugUnitTest
-- the suite that used to rewrite them -- leaves a clean working tree.
Note for whoever picks up ADFA-5068: :subprojects:tooling-api-impl is a
java-library, so its tests never ran in CI (the aggregate depends only on
testV8DebugUnitTest), and ToolingApiServerImplTest does not currently compile on
stage -- "No value passed for parameter 'buildId'". Once that gap is closed, that
failure becomes visible.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 Walkthrough
WalkthroughThe change ignores the test project's ChangesTest project cache cleanup
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change stops generated sync-cache files from being tracked or rewritten into developers' working trees. It is localized and merge-ready after normal checks, with no actionable merge-blocking risk remaining. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ 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 |
Both said the tracked-fixture hazard is live. ADFA-5264 (#1740) merged to stage in the meantime and ignores testing/resources/test-project/.cg/ entirely, so nothing under it is tracked any more. The learnings entry now records what happened and the shape worth remembering -- a tracked file a test run rewrites cannot be kept clean by discipline, only by untracking it -- in past tense. CLAUDE.md's git-add-A rule stands on its own; only its justification needed replacing. The untracked half of the risk is still live, and tests/ is the current example: :gradle-plugin:test leaves files there and tests/test-home is not ignored on stage today. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M4sTwYg47aK8VB9kRKZicU
Brings in ADFA-5263 (#1739), which deleted copyToTestDir independently, and ADFA-5264 (#1740), which ignores the test project's .cg/ cache. With both in, this branch's diff is the three files it actually changes. Conflict was in .gitignore: stage removed both tests/ entries as part of #1739. Kept this branch's tests/test-home line -- the gradle-plugin tests still refill that directory -- and left the model.jar entry deleted, since the task that wrote it is gone. Moved the entry out from under the "Generated files for tooling API" header, which heads the composite-build output dirs and not this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M4sTwYg47aK8VB9kRKZicU
Brings in ADFA-5264 (#1740), whose merge is what made two claims in this retro stale -- corrected in 8cfc586. No conflicts; with stage in, the diff is the three documents this PR is about. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M4sTwYg47aK8VB9kRKZicU
testing/resources/test-project/.cg/gradle-sync/{project.pb,sync.pb,sync.lock}were tracked, and a test run rewrites them with the local machine's absolute paths. So they show up modified in everyone's working tree, and agit add -Aburies them in an unrelated commit — a 12.7 MB binary among them (12,678,925 bytes).That is exactly how they last changed: the most recent commit touching them is an AI-plugin extraction refactor (#1441) that had no reason to. It happened to me this week too, which is what prompted the ticket.
They are a cache, not a fixture
ProjectSyncHelperwrites them, and the only test that mentions the sync cache isGIVEN force sync not requested WHEN sync files are unreadable THEN sync anyway— it exercises their absence. Nothing reads a committed copy. A lock file was tracked as well.Verified
With them untracked and ignored,
:lsp:java:testV8DebugUnitTest— the suite that used to rewrite them — now leaves a clean working tree. Before this change that same run producedM …/project.pbandM …/sync.pbevery time.One thing found on the way, for ADFA-5068
:subprojects:tooling-api-implis ajava-library, so its tests have never run in CI — the aggregate task depends only ontestV8DebugUnitTest, which is precisely the gap hal identified on #1643. AndToolingApiServerImplTestdoes not currently compile onstage:No value passed for parameter 'buildId'. Once #1643 closes the CI gap, that failure becomes visible, so it is worth knowing about in advance rather than as a surprise red build.What this does not do
The blob stays in history — it entered in
f01e558d6(#1441) and remains reachable after thisdeletion, so no clone or CI checkout gets smaller. This stops the file being rewritten by a test
run into everyone's working tree; shrinking the repo would need a history rewrite, which is not
in scope here.
Two follow-ups worth deciding on, both from review:
git restore testing/resources/test-project/.cgbefore pulling, or
git pullaborts with "Your local changes would be overwritten by merge" —which is most of us, since a test run is what modifies it.
.cgisSharedEnvironment.PROJECT_CACHE_DIR_NAME—always generated, never source — so a repo-wide
.cg/would be safe and would also covergradle-plugin/src/test/resources/sample-project/.cg/andtesting/resources/sample-project/.cg/,neither of which is ignored today. The next test that syncs one of those repeats this incident.