Skip to content

fix(ci): pull --rebase before push in benchmark workflows#35

Open
tstapler wants to merge 3 commits intomainfrom
stelekit-action-failing
Open

fix(ci): pull --rebase before push in benchmark workflows#35
tstapler wants to merge 3 commits intomainfrom
stelekit-action-failing

Conversation

@tstapler
Copy link
Copy Markdown
Owner

Summary

  • Both benchmark.yml and android-benchmark.yml failed on main-branch pushes with error: failed to push some refs — the push was rejected because another commit landed on main between checkout and push
  • Added git pull --rebase origin main before git push in both workflows
  • The benchmark history files are all uniquely named (<timestamp>_<sha>.json), so the rebase never conflicts

Root cause

The two benchmark workflows both run on every push to main and commit a new JSON file to benchmarks/history/ or benchmarks/android-history/. When commits land close together, the second push is rejected because the remote already has work the runner hasn't seen yet.

Test plan

  • Verify the next main-branch push triggers both benchmark workflows and they complete without the push-rejection error

…rejected pushes

When multiple commits land on main in quick succession, both benchmark
jobs check out at different points and then try to push new history
files. The second push is rejected with "fetch first". Adding
`git pull --rebase origin main` before `git push` lets the history
JSON files (all uniquely named by timestamp+SHA) merge cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 26, 2026 16:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates CI benchmark workflows to reduce git push rejections when multiple main-branch benchmark runs try to commit benchmark history around the same time.

Changes:

  • Add git pull --rebase origin main before git push in the existing Benchmark workflow.
  • Add a new Android benchmark workflow that runs instrumented benchmarks, writes a JSON summary to benchmarks/android-history/, and commits it on main.
  • Post PR comments comparing current benchmark results to a baseline history entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/benchmark.yml Pull/rebase before pushing benchmark history to reduce push rejections.
.github/workflows/android-benchmark.yml New workflow to run Android benchmarks, generate/commit history, and comment results on PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 101 to 103
git diff --cached --quiet || git commit -m "chore(bench): benchmark summary ${{ github.sha }}"
git pull --rebase origin main
git push
android-benchmark:
name: Android Instrumented Benchmark
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
Comment on lines +117 to +119
git pull --rebase origin main
git push

tstapler and others added 2 commits April 26, 2026 11:01
Adds a realistic large-library benchmark config matching ~10,000-page
personal knowledge graphs:

- XLARGE preset: 10,000 pages, 730 journals, 30% link density
- Hub pages (5% of all pages): 15× more likely to be linked to,
  contain 3× more blocks with 2.5× higher outgoing link density —
  models heavily-referenced index/MOC pages that accumulate hundreds
  of backlinks in real libraries
- Pre-built weighted link pool replaces per-block allPages.shuffled()
  call (O(1) vs O(n) sampling — critical at 10k-page scale)
- jvmTestProfile task now defaults to XLARGE via benchConfig project
  property; override locally with -PbenchConfig=SMALL for quick runs
- CI benchmark job timeout raised to 30 min to accommodate larger load

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Target is 2× an actual ~10k-page / 6-year personal library so benchmarks
stay ahead of current reality:
  - Pages: 10k → 20k
  - Journals: 730 → 4380 (6 years of daily entries × 2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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