ci(release): a nightly waits 5 minutes for more merges, and still builds once an hour while they keep coming #40

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:nightly-wait into main 2026-11-16 02:37:37 +00:00
Owner

Type: ci · Risk: low · Tested on: none (CI only, checked by CI) · Needs: a look at the Release runs after merging

Why

Every push to main started its nightly straight away. When a few PRs merge in a row, the first one builds on its own and the others queue behind it, so we build more nightlies than we need. This makes the nightly wait 5 minutes for more merges. While merges keep coming, it still ships one at least once an hour.

What changed

The version job now waits before naming a nightly: a few merges in a row build one nightly, 5 minutes after the last of them. Tags (releases) don't wait. The same change goes to Longshot and LongshotLauncher.

  • .forgejo/workflows/release-agent.yml, the version job (push to main only):
    • If its commit is still main's, it sleeps 300 s and fetches main again.
    • If main has moved on (before or after the wait), it skips as before, so the newer run builds.
    • It doesn't skip when the newest published nightly is an hour old, or when that can't be found out. In that case it builds, so continuous merges can't hold a nightly back forever.
    • Skipping a stale run happens before the sleep, so a backlog of queued runs clears without each one waiting 5 minutes.
  • agent/scripts/release.py: nightly-age / nightly_age(rels, now) returns the seconds since the newest published nightly came out (by count, from published_at, else created_at), or none.
  • agent/tests/test_release.py: a test for nightly_age.

The wait runs on the quick runner. Its capacity went from 1 to 8 so that it has room for this (MagicBeanDev/Infra, runner/quick/config.yml).

Measurements

Verdict: nothing to measure. This changes when CI builds a nightly, not what the nightly contains.

Flags and settings

None.

Testing

Tested: both Python files compile. CI runs agent/tests/test_release.py on this PR. Per the person I work for, no checks run on this PC.

Not tested: the wait itself. It only runs on a push to main.

Must be tested:

  • Forgejo, after merging: merge two PRs within 5 minutes of each other, expecting one nightly, of the second, with the first run's version job saying "main has moved on" (by hand: the Release runs)

Risks

What could break: a nightly comes out 5 minutes later than before. The version job's timeout is 10 minutes, so the wait fits.

Turning it off: revert the commit.

Compatibility: nothing changes.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • agent/tests/test_release.py passes (any failure that also fails on main is named): run by CI on this PR.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

🤖 Generated with Claude Code

**Type:** ci · **Risk:** low · **Tested on:** none (CI only, checked by CI) · **Needs:** a look at the Release runs after merging ## Why Every push to main started its nightly straight away. When a few PRs merge in a row, the first one builds on its own and the others queue behind it, so we build more nightlies than we need. This makes the nightly wait 5 minutes for more merges. While merges keep coming, it still ships one at least once an hour. ## What changed The `version` job now waits before naming a nightly: a few merges in a row build one nightly, 5 minutes after the last of them. Tags (releases) don't wait. The same change goes to Longshot and LongshotLauncher. - `.forgejo/workflows/release-agent.yml`, the `version` job (push to main only): - If its commit is still main's, it sleeps 300 s and fetches main again. - If main has moved on (before or after the wait), it skips as before, so the newer run builds. - It doesn't skip when the newest published nightly is an hour old, or when that can't be found out. In that case it builds, so continuous merges can't hold a nightly back forever. - Skipping a stale run happens before the sleep, so a backlog of queued runs clears without each one waiting 5 minutes. - `agent/scripts/release.py`: `nightly-age` / `nightly_age(rels, now)` returns the seconds since the newest published nightly came out (by count, from `published_at`, else `created_at`), or `none`. - `agent/tests/test_release.py`: a test for `nightly_age`. The wait runs on the `quick` runner. Its capacity went from 1 to 8 so that it has room for this (MagicBeanDev/Infra, `runner/quick/config.yml`). ## Measurements **Verdict:** nothing to measure. This changes when CI builds a nightly, not what the nightly contains. ### Flags and settings None. ## Testing **Tested:** both Python files compile. CI runs `agent/tests/test_release.py` on this PR. Per the person I work for, no checks run on this PC. **Not tested:** the wait itself. It only runs on a push to main. **Must be tested:** - Forgejo, after merging: merge two PRs within 5 minutes of each other, expecting one nightly, of the second, with the first run's `version` job saying "main has moved on" (by hand: the Release runs) ## Risks **What could break:** a nightly comes out 5 minutes later than before. The version job's timeout is 10 minutes, so the wait fits. **Turning it off:** revert the commit. **Compatibility:** nothing changes. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `agent/tests/test_release.py` passes (any failure that also fails on `main` is named): run by CI on this PR. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ci(release): a nightly waits 5 minutes for more merges, and still builds once an hour while they keep coming
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 8s
CI / Coordinator tests (pull_request) Has been cancelled
CI / Agent build and checks (pull_request) Has been cancelled
CI / Coordinator image (pull_request) Has been cancelled
2b6c7d9704
A push to main started its nightly at once, so the first merge of a few in a row built alone and the
rest queued behind it. Now the version job waits 5 minutes when its commit is still main's; one whose
commit is no longer main's skips, as before, unless the newest nightly is an hour old
(release.py nightly-age), so a steady stream of merges still ships a nightly each hour. Tags do not wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch nightly-wait 2026-11-16 02:37:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!40
No description provided.