Repository navigation
Cache the git objects of CodeTracker and RefactoringMiner in CI - #218
Merged
Merged
Conversation
The checkout of CodeTracker with its oracle submodule and the clone of RefactoringMiner downloaded every object at each build (168 s and part of 330 s in the last master build). Like the RefactoringMiner workflow, the .git of an earlier master build is restored before the checkout, so that only the objects changed since then are fetched. RefactoringMiner is fetched at its master commit into a restored .git, keyed by that commit, instead of being cloned. On master builds, the objects of the older snapshots are dropped (reflog expire, repack, prune, also in the submodule) and the caches are saved. The credentials are not kept in .git/config, so that the cached .git does not contain the token. Co-Authored-By: Claude Opus 5.5 <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.
The CI checkout of CodeTracker (with the
oraclesubmodule) and the clone of RefactoringMiner download every object at each build. In the last successful master build (run 41630453109), the checkout took 168 s and the RefactoringMiner clone +publishToMavenLocaltook 330 s.This applies the same optimization as the RefactoringMiner workflow (tsantalis/RefactoringMiner@aeaea55fc):
.gitof an earlier master build (including.git/modules/oracle) is restored beforeactions/checkout, which reuses it, so only the objects changed since then are fetched.git ls-remote, a.gitcached for an earlier RefactoringMiner commit is restored, and the commit is fetched with--depth 1into it, instead of a fresh clone. The cache is keyed by the RefactoringMiner commit, so builds of the same RefactoringMiner commit reuse it as is.reflog expire,repack -a -d,prune, also in the submodule) before the caches are saved, so they do not grow with every build.prunealso removes the loose objects that small fetches leave behind.persist-credentials: falsekeeps the token out of the cached.git/config.actions/checkoutis updated from v3 to v4.Notes:
.git, cleanup of stray files, repack + prune leaving only the new snapshot).🤖 Generated with Claude Code