Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-guards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,7 @@ jobs:
python3 tests/test_nightly_promotion_admission.py
python3 tests/test_nightly_next_promotion_queue.py
python3 tests/test_nightly_next_feed_watch.py
python3 tests/test_nightly_next_rolling.py
python3 tests/test_ci_nightly_push_throttle.py
python3 tests/test_ci_nightly_off_blacksmith.py
python3 tests/test_classic_nightly_build_runner.py
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/nightly-next-feed-watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ name: nightly-next feed watch
# which Lawrence and Leo daily-drive. nightly.yml's own alarm runs only inside
# nightly-next push runs, so a stall before promotion (a red Release compile,
# an unpublished cmux-tui tree) never raised it. A schedule runs only from the
# default branch, so this lives on main. Every 30 minutes it measures how long
# default branch, so this lives on main. Every 10 minutes it measures how long
# feat-cmux-next pushes have waited for the feed (limit 30 minutes) and keeps one
# `nightly-next-feed-stale` issue naming the stuck stage
# (scripts/ci/nightly_next_feed_watch.py, tested by
# tests/test_nightly_next_feed_watch.py). It also requests the continuation
# run that publishes a build Apple accepted after its run stopped waiting, and
# dispatches a current-tip build after 25 minutes without a publication when
# no nightly or promotion run is active. The guard covers classic NIGHTLY too.
# dispatches a current-tip build after 20 minutes without a publication when
# no started nightly-next build has the tip or a commit containing it as its
# head (a run queued 10 minutes without a runner is not started; main's runs
# never count). The guard covers classic NIGHTLY too. The
# tick (nightly-next-tick.yml) asks at landing; this is the backstop, and at
# :07/:37 with a 25-minute trigger it could not meet the 30-minute bound.
on:
schedule:
- cron: "7,37 * * * *"
- cron: "2-59/10 * * * *"
workflow_dispatch:

permissions: {}
Expand Down
83 changes: 59 additions & 24 deletions .github/workflows/nightly-next-tick.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
name: nightly-next tick

# The nightly-next cadence: every 30 minutes this tick moves nightly-next to the
# newest feat-cmux-next commit that is buildable (published, daemon-tested
# cmux-tui tree, fresh strings; scripts/cmux-next/request-nightly-next.sh), and
# that push starts exactly one nightly build. Main's promote job ignores a
# request that does not move nightly-next forward, so a tick with nothing new
# starts nothing. Builds are never cancelled: a tick may start a newer build
# beside a running one, and publication is latest-wins (publish-nightly's
# check-build recheck refuses a build no newer than the feed).
# The nightly-next cadence: this tick moves nightly-next to the newest
# feat-cmux-next commit that is buildable (published, daemon-tested cmux-tui
# tree, fresh strings; scripts/cmux-next/request-nightly-next.sh), and that push
# starts exactly one nightly build. Main's promote job ignores a request that
# does not move nightly-next forward, so a tick with nothing new starts nothing.
# Builds are never cancelled: a tick may start a newer build beside a running
# one, and publication is latest-wins (publish-nightly's check-build recheck
# refuses a build no newer than the feed).
#
# When it runs: at landing (a feat-cmux-next cmux-next or cmux-tui artifacts
# push run finishing, the two things that make a commit buildable), when a
# nightly-next build finishes, on a 5-minute backstop cron, and by dispatch
# (a person, or nightly-next-feed-watch.yml when the feed falls behind). Whether
# it promotes is the rolling rule (scripts/ci/nightly_next_rolling.py): at once
# when nothing is building nightly-next, else once the oldest landing the
# running build does not carry has waited 10 minutes, so a burst of landings
# becomes one build of the newest tip beside the running one. A dispatch for
# one commit skips the rule.
#
# Until 2026-10-28 every cmux-next or cmux-tui artifacts run on feat-cmux-next
# also promoted (workflow_run here, and request-nightly-next in those
# workflows), so each landing started a full Release build: six ran at once on
# 2026-10-28 and only the newest could publish. Leo: "every 30 mins or so you
# do it / within 30min you replace". Only the tick promotes now: its request
# carries the "tick:" prefix (the gh shim below marks it), and main's promote
# job skips a request without it from github-actions[bot], since older
# revisions of request-nightly-next.sh still send one on every landing
# (promote-nightly-next.mjs decideRequest). The tick also sets
# NIGHTLY_NEXT_PROMOTE=1, without which newer revisions only report. A
# person's dispatch still promotes. Landing to live on /next/ is then at most
# 30 minutes plus one build, sign and publish. nightly-next-feed-watch.yml dispatches this tick
# when the feed falls behind, the backstop for a tick GitHub's scheduler drops.
# A schedule runs only from the default branch: this file must exist on main.
# promoted with no such rule (workflow_run here, and request-nightly-next in
# those workflows), so each landing started a full Release build: six ran at
# once on 2026-10-28 and only the newest could publish. Leo: "every 30 mins or
# so you do it / within 30min you replace". Then a 30-minute cron alone kept the
# feed 45-50 minutes behind each landing (Leo, 2026-10-29: "and where are the
# nightlies!?"). Only the tick promotes: its request carries the "tick:" prefix
# (the gh shim below marks it), and main's promote job skips a request without
# it from github-actions[bot], since older revisions of request-nightly-next.sh
# still send one on every landing (promote-nightly-next.mjs decideRequest). The
# tick also sets NIGHTLY_NEXT_PROMOTE=1, without which newer revisions only
# report. A schedule and workflow_run run only from the default branch: this
# file must exist on main.
on:
workflow_run:
workflows: ["cmux-next", "cmux-tui artifacts", "Nightly macOS build"]
branches: [feat-cmux-next, nightly-next]
types: [completed]
schedule:
- cron: "7,37 * * * *"
- cron: "4-59/5 * * * *"
workflow_dispatch:
inputs:
sha:
Expand All @@ -36,9 +49,16 @@ on:

permissions: {}

env:
# `workflows:` spells display names; these are the files behind them
# (tests/test_ci_workflow_run_sources.py).
SOURCE_WORKFLOW_PATHS: .github/workflows/cmux-next.yml .github/workflows/cmux-tui-artifacts.yml .github/workflows/nightly.yml

jobs:
request:
if: github.repository == 'manaflow-ai/cmux'
# A workflow_run counts only for this repository's own push runs: feat-cmux-next
# landings and nightly-next builds.
if: github.repository == 'manaflow-ai/cmux' && (github.event_name != 'workflow_run' || github.event.workflow_run.event == 'push' && github.event.workflow_run.head_repository.full_name == github.repository)
runs-on: ${{ github.repository_owner != 'manaflow-ai' && 'ubuntu-24.04' || 'blacksmith-2vcpu-ubuntu-2404' }}
# 15 minutes of work, plus the hour its gh calls may wait for a rate limit (below).
timeout-minutes: 75
Expand Down Expand Up @@ -78,6 +98,8 @@ jobs:
sparse-checkout: |
scripts/ci/gh_budget_wait.sh
scripts/ci/nightly_next_cancelled_tip.sh
scripts/ci/nightly_next_feed_watch.py
scripts/ci/nightly_next_rolling.py
scripts/ci/nightly_repick.py
scripts/ci/owned_pool_rescue.py
scripts/ci/owned_pool_sources.py
Expand Down Expand Up @@ -133,8 +155,21 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: bash .tick-tooling/scripts/ci/nightly_next_cancelled_tip.sh "$GITHUB_REPOSITORY"

# The rolling rule (scripts/ci/nightly_next_rolling.py): promote at once when nothing is
# building nightly-next, else once the oldest landing the running build does not carry
# has waited 10 minutes. A dispatch for one commit skips it. It reads through the API only;
# its failure modes are in the script's docstring.
- name: Apply the rolling rule
id: rolling
if: vars.NIGHTLY_NEXT_TRAIN != 'on' && inputs.sha == ''
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
WINDOW_MINUTES: ${{ vars.NIGHTLY_NEXT_ROLLING_MINUTES || '10' }}
run: python3 .tick-tooling/scripts/ci/nightly_next_rolling.py --repo "$GITHUB_REPOSITORY" --tip "$(git rev-parse HEAD)" --window-minutes "$WINDOW_MINUTES"

- name: Request nightly-next promotion on main
if: vars.NIGHTLY_NEXT_TRAIN != 'on'
if: vars.NIGHTLY_NEXT_TRAIN != 'on' && steps.rolling.outputs.go != 'false'
env:
GH_TOKEN: ${{ github.token }}
# The cadence: request-nightly-next.sh dispatches a promotion only from here.
Expand Down
Loading
Loading