[CORRUPTED] Synthetic Benchmark PR #26636 - feat: implement git checkout caching to speed up CI workflows#558
Open
ofir-frd wants to merge 10 commits intobase_pr_26636_20260120_4823from
Open
Conversation
- Create cache-checkout action to save/restore git working directory - Update prepare job in pr.yml to cache checkout after dangerous-git-checkout - Update all downstream workflows to restore from cache instead of checkout - Pass commit-sha to all workflow calls for cache key consistency This reduces the number of full git checkouts from 20+ per workflow run to just 1, significantly improving CI performance especially for large repos. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Remove sparse-checkout and use actions/cache/restore@v4 directly in all downstream workflows. This eliminates the need for any git fetch operation before restoring from cache, making the optimization more effective. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Remove commit-sha input from all downstream workflows - Update cache-checkout action to use github.event.pull_request.head.sha directly - Remove commit-sha output from prepare job - Remove commit-sha from all workflow calls in pr.yml - Keep sparse-checkout of .github to access the cache-checkout action This eliminates the need to pass commit-sha around while still using a reusable action for the cache restore logic. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… removed Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…tion of other branches' caches
The prefix-based cache deletion was using 'git-checkout-{branch}' which would
accidentally match and delete caches for branches with similar prefixes.
For example, branch 'feature' would delete caches for 'feature-2', 'feature-new', etc.
Adding a trailing '-' ensures exact branch matching:
- 'git-checkout-feature-' matches 'git-checkout-feature-abc123' (intended)
- 'git-checkout-feature-' does NOT match 'git-checkout-feature-2-def456' (correct)
Fixes both the cache-checkout action and the PR close cleanup workflow.
Co-Authored-By: unknown <>
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
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.
Benchmark PR calcom#26636
Type: Corrupted (contains bugs)
Original PR Title: feat: implement git checkout caching to speed up CI workflows
Original PR Description: ## What does this PR do?
Implements git checkout caching to reduce CI workflow times by eliminating redundant git checkouts across parallel jobs.
Previously, every job in the PR workflow performed its own full git checkout (via
actions/checkout@v4+dangerous-git-checkout), resulting in 20+ separate checkouts per workflow run. This was particularly slow for the cal.com repo (~1.3GB).This PR:
cache-checkoutaction that saves/restores the git working directorypreparejob saves the checkout to cache afterdangerous-git-checkout.github(to access the action) then restore from cachegit-checkout-{branch}-{sha}to ensure cache is only reused within a single PRdelete-blacksmith-cache.yml)dangerous-git-checkoutto exclude/example-apps/and*.mp4files (~38MB saved from salesroom demo video)Expected impact: Reduces checkout time from ~10+ minutes per job to a fast cache restore, with only one full checkout per workflow run.
Link to Devin run: https://app.devin.ai/sessions/00c0c2b934dc40609aaf765ab206daaa
Requested by: @keithwillcode
Updates since last revision
github.head_ref || github.ref_nameandgithub.shainstead ofgithub.event.pull_request.head.ref/sha(the latter is not available in workflow_call contexts)git-checkout-${{ github.head_ref || github.ref_name }}-${{ github.sha }}useblacksmith/cache-delete@v1withprefix: "true")delete-blacksmith-cache.ymlto delete all git-checkout caches with the PR branch prefix when PR is closeddangerous-git-checkoutaction to excludeexample-apps/directory and all.mp4filesget_shastep andcommit-shaoutput that was accidentally removed when adding the cache-checkout step (this was breaking the ready-for-e2e label check)-to cache key prefix to prevent accidental deletion of other branches' caches (e.g., branchfeatureno longer deletes caches forfeature-2)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
This PR modifies CI infrastructure and can only be tested by running the actual workflows:
preparejob successfully deletes old caches and saves the checkout to cacheHuman Review Checklist
fail-on-cache-miss: trueis acceptable behavior (downstream jobs will fail if prepare job fails before caching).gitandnode_modulesgithub.head_ref || github.ref_nameandgithub.shaare available in all workflow_call contexts.githubis fast enough to be worthwhile vs. the previous approachConfirm prefix-based cache deletion (- Fixed by adding trailinggit-checkout-{branch}) won't accidentally delete unrelated caches-to prefixexample-apps/or the salesroom mp4 file/*,!/example-apps/,!**/*.mp4) work correctly in non-cone modeget_shastep andcommit-shaoutput are properly restored in pr.ymlChecklist
Original PR URL: feat: implement git checkout caching to speed up CI workflows calcom/cal.com#26636
Compliance Violation