Skip to content

ci/nightly: SHA-gate cron, publish dated nightly-* releases, BUILD_ID in os-release#2111

Merged
widgetii merged 1 commit into
masterfrom
ci/nightly-preflight-and-dated-releases
May 20, 2026
Merged

ci/nightly: SHA-gate cron, publish dated nightly-* releases, BUILD_ID in os-release#2111
widgetii merged 1 commit into
masterfrom
ci/nightly-preflight-and-dated-releases

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

PR-A of six in the nightly-build redesign. Touches only CI and one rootfs script; no on-device flag day.

  • Preflight gate — new preflight job in build.yml reads the sha= line from the rolling nightly release body and skips the matrix on schedule events when HEAD matches. PRs and workflow_dispatch always build (this PR will itself trigger a full matrix as proof).
  • Three release tags per build
    • nightly-YYYYMMDD-<short> (prerelease, content-addressable, the unit of history),
    • nightly (rolling channel pointer, body carries sha=/short=/built_at=),
    • latest (legacy alias, kept one cycle so existing camera sysupgrade clients on the old hardcoded URL don't break).
  • BUILD_ID / BUILD_SHA in /usr/lib/os-release — emitted from general/scripts/rootfs_script.sh. Local make BOARD=… builds keep working via a local-YYYYMMDD-<hash> fallback. The buildroot job exports BUILD_ID/BUILD_SHA from preflight outputs at the job level so the rootfs script sees them and so the Telegram caption can reference them.
  • Telegram caption — now leads with Build: nightly-YYYYMMDD-<short> (the Tag: ${TAG_NAME} line is gone because the now-dead workflow-level env: TAG_NAME: latest was removed).

This PR is reviewable as ~70 lines of YAML + 2 lines of shell. Subsequent PRs (sequenced):

  • PR-B: manifest aggregator on gh-pages + retention sweep
  • PR-C: sysupgrade --channel/--build/--list-builds (pure busybox)
  • PR-D: host-side contrib/openipc-bisect (independent)
  • PR-E: build-one.yml accepts arbitrary commit (independent)
  • PR-F: image.yml downstream of build.yml via workflow_run

Notes for reviewers

  • First-run safety. When the rolling nightly release doesn't exist yet, gh release view nightly errors, PREV is empty, and the gate falls through to build. The first cron after merge always builds.
  • Tag pollution on revert. Reverting this PR after some nightly-* releases have been published leaves those tags orphaned. They're harmless (no consumer yet — PR-B introduces the manifest), but happy to add a contrib/cleanup-nightly-tags.sh one-shot in a follow-up if you'd prefer a clean revert path.

Test plan

  • CI runs on this PR (event pull_request) and the full ~90-board matrix completes — proves the gate doesn't break the non-schedule path.
  • After merge, manual workflow_dispatch produces both a dated nightly-YYYYMMDD-<short> release and updates the rolling nightly (check release bodies contain sha=).
  • After merge, the next scheduled cron (with no new commits) takes the skip branch — only Preflight job appears in the run, ~10s.
  • Flash one lab camera with an artifact from the dated release; cat /etc/os-release | grep BUILD_ shows BUILD_ID=nightly-… and BUILD_SHA=<40-hex>.
  • Telegram caption on the next published build leads with Build: nightly-….

🤖 Generated with Claude Code

… in os-release

The nightly cron at 22:30 UTC currently rebuilds ~90 boards even when
HEAD hasn't moved since the last published build, then overwrites a
single rolling `latest` GitHub release that erases all history of
prior nightlies. Three coordinated changes here:

1. Preflight job in build.yml compares HEAD to the `sha=` recorded in
   the rolling `nightly` release body and short-circuits the matrix on
   `schedule` events when they match. PRs and workflow_dispatch always
   build.

2. The matrix now publishes to three release tags: dated
   `nightly-YYYYMMDD-<short>` (prerelease, content-addressable),
   rolling `nightly` (the channel pointer), and `latest` (legacy alias
   kept for one cycle so existing sysupgrade clients hitting the old
   URL don't break).

3. `general/scripts/rootfs_script.sh` adds BUILD_ID and BUILD_SHA to
   /usr/lib/os-release with sensible local-build fallbacks. The
   buildroot job exports these from the preflight outputs so the
   rootfs picks them up; the Telegram caption gains `Build: <build_id>`
   and drops the now-empty `Tag:` line.

This is PR-A of six; subsequent PRs add a manifest aggregator on
gh-pages, retention sweep, sysupgrade --channel/--build/--list-builds,
host-side openipc-bisect, build-one.yml commit input, and downstream
image.yml wiring.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 5e0d0b7 into master May 20, 2026
93 checks passed
@widgetii widgetii deleted the ci/nightly-preflight-and-dated-releases branch May 20, 2026 17:30
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