Repository navigation
CC-19: Swift compile gate (hosted macOS CI + ruleset handoff) - #236
Conversation
Sequence Swift CI on macos-14 with PR cancel-in-progress so each PR uses one macOS runner at a time. Name jobs for ruleset required contexts and document Jay’s admin steps. Mac Release waits for Swift CI on main pushes. Co-authored-by: Jay Wedgeworth <jaywedgeworth22@users.noreply.github.com>
Co-authored-by: Jay Wedgeworth <jaywedgeworth22@users.noreply.github.com>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Use always() on the release job if: so pull_request and workflow_dispatch runs still build after await-swift-ci is skipped (GitHub otherwise injects success() and skips release). Co-authored-by: Jay Wedgeworth <jaywedgeworth22@users.noreply.github.com>
|
❌ Error processing validation An error occurred while processing the system response. Please try again. Details
|
|
|
||
| jobs: | ||
| await-swift-ci: | ||
| if: github.event.repository.fork == false && github.event_name == 'push' |
There was a problem hiding this comment.
Manual workflow_dispatch of the mac-release workflow publishes a Sparkle release without any Swift CI compile check because await-swift-ci is gated to github.event_name == 'push' only, causing await-swift-ci.result == 'skipped' to be treated as a green light and defeating the CC-19 gate. Loosen the await-swift-ci if to just github.event.repository.fork == false so release gates on result == 'success' for all triggers.
await-swift-ci:
if: github.event.repository.fork == falsePrompt for LLM
File .github/workflows/mac-release.yml:
Line 59:
Manual `workflow_dispatch` of the `mac-release` workflow publishes a Sparkle release without any Swift CI compile check because `await-swift-ci` is gated to `github.event_name == 'push'` only, causing `await-swift-ci.result == 'skipped'` to be treated as a green light and defeating the CC-19 gate. Loosen the `await-swift-ci` if to just `github.event.repository.fork == false` so `release` gates on `result == 'success'` for all triggers.
Suggested Code:
await-swift-ci:
if: github.event.repository.fork == false
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| while [ "$(date +%s)" -lt "$deadline" ]; do | ||
| payload="$(gh api "repos/${REPO}/commits/${SHA}/check-runs?per_page=100")" |
There was a problem hiding this comment.
The check-runs poll in await-swift-ci fetches ?per_page=100 once per iteration with no server-side name filter or Link header pagination, so required checks like Mac package build and test and iOS companion compile on page 2+ of a mature repo's check-runs list are never detected, keeping pending at 1 until the 5100s deadline. Filter the gh api call with an encoded &check_name= parameter per required check to ensure the gate sees all required entries.
while [ "$(date +%s)" -lt "$deadline" ]; do
pending=0
failed=0
for check_name in "${required_checks[@]}"; do
enc_name=$(printf '%s' "$check_name" | python3 -c 'import sys,urllib.parse;print(urllib.parse.quote(sys.stdin.read(),safe=""))')
payload="$(gh api "repos/${REPO}/commits/${SHA}/check-runs?per_page=100&check_name=${enc_name}")"Prompt for LLM
File .github/workflows/mac-release.yml:
Line 75 to 76:
The check-runs poll in `await-swift-ci` fetches `?per_page=100` once per iteration with no server-side name filter or `Link` header pagination, so required checks like `Mac package build and test` and `iOS companion compile` on page 2+ of a mature repo's check-runs list are never detected, keeping `pending` at 1 until the 5100s deadline. Filter the `gh api` call with an encoded `&check_name=` parameter per required check to ensure the gate sees all required entries.
Suggested Code:
while [ "$(date +%s)" -lt "$deadline" ]; do
pending=0
failed=0
for check_name in "${required_checks[@]}"; do
enc_name=$(printf '%s' "$check_name" | python3 -c 'import sys,urllib.parse;print(urllib.parse.quote(sys.stdin.read(),safe=""))')
payload="$(gh api "repos/${REPO}/commits/${SHA}/check-runs?per_page=100&check_name=${enc_name}")"
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
CC-19 — CodeCaps had no compile gate: Swift CI ran but ruleset
default-main-protection(24433457) required no status checks, and parallelmacos-latestjobs could starve the queue.Summary
Adds the CC-19 hosted Swift compile gate for CodeCaps. The change wires Swift CI job names into required status-check contexts, serializes the iOS companion compile behind the Mac package build, cancels stale pull-request runs, and makes Mac Release wait for those Swift CI checks on push commits before publishing a Sparkle release. It also adds rollout documentation for the repository-admin handoff needed to configure the existing ruleset.
Functional changes
Swift CI (
.github/workflows/swift-ci.yml)Mac package build and testandiOS companion compileso GitHub reports stable status contexts for required checks.workflow_dispatchsupport.companiondepend onpackage(needs: package), ensuring a PR does not hold two macOS runners at once and that companion compile runs only after the package job succeeds.Mac Release (
.github/workflows/mac-release.yml)await-swift-cijob for non-forkpushevents onubuntu-latest.Mac package build and testandiOS companion compileon the current commit.failure,cancelled,timed_out,action_required, orstale; waits while checks are missing or pending; and times out after roughly 85 minutes.releasejob depend onawait-swift-ciand proceed only when the gate succeeded or was skipped.Rollout documentation (
docs/rollouts/2026-10-15-cc19-compile-gate.md)default-main-protection(24433457):Mac package build and testiOS companion compilegitleaksAgent documentation (
AGENTS.md)default-main-protectionruleset.Rollout / verification
main.Automated review findings
The automated review reported three findings against this PR:
.github/workflows/mac-release.yml—workflow_dispatchofmac-releasebypasses theawait-swift-cigate, allowing Sparkle releases without compile verification..github/workflows/mac-release.yml— the single-page check-runs fetch can miss Swift CI checks on busy commits, causing the gate to time out.