Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
48 changes: 33 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
run_browser: ${{ steps.reuse.outputs.run_browser }}
run_layout: ${{ steps.reuse.outputs.run_layout }}
reuse: ${{ steps.reuse.outputs.reuse }}
red_main_oid: ${{ steps.plan.outputs.red_main_oid }}
steps:
- uses: actions/checkout@v7
with:
Expand All @@ -50,6 +51,13 @@ jobs:
with:
bun-version: "1.4.2"
- run: bun install --frozen-lockfile
# Fail fast while main is red (#2942): hosted proof whose merge ref contains
# the recorded bad commit is refused, except declared fixes. Drafts run cheap gates only.
- name: Refuse doomed proof while main is red
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: bun scripts/red-main-cli.ts gate
- name: Plan affected fast and local checks
id: plan
env:
Expand All @@ -66,6 +74,14 @@ jobs:
- name: Discover product scenario and assertion ownership
if: steps.plan.outputs.cadence != 'draft'
run: bun scripts/proof-inventory.ts
# Plan outputs and retention decisions are set before any metadata gate can
# fail, so a main push still runs its complete selected proof (#2942).
- name: Retain only validated equivalent automatic proof
id: reuse
env:
GH_TOKEN: ${{ github.token }}
PR_DRAFT: ${{ github.event.pull_request.draft }}
run: bun scripts/proof-reuse.ts
- name: Lint, leakage and contribution workflow guards
run: bun run lint
- name: Env documentation matches its descriptors
Expand All @@ -82,12 +98,6 @@ jobs:
elif [ "$GITHUB_EVENT_NAME" = push ]; then
bun scripts/check-changeset.ts "$BEFORE_SHA"
fi
- name: Retain only validated equivalent automatic proof
id: reuse
env:
GH_TOKEN: ${{ github.token }}
PR_DRAFT: ${{ github.event.pull_request.draft }}
run: bun scripts/proof-reuse.ts
- name: Retention ledger and diagnostics
if: always()
uses: actions/upload-artifact@v7
Expand All @@ -102,7 +112,7 @@ jobs:
verify:
# Packaging and verification are independent after cheap rejection gates.
needs: changeset
if: needs.changeset.outputs.verify == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.verify == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 7
steps:
Expand All @@ -123,6 +133,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Strict types and curated fast tests concurrently on this runner
id: verify_proof
Expand All @@ -142,7 +153,7 @@ jobs:

pack:
needs: changeset
if: needs.changeset.outputs.pack == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.pack == 'true' }}
timeout-minutes: 5
runs-on: ubuntu-24.04
env:
Expand Down Expand Up @@ -170,7 +181,7 @@ jobs:

unit:
needs: changeset
if: needs.changeset.outputs.unit == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.unit == 'true' }}
runs-on: ubuntu-24.04
# Separate network setup from the unchanged proof budget (#2658).
# 12 minutes setup + 30 minutes proof + 3 minutes for other steps.
Expand All @@ -194,6 +205,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Real Chrome and offline Linux namespace prerequisites
id: runtime_setup
Expand Down Expand Up @@ -250,7 +262,7 @@ jobs:

runtime:
needs: changeset
if: needs.changeset.outputs.runtime == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.runtime == 'true' }}
runs-on: ubuntu-24.04
# 12 minutes setup + unchanged 15 minutes proof + 3 minutes for other steps (#2658).
timeout-minutes: 30
Expand All @@ -268,6 +280,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Real Chrome and offline Linux namespace prerequisites
id: runtime_setup
Expand Down Expand Up @@ -318,7 +331,7 @@ jobs:

runtime_host:
needs: changeset
if: needs.changeset.outputs.runtime_host == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.runtime_host == 'true' }}
runs-on: ubuntu-24.04
# 12 minutes setup + unchanged 15 minutes proof + 3 minutes for other steps (#2658).
timeout-minutes: 30
Expand All @@ -336,6 +349,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Real Chrome and offline Linux namespace prerequisites
id: runtime_setup
Expand Down Expand Up @@ -407,7 +421,7 @@ jobs:

browser:
needs: changeset
if: needs.changeset.outputs.browser == 'true' && needs.changeset.outputs.run_browser == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.browser == 'true' && needs.changeset.outputs.run_browser == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
Expand All @@ -428,6 +442,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Complete browser proof
run: bun scripts/ci-proof.ts browser --shard=${{ matrix.shard }}/3
Expand Down Expand Up @@ -471,7 +486,7 @@ jobs:

layout:
needs: changeset
if: needs.changeset.outputs.layout == 'true' && needs.changeset.outputs.run_layout == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.layout == 'true' && needs.changeset.outputs.run_layout == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 25
strategy:
Expand All @@ -492,6 +507,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Complete layout proof
run: bun scripts/ci-proof.ts layout --shard=${{ matrix.shard }}/2
Expand Down Expand Up @@ -529,7 +545,7 @@ jobs:

captures:
needs: changeset
if: needs.changeset.outputs.captures == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.captures == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
Expand All @@ -546,6 +562,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Complete captures proof
run: bun scripts/ci-proof.ts captures
Expand Down Expand Up @@ -581,7 +598,7 @@ jobs:

endurance:
needs: changeset
if: needs.changeset.outputs.endurance == 'true'
if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.endurance == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
Expand All @@ -598,6 +615,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BEFORE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
RED_MAIN_OID: ${{ needs.changeset.outputs.red_main_oid }}
run: bun scripts/ci-plan.ts
- name: Complete endurance proof
run: bun scripts/ci-proof.ts endurance
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/heavy-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
pack: "${{ steps.plan.outputs.pack }}"
run_browser: "${{ steps.reuse.outputs.run_browser }}"
run_layout: "${{ steps.reuse.outputs.run_layout }}"
red_main_oid: "${{ steps.plan.outputs.red_main_oid }}"
base_sha: "${{ steps.admit.outputs.base_sha }}"
steps:
- uses: actions/checkout@v7
Expand All @@ -76,6 +77,10 @@ jobs:
fetch-depth: 0
ref: "${{ inputs.head_sha }}"
- run: bun install --frozen-lockfile
- name: Refuse doomed proof while main is red
env:
PR_NUMBER: "${{ inputs.pr }}"
run: bun scripts/red-main-cli.ts gate
- name: "Plan the PR's affected selection with feedback-heavy cadence"
id: plan
env:
Expand All @@ -88,7 +93,7 @@ jobs:
run: bun scripts/proof-reuse.ts
verify:
needs: changeset
if: "needs.changeset.outputs.verify == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.verify == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 7
steps:
Expand Down Expand Up @@ -127,7 +132,7 @@ jobs:
run: bun scripts/ci-verify-summary.ts
pack:
needs: changeset
if: "needs.changeset.outputs.pack == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.pack == 'true' }}"
timeout-minutes: 5
runs-on: ubuntu-24.04
env:
Expand All @@ -150,7 +155,7 @@ jobs:
run: bun scripts/ci-pack.ts
unit:
needs: changeset
if: "needs.changeset.outputs.unit == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.unit == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
Expand Down Expand Up @@ -200,7 +205,7 @@ jobs:
retention-days: 7
runtime:
needs: changeset
if: "needs.changeset.outputs.runtime == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.runtime == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -244,7 +249,7 @@ jobs:
retention-days: 7
runtime_host:
needs: changeset
if: "needs.changeset.outputs.runtime_host == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.runtime_host == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -300,7 +305,7 @@ jobs:
retention-days: 7
browser:
needs: changeset
if: "needs.changeset.outputs.browser == 'true' && needs.changeset.outputs.run_browser == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.browser == 'true' && needs.changeset.outputs.run_browser == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
Expand Down Expand Up @@ -339,7 +344,7 @@ jobs:
retention-days: 7
layout:
needs: changeset
if: "needs.changeset.outputs.layout == 'true' && needs.changeset.outputs.run_layout == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.layout == 'true' && needs.changeset.outputs.run_layout == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 25
strategy:
Expand Down Expand Up @@ -377,7 +382,7 @@ jobs:
retention-days: 7
captures:
needs: changeset
if: "needs.changeset.outputs.captures == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.captures == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
Expand Down Expand Up @@ -409,7 +414,7 @@ jobs:
retention-days: 7
endurance:
needs: changeset
if: "needs.changeset.outputs.endurance == 'true'"
if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.endurance == 'true' }}"
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/red-main-probe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Triage probe for the red-main coordinator (#2942). Reruns only the named test
# files at one SHA. A probe never counts as proof and never makes anything
# mergeable; the coordinator reads its result to decide whether main is red.
name: red-main-probe
run-name: red-main probe ${{ inputs.purpose }} ${{ inputs.source_run }} ${{ inputs.sha }}

on:
workflow_dispatch:
inputs:
purpose:
description: flake or bisect
required: true
type: choice
options: [flake, bisect]
source_run:
description: The main CI run whose failure is triaged
required: true
sha:
description: The commit to probe
required: true
tests:
description: JSON array of test files to rerun
required: true

permissions:
contents: read

jobs:
probe:
runs-on: ubuntu-24.04
# 12 minutes setup + 30 minutes proof + 3 minutes for other steps, as unit proof.
timeout-minutes: 45
steps:
- name: Validate dispatch identities
env:
SOURCE_RUN: ${{ inputs.source_run }}
PROBE_SHA: ${{ inputs.sha }}
run: |
[[ "$SOURCE_RUN" =~ ^[1-9][0-9]*$ ]] && [[ "$PROBE_SHA" =~ ^[a-f0-9]{40}$ ]]
- uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}
path: tooling
persist-credentials: false
- uses: actions/checkout@v7
with:
ref: ${{ inputs.sha }}
path: target
persist-credentials: false
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.2"
- run: bun install --frozen-lockfile
working-directory: tooling
- run: bun install --frozen-lockfile --backend=copyfile
working-directory: target
- name: Real Chrome and offline Linux namespace prerequisites
timeout-minutes: 12
working-directory: target
run: bash scripts/ci-runtime-setup.sh
- name: Rerun only the failing test files
timeout-minutes: 30
env:
PROBE_TESTS: ${{ inputs.tests }}
run: bun tooling/scripts/red-main-cli.ts probe --target target
Loading
Loading