Skip to content

(MOT-4277) fix(harness): bootstrap benchmark history branch - #638

Merged
ytallo merged 1 commit into
mainfrom
fix/harness-e2e-gh-pages-bootstrap
Jul 30, 2026
Merged

(MOT-4277) fix(harness): bootstrap benchmark history branch#638
ytallo merged 1 commit into
mainfrom
fix/harness-e2e-gh-pages-bootstrap

Conversation

@ytallo

@ytallo ytallo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Refs MOT-4277

Summary

  • create the remote gh-pages branch before benchmark-action stores the first metrics
  • use an empty Git commit so initialization does not modify or switch the workflow checkout
  • make branch creation idempotent and safe when another publisher wins the creation race
  • remove the late bootstrap path that could never run after the first benchmark action failed

Root cause

The first publisher run successfully downloaded the compact metrics and full execution artifacts, but benchmark-action tried to fetch gh-pages before that branch existed. The job stopped before reaching the workflow's existing orphan-branch fallback, so no history or Pages artifact was published.

Validation

  • exercised branch creation and idempotence against a temporary bare Git remote
  • verified invalid branch names are rejected
  • python3 -m py_compile .github/scripts/bootstrap_benchmark_history.py
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Automated benchmark history initialization now creates the publishing history when it is missing.
    • Benchmark publishing can reuse existing history without recreating or overwriting it.
  • Bug Fixes

    • Improved reliability when multiple publishing processes attempt initialization simultaneously.
    • Invalid history branch names are rejected with a clear error.
  • Tests

    • Added coverage for branch creation, idempotent behavior, and input validation.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview Jul 30, 2026 10:04am
workers-tech-spec Ready Ready Preview Jul 30, 2026 10:04am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 82f2434c-7560-4370-9ee9-6c993ee2ea7a

📥 Commits

Reviewing files that changed from the base of the PR and between 86c80f7 and ea743cb.

📒 Files selected for processing (3)
  • .github/scripts/bootstrap_benchmark_history.py
  • .github/scripts/tests/test_bootstrap_benchmark_history.py
  • .github/workflows/harness-e2e-benchmark.yml

📝 Walkthrough

Walkthrough

A new script initializes a missing remote gh-pages benchmark history branch with an empty commit. Tests cover idempotency and invalid names, while the benchmark workflow invokes the script and simplifies history checkout and publishing.

Changes

Benchmark history initialization

Layer / File(s) Summary
Remote branch bootstrap script
.github/scripts/bootstrap_benchmark_history.py
Adds Git helpers, remote branch detection, empty-commit creation, race-safe pushing, CLI parsing, and status reporting.
Bootstrap behavior tests
.github/scripts/tests/test_bootstrap_benchmark_history.py
Adds hermetic repository tests for empty branch creation, idempotency, and invalid branch-name validation.
Workflow bootstrap and checkout integration
.github/workflows/harness-e2e-benchmark.yml
Runs the bootstrap script before publishing, checks out gh-pages directly, and removes inline branch initialization.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant BootstrapScript
  participant GitRemote
  GitHubActions->>BootstrapScript: Run bootstrap_benchmark_history.py
  BootstrapScript->>GitRemote: Check refs/heads/gh-pages
  GitRemote-->>BootstrapScript: Return branch status
  BootstrapScript->>GitRemote: Push empty commit if missing
  GitRemote-->>BootstrapScript: Confirm branch creation
  GitHubActions->>GitRemote: Checkout gh-pages
Loading

Possibly related PRs

  • iii-hq/workers#637: Refactors the same workflow’s gh-pages benchmark-history initialization.

Poem

A bunny found a branch asleep,
And planted commits neat and deep.
The workflow hops, the pages gleam,
Tests guard each Git command and stream.
“No duplicate burrows!” cheers the hare.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/harness-e2e-gh-pages-bootstrap

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.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 49 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@ytallo
ytallo marked this pull request as ready for review July 30, 2026 10:17
@ytallo
ytallo merged commit 481d5b2 into main Jul 30, 2026
16 checks passed
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.

1 participant