diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 807ae5ea1c3e..b7ac740058fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: # is the macOS desktop build only. With the variable unset a push to main # builds everything. if: github.event_name != 'push' || vars.MERGE_QUEUE_ENABLED != 'true' - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 20 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -298,7 +298,7 @@ jobs: # (build-desktop.yml) still ships every platform unconditionally. desktop-matrix: name: Resolve desktop matrix - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} # The work is seconds: a shallow checkout, a depth-1 fetch of one base SHA # and a paths-filter. 5, not the 15 ci.yml's `changes` resolver carries -- # that one's `fetch-depth: 0` full-history fetch is what has run past 5 on diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 735db5998ff2..ee15bdf5cb3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: # With the variable unset a push to main runs this job and the full matrix # behind it. Every heavy job `needs` this one, so skipping it skips them all. if: github.event_name != 'push' || vars.MERGE_QUEUE_ENABLED != 'true' - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} # 15, not 5: the job's own work is seconds, but its `fetch-depth: 0` # checkout (paths-filter and the leaf resolver diff against the merge base # with local git) is a full-history fetch of a large repository, and on a @@ -559,7 +559,7 @@ jobs: # push path needs the barrier. With the variable unset, Fast Gate runs on # the push too (fast-gate.yml has a push trigger) and this job consumes it. if: github.event_name != 'push' || vars.MERGE_QUEUE_ENABLED != 'true' - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 15 permissions: # actions:read is what lets this read another workflow's runs. Job-level @@ -635,7 +635,7 @@ jobs: # runs on which await-fast-gate runs. `push` is listed for main alone, and # the ref is restated so a later trigger on another branch cannot reach it. if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.MERGE_QUEUE_ENABLED != 'true' - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 15 permissions: # actions:write is what lets this cancel its own run (it also covers the diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index b67c24f769d2..d8ed640fca52 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -18,7 +18,7 @@ concurrency: jobs: autosde-rules: name: Automated Rule Check - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -215,7 +215,7 @@ jobs: # separately — this gate prevents new ones from landing. inclusive-language: name: Inclusive Language - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -314,7 +314,7 @@ jobs: # as an image, so the engine stays pinned on both pools. sast: name: SAST (Semgrep) - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} # The baseline scan re-runs every rule on the merge-base for each changed # file, so the job's length grows with the diff: 2-3 min on the CodeBuild # fleet for a typical PR, but 9-14 min measured on ubuntu-latest for a large @@ -387,7 +387,7 @@ jobs: # line stops impersonating one. pr-hygiene: name: PR Hygiene - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 09ad14395d3c..248f71e08771 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -34,7 +34,7 @@ concurrency: jobs: license-gate: name: Dependency License Gate - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/fast-gate.yml b/.github/workflows/fast-gate.yml index ff05591acf02..5d50c3ba70cb 100644 --- a/.github/workflows/fast-gate.yml +++ b/.github/workflows/fast-gate.yml @@ -83,7 +83,7 @@ jobs: # unlisted actors and forks fall back to `ubuntu-latest` without skipping # a gate. The AWS webhook independently enforces actor admission; this # expression controls availability, not the security boundary. - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} # Fourteen gates of a few seconds each, plus one checkout and one Python # setup. A green run is well under five minutes; the cap is a hang # backstop, not a budget. @@ -400,7 +400,7 @@ jobs: # backend shards too; this job only moves the verdict earlier. name: Static Ratchet Gate if: github.event_name != 'push' || vars.MERGE_QUEUE_ENABLED != 'true' - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -452,7 +452,7 @@ jobs: # and publish the report. name: Flake Pattern Ratchet if: github.event_name != 'push' || vars.MERGE_QUEUE_ENABLED != 'true' - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || github.event_name == 'merge_group' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} # 15, not 10: the warn-only network step below may use up to 5 minutes of its # own after the ratchet, and the job cap must not turn that into a red job. timeout-minutes: 15 diff --git a/.github/workflows/macos-on-demand.yml b/.github/workflows/macos-on-demand.yml index b1de928f4cbd..1ef04a8e8ac5 100644 --- a/.github/workflows/macos-on-demand.yml +++ b/.github/workflows/macos-on-demand.yml @@ -99,7 +99,7 @@ jobs: # fork's darwin verdict before merge adds `ci:macos`. decide: name: Decide whether the macOS suite runs - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} timeout-minutes: 5 permissions: contents: read diff --git a/.github/workflows/pr-policy.yml b/.github/workflows/pr-policy.yml index 9df66a99ffe8..8870f3e8381d 100644 --- a/.github/workflows/pr-policy.yml +++ b/.github/workflows/pr-policy.yml @@ -119,7 +119,7 @@ concurrency: jobs: pr-policy: name: PR Policy - runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && contains(fromJSON(vars.CODEBUILD_ACTOR_IDS || '[]'), github.actor_id) && (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.pull_request.head.repo.full_name == github.repository)) && format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) || github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' || 'ubuntu-latest' }} # Two depth-2 checkouts, one `GET pulls/` and a few seconds of grep each. timeout-minutes: 5 steps: diff --git a/docs/ci/ci-and-reviews.md b/docs/ci/ci-and-reviews.md index 56cb7bc40ba0..2ca537795dbb 100644 --- a/docs/ci/ci-and-reviews.md +++ b/docs/ci/ci-and-reviews.md @@ -1258,7 +1258,7 @@ AWS role and no App credential, and `fork-opus-review` already pairs egress block that contains the fork matcher is unaffected. **The Windows group has a tighter cap.** `kirocrew-windows-4-core` is capped at -`maximum_runners: 32`, against the Linux definition's 100, so the Windows legs +`maximum_runners: 32`, against the Linux definition's 200, so the Windows legs have far less headroom to spend. Nothing gets faster on either: both definitions are 4 vCPU and 16 GB, so the **Nothing gets faster** paragraph above applies unchanged -- only queue position moves, and the minutes become billed ones. @@ -1274,13 +1274,20 @@ way as any other site: restore `runs-on: ${{ matrix.os }}` on the affected line, which returns all three legs to the hosted images in one edit. **The fleet-fallback sites reach the group by LABEL instead, because they must -choose at run time.** `build-wheel.yml`, `dependency-vulnerability.yml`, -`pr-merge-conflict-label.yml` and both `pages.yml` jobs keep their CodeBuild -fleet route and changed only what happens when the fleet does not admit the run. +choose at run time.** Twenty jobs take this form. Six fire on no pull request at +all -- `build-wheel.yml`, `dependency-vulnerability.yml`, +`pr-merge-conflict-label.yml`, both `pages.yml` jobs, and `ci.yml`'s +`cancel-superseded-run`, whose `if:` is a push to `main` -- and fourteen are the +pull-request lanes: `code-review.yml`'s four, `fast-gate.yml`'s three, +`ci.yml`'s `changes` and `await-fast-gate`, `build.yml`'s `build-wheel` and +`desktop-matrix`, `pr-policy.yml`, `dependency-review.yml`'s `license-gate` and +`macos-on-demand.yml`'s `decide`. +Every one keeps its CodeBuild fleet route and changed only what happens when the +fleet does not admit the run. A conditional cannot name the group: the fleet's runners are REPOSITORY-level self-hosted runners and are not members of this organization group, so no single `runs-on` names both destinations. The rename exposure that group targeting -avoids therefore applies to these five lines -- **rename the definition and they +avoids therefore applies to all twenty lines -- **rename the definition and they must move with it** -- which is why the expected strings live in one place, `_GROUP_THEN_HOSTED_TAIL` in `test/test_ci_fleet_routing_expression_parity.py`. @@ -1297,25 +1304,58 @@ actor, event and repository truth table rather than string-matching it, and reads the expected non-fleet value off the policy's own expression, so a policy that moves later is covered without editing the assertion. -**Why these five were kept to a non-PR-time batch.** None of them fires on -`pull_request`, so none adds PR-time occupancy to a cap the review lanes already -compete for. The -two reusable ones are called only by `nightly.yml` and `release.yml`, and -neither of those is itself called by anything. - -`main-ratchet-audit.yml` meets that test and is still **deliberately left -hosted**, which is the more useful rule to carry away: "not a pull-request -event" is not the same as "off the merge path". It admits `merge_group`, and +**What the first five bought, and what the PR-time fourteen cost.** The first +batch fired on no `pull_request` at all, so it added no PR-time occupancy to a +cap the review lanes already compete for; the two reusable ones are called only +by `nightly.yml` and `release.yml`, and neither of those is itself called by +anything. The fourteen pull-request lanes do add that occupancy, which is the +whole of what their move trades for: in exchange, a run the fleet turns away +stops landing on the enterprise-shared standard pool. + +**What reaches this leg is mostly NOT fork traffic, which is the thing to +measure rather than assume.** The fleet branch admits the `pull_request` actions +`opened` and `synchronize` only, and these workflows subscribe to more than +that: `code-review.yml` adds `reopened` and `edited`, `pr-policy.yml` adds +`reopened`, `edited`, `labeled` and `unlabeled`, `dependency-review.yml` adds +`reopened`, `labeled` and `unlabeled`, and `macos-on-demand.yml` adds `reopened` +and `labeled`. So every label a bot adds or removes, and every description edit, +on an ordinary same-repository pull request from a listed actor misses the fleet +and lands here. Measured over one 6-hour window on the two workflows carrying +most of it, 317 of 357 such jobs (88%) were same-repository runs on a +non-admitted action and only 40 (11%) were fork pull requests. A merge group +queued by an unlisted actor lands here too. + +**Size the added occupancy before adding a site, and size it as concurrency +rather than as a monthly total**, because these lanes fire on the same +pull-request traffic as the lanes already on the group -- their peaks coincide +rather than averaging out. Read it from the jobs API as **Capacity** below asks, +and read each job's REQUESTED labels rather than modelling admission: the runs +API does not expose a run's triggering action, so a model built on the event +alone counts every `labeled` and `edited` run as fleet-admitted and understates +this leg. + +`main-ratchet-audit.yml` also fires on no pull request, and is still +**deliberately left hosted** -- but read why carefully, because the obvious +reason is no longer the true one. It admits `merge_group`, and `merge-queue-readiness.yml` polls it on every merge group, treating a queued run -as pending and failing the group closed once its budget runs out. Routing it to -a capped group would put merge capacity behind the pull-request lanes that -already compete for that cap, which is the failure **Capacity** below describes. -Moving it needs the merge-group leg handled on purpose, not as a side effect, so -it waits for its own change. `test/test_ci_additional_fleet_routes.py` covers -its policy while it is still hosted, and -`test_the_ratchet_audit_route_stays_off_the_larger_runner_group` pins the hosted -tail directly, so moving it means deleting that assertion on purpose rather than -discovering the merge-queue hazard afterwards. The direct pin is there because +as pending and failing the group closed once its budget runs out. + +That hazard is real and it is **no longer unique to this workflow.** The queue +polls six workflows, and three of them -- `ci.yml`, `fast-gate.yml` and +`build.yml` -- now reach the group on exactly the same leg: a merge group queued +by an actor outside `CODEBUILD_ACTOR_IDS` misses the fleet and takes the group +label. Several `ci.yml` jobs reach it unconditionally already, with no fleet +branch at all. So every merge group already waits on this cap, and the honest +statement is that moving the ratchet audit would add less merge-path exposure +than is already there -- not that keeping it hosted protects merge capacity. + +What keeps it out is narrower: it is the one site whose hosted tail is pinned by +a dedicated assertion rather than derived, so moving it means deleting +`test_the_ratchet_audit_route_stays_off_the_larger_runner_group` on purpose. +That is a deliberate decision with its own evidence, not a line to carry along +inside a change about the pull-request lanes, so it waits for its own change. +`test/test_ci_additional_fleet_routes.py` covers its policy while it is still +hosted. The direct pin is there because the truth table alone would not catch it: that table derives its expected value from the expression under test, so a change editing the constant and the workflow together carries the expectation along and passes. @@ -1324,9 +1364,9 @@ workflow together carries the expectation along and passes. queueing holds every merge.** `pr-readiness.yml`'s `readiness` job keeps its CodeBuild fleet route -- a same-repository `pull_request_target` run from a listed actor -- and changed only what happens when the fleet does not admit the -run, so it carries the same `_GROUP_THEN_HOSTED_TAIL` as the five above and the -same rename exposure applies to its line. It is the exception to **Why these -five were kept to a non-PR-time batch**: it fires on `pull_request_target`, and +run, so it carries the same `_GROUP_THEN_HOSTED_TAIL` as the twenty above and the +same rename exposure applies to its line. What sets it apart from the other +pull-request lanes is not the event: it fires on `pull_request_target`, and it publishes the required `PR Readiness` status itself rather than being polled for one, so when it queues there is no other lane to be waiting behind. @@ -1355,7 +1395,7 @@ jobs API filtered on `runner_group_name` as **Capacity** below asks, and treat a lengthening hold window as the rollback trigger rather than waiting for a wrong verdict to be acted on. -Rollback is the fleet-preserving recipe the five above use, and **this is the +Rollback is the fleet-preserving recipe the twenty above use, and **this is the line to restore first** when the group is at its cap, because every merge is behind it: drop the middle branch so the expression's tail is `|| 'ubuntu-latest' }}` again, and in `_CANONICAL_READINESS_EXPR` REPLACE `_GROUP_THEN_HOSTED_TAIL` @@ -1419,7 +1459,7 @@ runs-on: ${{ github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-cor As above, this is about a fork running its own copy, not about a fork pull request against this repository: that `pull_request` run executes in the base repository, so `github.repository` matches and all six lanes do land on the -group, against `kirocrew-linux-4-core`'s `maximum_runners: 100`. A +group, against `kirocrew-linux-4-core`'s `maximum_runners: 200`. A `merge_group` run does the same. The rename exposure the group form avoids is real and accepted here: renaming @@ -1520,22 +1560,27 @@ sit here rather than queueing on the shared pool, and the move is a one-line revert per file. Treat this as reversible spend and revisit it if that project is ever built. -**Capacity.** The definition is capped at `maximum_runners: 100`, a per-runner +**Capacity.** The definition is capped at `maximum_runners: 200`, a per-runner limit established when the runner is created; raising it goes through GitHub Support rather than the organization settings page, so it is not self-service. +Read the live value rather than this number before reasoning against it +(`gh api /orgs/kirodotdev/actions/hosted-runners`): the cap is raised through a +Support request that leaves no mark on this page, so a capacity argument built +on a stale figure here can be wrong by a factor of two. **Measure this definition's own peak from the jobs API filtered on `runner_group_name` before putting more load on it**, rather than extrapolating from the shared pool's peak-to-mean ratio, which is an aggregate a subset's burst pattern need not match. Exceeding the cap is not a failure state, just a -worse one than headroom: jobs queue against our own 100 slots instead of the +worse one than headroom: jobs queue against our own 200 slots instead of the shared pool, and because these lanes feed `PR Readiness` the cost of being wrong shows up as slower merges rather than as a broken check. Rollback is per site and needs no AWS or runner-group change: restore `runs-on: ubuntu-latest` on the affected line -- except on the two `ci.yml` matrix lanes, where the line goes back to `runs-on: ${{ matrix.os }}` instead, -so the rollback does not send the Windows leg to Linux. The six fleet-fallback -sites are the exception twice over. It is not a whole-line replacement there, because the +so the rollback does not send the Windows leg to Linux. The twenty +fleet-fallback sites, plus `readiness`, are the exception twice over. +It is not a whole-line replacement there, because the fleet route has to survive: drop the middle branch so the expression's tail is `|| 'ubuntu-latest' }}` again, and drop `_GROUP_THEN_HOSTED_TAIL` from that policy's constant. And it is **not per site but per policy** -- the three diff --git a/test/test_ci_fleet_routing_expression_parity.py b/test/test_ci_fleet_routing_expression_parity.py index 6c848150c701..f60b4ca01d78 100644 --- a/test/test_ci_fleet_routing_expression_parity.py +++ b/test/test_ci_fleet_routing_expression_parity.py @@ -40,9 +40,20 @@ # event tests; this one decides only which non-fleet destination is reachable, # so neither can be derived from the other. # -# Not every constant below carries this tail yet. The ones that do not are the -# ones whose workflows have not moved, and their literal hosted fallback is the -# current contract, not an oversight. +# One ROUTING constant below does not carry this tail: +# _CANONICAL_DISPATCH_MERGE_GROUP_EXPR, whose workflow is +# `main-ratchet-audit.yml`. Its literal hosted fallback is the current contract, +# not an oversight: that site's hosted tail is pinned by a dedicated assertion, +# `test_the_ratchet_audit_route_stays_off_the_larger_runner_group`, rather than +# derived from the expression, so moving it means deleting that assertion on +# purpose and belongs in its own change. The merge queue polling that workflow +# is NOT what sets it apart -- the queue polls `ci.yml`, `fast-gate.yml` and +# `build.yml` too, and their merge-group leg already reaches the group whenever +# the queuing actor is not on the allowlist. +# +# The resolver-consumer constants do not carry the tail either, for an unrelated +# reason: an EMPTY resolver output means the resolver did not run, and hosted is +# the only safe answer there. _GROUP_THEN_HOSTED_TAIL = ( "|| github.repository == 'kirodotdev/KiroCrew' && 'kirocrew-linux-4-core' " "|| 'ubuntu-latest' }}" @@ -54,7 +65,7 @@ "(github.event.action == 'opened' || github.event.action == 'synchronize') && " "github.event.pull_request.head.repo.full_name == github.repository)) && " "format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) " - "|| 'ubuntu-latest' }}" + + _GROUP_THEN_HOSTED_TAIL ) # The workflows the merge queue runs. A merge_group run's actor is the person # who queued the pull request, so the same actor predicate admits it; the event @@ -67,7 +78,7 @@ "(github.event.action == 'opened' || github.event.action == 'synchronize') && " "github.event.pull_request.head.repo.full_name == github.repository)) && " "format('codebuild-kirocrew-gha-linux-{0}-{1}', github.run_id, github.run_attempt) " - "|| 'ubuntu-latest' }}" + + _GROUP_THEN_HOSTED_TAIL ) _CANONICAL_PUSH_EXPR = ( "${{ github.repository == 'kirodotdev/KiroCrew' && " diff --git a/test/test_ci_windows_canary.py b/test/test_ci_windows_canary.py index 6766b8a98314..4e880550ca84 100644 --- a/test/test_ci_windows_canary.py +++ b/test/test_ci_windows_canary.py @@ -76,9 +76,17 @@ def test_all_actual_routes_require_repository_event_and_admitted_actor( for step_id in ("runner", "windows-runner"): step = next(s for s in jobs["changes"]["steps"] if s.get("id") == step_id) assert _expression(step["env"]["ELIGIBLE"], context) == expected + # Fleet admission is what this test pins; the destination a REJECTED run + # takes is two-valued and depends only on where the run executes. In this + # repository it is the larger-runner group's own label, which keeps the run + # off the enterprise-shared standard pool. Anywhere else -- a fork running + # this workflow on its own `main` -- no organization runner group is + # reachable, so the hosted image is the only destination that can serve it. for name in ("changes", "await-fast-gate"): assert _expression(jobs[name]["runs-on"], context) == ( - "codebuild-kirocrew-gha-linux-100-2" if expected else "ubuntu-latest" + "codebuild-kirocrew-gha-linux-100-2" + if expected + else ("kirocrew-linux-4-core" if repository == _REPO else "ubuntu-latest") )