Skip to content

ci(pre-beta): gate scheduled builds on main HEAD SHA - #1573

Merged
thepagent merged 1 commit into
mainfrom
ci/pre-beta-gate-sha
Oct 23, 2026
Merged

thepagent merged 1 commit into
mainfrom
ci/pre-beta-gate-sha

Conversation

@chaodu-obk

@chaodu-obk chaodu-obk Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What problem does this solve?

pre-beta-build.yml is scheduled hourly, and its gate builds only if main got a commit in the last ~70 minutes. In practice GitHub delivers this schedule only every ~4–5 hours (100 runs between 2026-10-01 and 2026-10-23), so most merges fall outside the window and never get built.

Evidence:

A manual full rebuild was dispatched separately (run 39886364920). This PR fixes the gate so the drift does not come back.

Discord Discussion URL: https://discord.com/channels/1490282656913559673/1562951633544020000

Review Contract

Goal

A scheduled pre-beta run builds whenever main HEAD has not yet been published by a full pre-beta build, no matter how late GitHub delivers the schedule.

Non-goals

  • No change to workflow_dispatch behavior: manual runs still always build.
  • No change to the build, tag, or oabctl jobs, or to the cron expression.
  • No rebuild trigger for base-image changes when main is unchanged. That is covered by the daily Node security check (chore(ci): add daily node-security-check workflow #1571) and the nightly lane.

Accepted Residual Risks

  • Finding the last full build costs one jobs-API call per recent successful run, until a run that tagged every agent is found. Today that is 92 calls, because the last full build is 3 weeks old. In steady state it is a handful of calls, well within GITHUB_TOKEN limits.
  • If one agent fails to build, the run is not success. The next scheduled run then rebuilds all agents, and this repeats until the failure is fixed. This is intentional: a red pre-beta should be retried, not silently skipped.
  • A partial manual build (an agents subset) does not count as a full build, so the next scheduled run rebuilds everything once.

Acceptance Criteria

  • A scheduled run with main HEAD equal to the head SHA of the last full pre-beta build logs should_run=false and skips the build.
  • A scheduled run with a newer main HEAD logs should_run=true and builds, even when the last commit is older than 70 minutes.
  • workflow_dispatch always builds.
  • The gate job has only contents: read and actions: read.

Follow-ups

How the new gate works

  1. Read the default-branch HEAD SHA.
  2. List successful pre-beta-build.yml runs on that branch, newest first. Take the first run whose tag (<agent>) jobs succeeded for every agent in ALL_AGENTS. Skipped-gate runs and partial builds are ignored.
  3. Build if that run's head_sha differs from HEAD.

Validation

  • node --check passes on the extracted github-script body. It was checked with Node 22.23.4, downloaded and verified against the official SHASUMS256.
  • The extracted script was run against the live API with a small Octokit shim (eventName=schedule):
    INFO main HEAD 2e7d189857abd57f9657bf45e959ff5e97bc8473, last full pre-beta build 99c11ec10e239c4054c304efee6b99204ac6440a -> should_run=true
    jobs API calls: 92
    
    This matches the image creation date of pre-beta-* (2026-10-03).
  • Not verified: YAML parsing with actionlint, and a real scheduled run. The schedule only runs from main.

…ndow

GitHub delivers the hourly schedule every ~4-5h, so the 'commit in the
last ~70min' gate skipped most merges. The last full pre-beta build was
99c11ec (2026-10-03); #1562, #1564, #1568 and #1569 never reached
pre-beta-*, which also kept downstream openab-pty images on Node 22.23.3.

Build when main HEAD differs from the head SHA of the last successful
run that tagged every agent.
@chaodu-obk
chaodu-obk Bot requested a review from thepagent as a code owner October 23, 2026 01:54
@thepagent
thepagent merged commit 9702995 into main Oct 23, 2026
4 of 5 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.

2 participants