Skip to content

ci: let main's CI go before pull request runs - #766

Merged
M4n0x merged 1 commit into
mainfrom
ci/main-ci-first
Nov 16, 2026
Merged

M4n0x merged 1 commit into
mainfrom
ci/main-ci-first

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Problem

GitHub runs only a few macOS jobs at once for the account and has no way to give a workflow run priority. Pull request runs hold those slots for up to an hour (Draw screens alone can take 45 minutes), so main's CI queues behind them and betas come late. On 2026-11-16, main's Build release for the #731 merge waited 88 minutes for a runner, and the #742 merge's run waited 1 h 40 behind it in main's concurrency group.

Changes

  • Pause pull requests (new job in ci.yml, Linux, actions: write): when a run on main builds (a push, or a beta or stable run by hand), it cancels the CI runs of pull requests that are requested, pending, queued or in progress, and keeps their IDs.
  • Resume pull requests (new job, Linux, actions: write and pull-requests: read): needs every macOS job of main's run and runs with always(), so it runs whether they passed, failed or were cancelled. For each paused run it calls Re-run failed jobs, which reruns only the cancelled jobs and keeps the ones that had passed. It skips a run whose pull request was closed or has a newer commit, a run that has a newer run for the same commit, and a run someone already restarted.
  • CONTRIBUTING.md says so where CI is described and under When CI fails; DECISIONS.md records that main's CI goes first.

Neither job reads anything from a pull request except run IDs and commit SHAs, and both run only on main.

Known trade-offs:

  • A pull request run that starts while main is already building isn't paused. Its jobs queue behind main's jobs that were already waiting, but main's later jobs (Docs images, Beta) can still queue behind it.
  • While main builds, a paused pull request shows a cancelled run, and the Screens comment and Visual review report it as cancelled, until the restarted run finishes and Screens reconciles again.

Testing

  • actionlint: nothing new (its existing warnings on Draw the base's screens and the release app token are on main too).
  • Ran both scripts' selection against this repository with cancel and rerun replaced by echo: with no pull request runs active, the pause finds nothing. The resume would restart the 4 pull request runs I cancelled by hand today.
  • In a private scratch repository (deleted afterwards), a workflow cancelled another run with GITHUB_TOKEN and then ran gh run rerun --failed on it with GITHUB_TOKEN:
    • Only the cancelled job ran again; the job that had passed kept its first attempt.
    • A workflow_run listener fired after the cancel and again after the re-run finished, with github-actions[bot] as the triggering actor. So screens.yml reconciles the restarted run.
  • Past runs here show that Re-run failed jobs reruns cancelled jobs, and that Test uploads test-results again on a re-run without clashing with the first attempt's artifact.
  • Not tested: the jobs themselves. They run only on main, so the first push to main after this merges is their first real run.

Merging

One commit: any merge method works. ci: makes no release.

Claude Opus 5.5 via Claude Code

GitHub runs only a few macOS jobs at once for the account and has no priorities. Main's Build
release waited 88 minutes behind pull request jobs on 2026-11-16, and the next push to main
waited behind that run.

A run on main now cancels the pull request runs waiting or running when it starts, and restarts
their cancelled jobs once its own macOS jobs are done, unless the pull request was closed or got
a newer commit in the meantime.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 16, 2026 21:33
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 01bf12a and 14bdc8d.

Files selected for processing: 3

  • .github/workflows/ci.yml
  • CONTRIBUTING.md
  • DECISIONS.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Before and after

main at 01bf12a → this pull request at 14bdc8d · 204 screens drawn in one CI job · 0 changed

204 unchanged screens

docs/essentials-clock-settings-dark, docs/essentials-clock-settings-light, docs/essentials-dark, docs/essentials-light, docs/essentials-settings-dark, docs/essentials-settings-light, docs/hero-dark, docs/hero-light, docs/popups-dark, docs/popups-light, docs/settings-dark, docs/settings-light, docs/themes-dark, docs/themes-light, scenes/accessibility-guide-dark, scenes/accessibility-guide-light, scenes/app-menu-popup-dark, scenes/app-menu-popup-light, scenes/apple-menu-settings-dark, scenes/apple-menu-settings-light, scenes/bottom-bar-popup-dark, scenes/bottom-bar-popup-light, scenes/chat-popup-dark, scenes/chat-popup-light, scenes/crowded-edit-bar-dark, scenes/crowded-edit-bar-light, scenes/disk-meter-bar-dark, scenes/disk-meter-bar-light, scenes/dock-badges-bar-dark, scenes/dock-badges-bar-light, scenes/edit-bar-wide-group-dark, scenes/edit-bar-wide-group-light, scenes/essentials-clock-popup-dark, scenes/essentials-clock-popup-light, scenes/essentials-disk-popup-dark, scenes/essentials-disk-popup-light, scenes/filled-slider-popup-dark, scenes/filled-slider-popup-light, scenes/group-members-bar-dark, scenes/group-members-bar-light, scenes/gruvbox-bar-dark, scenes/gruvbox-bar-light, scenes/horizontal-list-popup-dark, scenes/horizontal-list-popup-light, scenes/increase-contrast-bar-dark, scenes/increase-contrast-bar-light, scenes/increase-contrast-popup-dark, scenes/increase-contrast-popup-light, scenes/input-source-popup-dark, scenes/input-source-popup-light, scenes/merged-status-bar-dark, scenes/merged-status-bar-light, scenes/notch-flare-bar-dark, scenes/notch-flare-bar-light, scenes/output-device-popup-dark, scenes/output-device-popup-light, scenes/popup-gap-bar-dark, scenes/popup-gap-bar-light, scenes/popup-spacing-bar-dark, scenes/popup-spacing-bar-light, scenes/popup-view-dark, scenes/popup-view-light, scenes/privacy-both-bar-dark, scenes/privacy-both-bar-light, scenes/privacy-hide-when-idle-bar-dark, scenes/privacy-hide-when-idle-bar-light, scenes/privacy-idle-bar-dark, scenes/privacy-idle-bar-light, scenes/privacy-microphone-bar-dark, scenes/privacy-microphone-bar-light, scenes/privacy-settings-dark, scenes/privacy-settings-light, scenes/reduce-transparency-bar-dark, scenes/reduce-transparency-bar-light, scenes/reduce-transparency-glass-bar-dark, scenes/reduce-transparency-glass-bar-light, scenes/ring-bar-dark, scenes/ring-bar-light, scenes/settings-bar-dark, scenes/settings-bar-light, scenes/settings-bar-placement-bottom-dark, scenes/settings-bar-placement-bottom-light, scenes/settings-bar-placement-dark, scenes/settings-bar-placement-light, scenes/settings-crashes-dark, scenes/settings-crashes-light, scenes/settings-disk-widget-dark, scenes/settings-disk-widget-light, scenes/settings-feedback-dark, scenes/settings-feedback-light, scenes/settings-general-dark, scenes/settings-general-light, scenes/settings-general-macos15-dark, scenes/settings-general-macos15-light, scenes/settings-general-move-dark, scenes/settings-general-move-failed-dark, scenes/settings-general-move-failed-light, scenes/settings-general-move-light, scenes/settings-general-move-moving-dark, scenes/settings-general-move-moving-light, scenes/settings-general-move-replace-dark, scenes/settings-general-move-replace-light, scenes/settings-general-setup-open-dark, scenes/settings-general-setup-open-light, scenes/settings-general-spaces-dark, scenes/settings-general-spaces-light, scenes/settings-help-dark, scenes/settings-help-light, scenes/settings-help-starred-dark, scenes/settings-help-starred-light, scenes/settings-narrow-dark, scenes/settings-narrow-light, scenes/settings-package-dark, scenes/settings-package-light, scenes/settings-package-widget-dark, scenes/settings-package-widget-light, scenes/settings-profiles-dark, scenes/settings-profiles-light, scenes/settings-profiles-theme-dark, scenes/settings-profiles-theme-light, scenes/settings-store-dark, scenes/settings-store-light, scenes/settings-theme-dark, scenes/settings-theme-light, scenes/settings-theme-link-dark, scenes/settings-theme-link-light, scenes/settings-uninstall-dark, scenes/settings-uninstall-failed-dark, scenes/settings-uninstall-failed-light, scenes/settings-uninstall-light, scenes/settings-widget-backgrounds-dark, scenes/settings-widget-backgrounds-light, scenes/settings-workspace-hidden-dark, scenes/settings-workspace-hidden-light, scenes/setup-look-below-menu-bar-dark, scenes/setup-look-dark, scenes/setup-look-no-notch-dark, scenes/setup-move-existing-dark, scenes/setup-move-failed-dark, scenes/setup-move-ready-dark, scenes/setup-move-replace-dark, scenes/setup-omniwm-connection-dark, scenes/setup-permissions-dark, scenes/setup-permissions-spaces-dark, scenes/setup-permissions-spaces-ready-dark, scenes/setup-placement-bottom-dark, scenes/setup-placement-dark, scenes/setup-touches-dark, scenes/setup-touches-macos15-dark, scenes/setup-touches-spaces-dark, scenes/setup-try-dark, scenes/setup-yabai-connection-dark, scenes/slider-end-stop-popup-dark, scenes/slider-end-stop-popup-light, scenes/stablebar-widget-bar-dark, scenes/stablebar-widget-bar-light, scenes/stablebar-widget-settings-dark, scenes/stablebar-widget-settings-light, scenes/starter-bar-dark, scenes/starter-bar-light, scenes/starter-edit-bar-dark, scenes/starter-edit-bar-light, scenes/symbol-variants-bar-dark, scenes/symbol-variants-bar-light, scenes/system-monitor-memory-bar-dark, scenes/system-monitor-memory-bar-light, scenes/system-monitor-shows-settings-dark, scenes/system-monitor-shows-settings-light, scenes/system-monitor-split-warning-bar-dark, scenes/system-monitor-split-warning-bar-light, scenes/update-popup-dark, scenes/update-popup-light, scenes/update-popup-star-github-cli-dark, scenes/update-popup-star-github-cli-light, scenes/update-popup-star-thanks-dark, scenes/update-popup-star-thanks-light, scenes/workspace-badges-bar-dark, scenes/workspace-badges-bar-light, scenes/workspace-focused-window-bar-dark, scenes/workspace-focused-window-bar-light, scenes/workspace-focused-window-padding-bar-dark, scenes/workspace-focused-window-padding-bar-light, scenes/workspace-hidden-apps-bar-dark, scenes/workspace-hidden-apps-bar-light, site/404-desktop-dark, site/404-desktop, site/404-phone-dark, site/404-phone, site/create-theme-desktop-dark, site/create-theme-desktop, site/create-theme-phone-dark, site/create-theme-phone, site/index-desktop-dark, site/index-desktop, site/index-phone-dark, site/index-phone, site/privacy-desktop-dark, site/privacy-desktop, site/privacy-phone-dark, site/privacy-phone, and 4 more

Visual review: 204 screens, none changed.

@M4n0x
M4n0x merged commit b47a3e7 into main Nov 16, 2026
17 checks passed
@M4n0x
M4n0x deleted the ci/main-ci-first branch November 16, 2026 22:14
M4n0x added a commit that referenced this pull request Nov 17, 2026
Pause pull requests cancelled every pull request run when main's CI started, and Resume pull
requests restarted their cancelled jobs once main's macOS jobs were done. main stopped waiting for
a Mac, but over the 26 hours to 2026-11-17 20:00 the cut-off jobs threw away about 1,590 macOS
minutes. Paused pull requests showed failed checks until the restart, and the restart reran the
same merge commit, so its results were against the main from before the merge that paused it.
Before #766, only one run on main had waited long for a Mac: 88 minutes on 2026-11-16.

Both jobs are gone, and main's runs wait for a free Mac like pull requests' do. CONTRIBUTING, the
screens bot's comment and the DECISIONS entry say so, and the entry records why.
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant