Skip to content

perf: shallow-clone the target branch only - #364

Merged
ktrz merged 1 commit into
benchmark-action:masterfrom
paradedb:barbarj.shallow-clone-target-branch-only
Sep 15, 2026
Merged

ktrz merged 1 commit into
benchmark-action:masterfrom
paradedb:barbarj.shallow-clone-target-branch-only

Conversation

@barbarj

@barbarj barbarj commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

This PR modifies the action to shallow clone the target branch only.

Why: For large repos, the time to do a full clone and checkout can be 20 minutes plus, which is long enough to cause retry loops when the branch tip is under contention by multiple benchmark runs.

Summary by CodeRabbit

  • Performance Improvements
    • Benchmark repositories are now retrieved using a faster, shallow clone of only the required GitHub Pages branch.
    • Removed the separate branch checkout step during benchmark publishing.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 26a05144-218b-4f38-ac4e-b710f90c59aa

📥 Commits

Reviewing files that changed from the base of the PR and between 86d8bcf and cc051ea.

📒 Files selected for processing (3)
  • src/git.ts
  • src/write.ts
  • test/write.spec.ts
💤 Files with no reviewable changes (1)
  • src/git.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The GitHub Pages repository flow now performs a shallow, single-branch clone at gh-pages. The separate checkout helper call and its test expectations were removed.

Changes

GitHub Pages branch cloning

Layer / File(s) Summary
Shallow branch clone and checkout removal
src/write.ts, src/git.ts, test/write.spec.ts
git.clone now receives --branch, --single-branch, and --depth 1. The separate checkout helper and related test expectations were removed. Existing rollback and work-tree configuration remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to cc051

This localized change updates branch checkout behavior, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: shallow-cloning only the target branch.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.88%. Comparing base (86d8bcf) to head (cc051ea).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   89.24%   89.88%   +0.63%     
==========================================
  Files          16       16              
  Lines         958      949       -9     
  Branches      203      203              
==========================================
- Hits          855      853       -2     
+ Misses        103       93      -10     
- Partials        0        3       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ktrz
ktrz merged commit 64c1e0a into benchmark-action:master Sep 15, 2026
29 checks passed
ktrz added a commit that referenced this pull request Sep 15, 2026
### Description
Follow-up to #364, addressing review findings:
- Add a gh-repository retry test covering push rejected → reset --hard
HEAD~1 → rmRF → shallow re-clone
- Add a clone() argv unit test in test/git.spec.ts
- Extract otherRepoGitHistory() helper to dedupe the other-repository
test expectations
- Comment the shallow/single-branch clone rationale in src/write.ts
- README: note that with gh-repository the action shallow-clones the
target branch directly

### Test scenario
- [ ] CI green (jest, lint, build)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Clarified that specifying a GitHub Pages repository uses a shallow
clone of only the `gh-pages` branch.
- Added details explaining repository cloning behavior when publishing
benchmarks.

- **Bug Fixes**
- Ensured an `index.html` file is created when needed without
overwriting an existing file.

- **Tests**
- Expanded coverage for authenticated repository cloning and
branch-specific operations.
- Added coverage for push rejection scenarios and safer rollback
handling.
  - Added coverage for `index.html` creation and preservation behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@ktrz

ktrz commented Sep 15, 2026

Copy link
Copy Markdown
Member

released in v1.22.2

@philippemnoel
philippemnoel deleted the barbarj.shallow-clone-target-branch-only branch September 15, 2026 11:10
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