Skip to content

ADFA-5264: Stop tracking the test project's sync cache - #1740

Merged
davidschachterADFA merged 2 commits into
stagefrom
task/ADFA-5264-sync-fixtures
Aug 26, 2026
Merged

ADFA-5264: Stop tracking the test project's sync cache#1740
davidschachterADFA merged 2 commits into
stagefrom
task/ADFA-5264-sync-fixtures

Conversation

@davidschachterADFA

@davidschachterADFA davidschachterADFA commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

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 a git add -A buries 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

ProjectSyncHelper writes them, and the only test that mentions the sync cache is GIVEN 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 produced M …/project.pb and M …/sync.pb every time.

One thing found on the way, for ADFA-5068

:subprojects:tooling-api-impl is a java-library, so its tests have never run in CI — the aggregate task depends only on testV8DebugUnitTest, which is precisely the gap hal identified on #1643. And ToolingApiServerImplTest does not currently compile on stage: 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 this
deletion, 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:

  • Anyone with the file already modified needs git restore testing/resources/test-project/.cg
    before pulling
    , or git pull aborts with "Your local changes would be overwritten by merge" —
    which is most of us, since a test run is what modifies it.
  • The rule is a hard-coded 4-segment path. .cg is SharedEnvironment.PROJECT_CACHE_DIR_NAME
    always generated, never source — so a repo-wide .cg/ would be safe and would also cover
    gradle-plugin/src/test/resources/sample-project/.cg/ and testing/resources/sample-project/.cg/,
    neither of which is ignored today. The next test that syncs one of those repeats this incident.

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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a80e780-26f4-4b01-a7e9-78c3b9fb3f37

📥 Commits

Reviewing files that changed from the base of the PR and between ea658c3 and 8814aaa.

⛔ Files ignored due to path filters (1)
  • testing/resources/test-project/.cg/gradle-sync/sync.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .gitignore
  • testing/resources/test-project/.cg/gradle-sync/project.pb
  • testing/resources/test-project/.cg/gradle-sync/sync.pb
💤 Files with no reviewable changes (1)
  • testing/resources/test-project/.cg/gradle-sync/sync.pb

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough
  • Ignore generated .cg/gradle-sync/ cache files for the test project.
  • Remove project.pb, sync.pb, and sync.lock from Git tracking.
  • Prevent tests from creating machine-specific working-tree changes.
  • Risk: The generated files remain in Git history because repository history was not rewritten.
  • Risk: :subprojects:tooling-api-impl tests do not currently run in CI.
  • Risk: ToolingApiServerImplTest does not compile on stage because buildId is missing.

Walkthrough

The change ignores the test project's .cg cache directory and removes its tracked Gradle synchronization metadata file.

Changes

Test project cache cleanup

Layer / File(s) Summary
Ignore test project cache
.gitignore
Adds comments and an ignore rule for testing/resources/test-project/.cg/. The tracked Gradle synchronization metadata file is removed.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 8814a

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: hal-eisen-adfa, jatezzz

Poem

A rabbit found a cache tucked away

And marked it ignored today
Old sync notes hopped out of sight
The test project stayed clean and light
Carrots applaud the tidy byte

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: removing the test project's generated sync cache from tracking.
Description check ✅ Passed The description directly explains why the generated sync cache must be untracked and ignored, how the change was verified, and what remains out of scope.
Docstring Coverage ✅ Passed 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…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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)
  • Create PR with unit tests
  • Commit unit tests in branch task/ADFA-5264-sync-fixtures

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.

@dara-abijo-adfa
dara-abijo-adfa requested review from a team and removed request for a team August 25, 2026 12:22
@davidschachterADFA
davidschachterADFA merged commit 113b57f into stage Aug 26, 2026
4 checks passed
@davidschachterADFA
davidschachterADFA deleted the task/ADFA-5264-sync-fixtures branch August 26, 2026 01:10
davidschachterADFA added a commit that referenced this pull request Aug 27, 2026
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
davidschachterADFA added a commit that referenced this pull request Aug 27, 2026
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
davidschachterADFA added a commit that referenced this pull request Aug 27, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants