From 27a2c7c7722d522816573e966f29f206d20bc228 Mon Sep 17 00:00:00 2001 From: Yosuke Shimizu Date: Wed, 2 Dec 2026 20:06:38 +0900 Subject: [PATCH] ci: split pr-osp-select by README section - pr-osp-select.yml becomes pr-osp-select-network.yml, pr-osp-select-auth-crypto.yml and pr-osp-select-validation.yml, grouped by the job's section in the workflows README. Each file has its own select job, workflow name and concurrency group. - pr-osp-retry.yml listens to all three workflow names and accepts all three file paths. - The workflows README maps each file to its sections, states the 50-workflow limit, and names the file for each command and for ci:perf. --- .github/workflows/README.md | 31 ++++-- .github/workflows/pr-osp-retry.yml | 15 ++- .../workflows/pr-osp-select-auth-crypto.yml | 103 ++++++++++++++++++ ...p-select.yml => pr-osp-select-network.yml} | 92 ++-------------- .../workflows/pr-osp-select-validation.yml | 87 +++++++++++++++ 5 files changed, 231 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/pr-osp-select-auth-crypto.yml rename .github/workflows/{pr-osp-select.yml => pr-osp-select-network.yml} (62%) create mode 100644 .github/workflows/pr-osp-select-validation.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 781bf77a..1fce1e03 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -71,10 +71,21 @@ merge. Dispatch this workflow once to seed ghcr. ### Running a nightly job on a PR (label toggles) -`pr-osp-select.yml` lets you pull any nightly job into a PR on demand — -to fix or validate it before it has to wait for the next nightly. You -toggle jobs with **labels**, not code edits; `nightly-osp.yml` and the -per-app workflows stay untouched. +The `pr-osp-select-*.yml` workflows let you pull any nightly job into a +PR on demand — to fix or validate it before it has to wait for the next +nightly. You toggle jobs with **labels**, not code edits; +`nightly-osp.yml` and the per-app workflows stay untouched. + +GitHub limits one workflow file to 50 referenced workflows, nested calls +included, so the jobs are split across three files by their section in +[What runs in the nightly fan-out](#what-runs-in-the-nightly-fan-out). +Every label triggers all three files. + +| File | Sections | +|------|----------| +| `pr-osp-select-network.yml` | Networking, VPN, file transfer; Web, messaging, libraries; Wireless | +| `pr-osp-select-auth-crypto.yml` | Auth, identity, PKI, smart cards; TPM, disk crypto, hashing | +| `pr-osp-select-validation.yml` | Internal validations + sweeps, and every job outside those tables (`multi-compiler`, `musl`, `perf`, `libacvp-pqc`) | | Label | Effect | |-------|--------| @@ -96,13 +107,15 @@ drop the labels — nothing to revert in the tree. Off-PR equivalent (runs against a branch, no labels): ```bash -gh workflow run pr-osp-select.yml --ref -f jobs="hostap curl" -gh workflow run pr-osp-select.yml --ref -f jobs="all" +gh workflow run pr-osp-select-network.yml --ref -f jobs="hostap curl" +for f in network auth-crypto validation; do + gh workflow run pr-osp-select-$f.yml --ref -f jobs="all" +done ``` > Adding a brand-new OSP workflow? Append a matching label block to -> `pr-osp-select.yml` (same `needs: select` + `if:` pattern) so it's -> reachable via `ci:`. +> the `pr-osp-select-*.yml` file for its README section (same +> `needs: select` + `if:` pattern) so it's reachable via `ci:`. ### What runs in the nightly fan-out @@ -341,7 +354,7 @@ FIPS CAST code is compiled out of non-FIPS builds, so only the FIPS row exercises the DH-derive CAST that originally regressed. It runs nightly on its own cron, and can be pulled into a PR on demand by -adding the `ci:perf` label (via `pr-osp-select.yml`, same as the OSP jobs). +adding the `ci:perf` label (via `pr-osp-select-validation.yml`, same as the OSP jobs). Run it locally: diff --git a/.github/workflows/pr-osp-retry.yml b/.github/workflows/pr-osp-retry.yml index 08ba84f4..fc7facf5 100644 --- a/.github/workflows/pr-osp-retry.yml +++ b/.github/workflows/pr-osp-retry.yml @@ -4,7 +4,10 @@ name: PR OSP retry on: workflow_run: - workflows: ["PR OSP (label-selected)"] + workflows: + - "PR OSP (label-selected, network)" + - "PR OSP (label-selected, auth-crypto)" + - "PR OSP (label-selected, validation)" types: [completed] permissions: @@ -28,10 +31,12 @@ jobs: WF_PATH: ${{ github.event.workflow_run.path }} run: | # A fork controls both the workflow name and a new file's path, so pin the path. - if [ "$WF_PATH" != ".github/workflows/pr-osp-select.yml" ]; then - echo "::error::untrusted triggering workflow: $WF_PATH" - exit 1 - fi + case "$WF_PATH" in + .github/workflows/pr-osp-select-network.yml) ;; + .github/workflows/pr-osp-select-auth-crypto.yml) ;; + .github/workflows/pr-osp-select-validation.yml) ;; + *) echo "::error::untrusted triggering workflow: $WF_PATH"; exit 1 ;; + esac # Distinguish "not a collaborator" (404) from an API failure; never conflate them. if ! body=$(gh api "/repos/$REPO/collaborators/$ACTOR/permission" 2>&1); then case "$body" in diff --git a/.github/workflows/pr-osp-select-auth-crypto.yml b/.github/workflows/pr-osp-select-auth-crypto.yml new file mode 100644 index 00000000..6c2f4c6c --- /dev/null +++ b/.github/workflows/pr-osp-select-auth-crypto.yml @@ -0,0 +1,103 @@ +name: PR OSP (label-selected, auth-crypto) + +# Run any nightly OSP / sweep job on a PR by adding a label. Add +# `ci:` (e.g. ci:hostap) to run that job, or `ci:all` for the +# whole set. Add several at once and they run in ONE run per file: +# the burst of label events collapses (cancel-in-progress) to a single +# run whose select reads every current ci:* label. Re-add a label to +# re-run after a push. workflow_dispatch `jobs` input is the off-PR +# equivalent (space list, or "all"). +# +# GitHub caps one workflow file at 50 referenced workflows, nested calls +# included, so the jobs are split across pr-osp-select-network.yml, +# pr-osp-select-auth-crypto.yml and pr-osp-select-validation.yml, by +# their section in .github/workflows/README.md. Every label triggers +# all three files. + +on: + pull_request: + types: [labeled] + workflow_dispatch: + inputs: + jobs: + description: "space-separated job names, or 'all'" + required: false + default: "" + +permissions: + contents: read + packages: write + actions: read + +concurrency: + group: pr-osp-select-auth-crypto-${{ github.ref }} + cancel-in-progress: true + +jobs: + select: + runs-on: ubuntu-latest + outputs: + run: ${{ steps.p.outputs.run }} + steps: + - id: p + env: + LABELS: ${{ join(github.event.pull_request.labels.*.name, ' ') }} + DISPATCH: ${{ github.event.inputs.jobs }} + run: | + sel="" + for l in $LABELS; do + case "$l" in + ci:*) sel="$sel ${l#ci:}" ;; + esac + done + [ -n "$DISPATCH" ] && sel="$sel $DISPATCH" + echo "run= $sel " >> "$GITHUB_OUTPUT" + + git-ssh-dr: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' git-ssh-dr ') + uses: ./.github/workflows/git-ssh-dr.yml + krb5: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' krb5 ') + uses: ./.github/workflows/krb5.yml + libcryptsetup: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libcryptsetup ') + uses: ./.github/workflows/libcryptsetup.yml + libfido2: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libfido2 ') + uses: ./.github/workflows/libfido2.yml + libhashkit2: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libhashkit2 ') + uses: ./.github/workflows/libhashkit2.yml + libtss2: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libtss2 ') + uses: ./.github/workflows/libtss2.yml + openldap: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' openldap ') + uses: ./.github/workflows/openldap.yml + opensc: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' opensc ') + uses: ./.github/workflows/opensc.yml + pam-pkcs11: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' pam-pkcs11 ') + uses: ./.github/workflows/pam-pkcs11.yml + sscep: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' sscep ') + uses: ./.github/workflows/sscep.yml + sssd: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' sssd ') + uses: ./.github/workflows/sssd.yml + tpm2-tools: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' tpm2-tools ') + uses: ./.github/workflows/tpm2-tools.yml diff --git a/.github/workflows/pr-osp-select.yml b/.github/workflows/pr-osp-select-network.yml similarity index 62% rename from .github/workflows/pr-osp-select.yml rename to .github/workflows/pr-osp-select-network.yml index b1be7b2b..b50eff3c 100644 --- a/.github/workflows/pr-osp-select.yml +++ b/.github/workflows/pr-osp-select-network.yml @@ -1,12 +1,18 @@ -name: PR OSP (label-selected) +name: PR OSP (label-selected, network) # Run any nightly OSP / sweep job on a PR by adding a label. Add # `ci:` (e.g. ci:hostap) to run that job, or `ci:all` for the -# whole set. Add several at once and they all run in ONE workflow run: +# whole set. Add several at once and they run in ONE run per file: # the burst of label events collapses (cancel-in-progress) to a single # run whose select reads every current ci:* label. Re-add a label to # re-run after a push. workflow_dispatch `jobs` input is the off-PR # equivalent (space list, or "all"). +# +# GitHub caps one workflow file at 50 referenced workflows, nested calls +# included, so the jobs are split across pr-osp-select-network.yml, +# pr-osp-select-auth-crypto.yml and pr-osp-select-validation.yml, by +# their section in .github/workflows/README.md. Every label triggers +# all three files. on: pull_request: @@ -24,7 +30,7 @@ permissions: actions: read concurrency: - group: pr-osp-select-${{ github.ref }} + group: pr-osp-select-network-${{ github.ref }} cancel-in-progress: true jobs: @@ -59,14 +65,6 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' curl ') uses: ./.github/workflows/curl.yml - debian-package: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' debian-package ') - uses: ./.github/workflows/debian-package.yml - git-ssh-dr: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' git-ssh-dr ') - uses: ./.github/workflows/git-ssh-dr.yml grpc: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' grpc ') @@ -79,30 +77,10 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' iperf ') uses: ./.github/workflows/iperf.yml - krb5: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' krb5 ') - uses: ./.github/workflows/krb5.yml - libacvp-pqc: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libacvp-pqc ') - uses: ./.github/workflows/libacvp-pqc.yml - libcryptsetup: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libcryptsetup ') - uses: ./.github/workflows/libcryptsetup.yml libeac3: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libeac3 ') uses: ./.github/workflows/libeac3.yml - libfido2: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libfido2 ') - uses: ./.github/workflows/libfido2.yml - libhashkit2: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libhashkit2 ') - uses: ./.github/workflows/libhashkit2.yml libnice: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libnice ') @@ -119,10 +97,6 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libssh2 ') uses: ./.github/workflows/libssh2.yml - libtss2: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libtss2 ') - uses: ./.github/workflows/libtss2.yml libwebsockets: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libwebsockets ') @@ -143,30 +117,14 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' nginx-pqc ') uses: ./.github/workflows/nginx-pqc.yml - openldap: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' openldap ') - uses: ./.github/workflows/openldap.yml - opensc: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' opensc ') - uses: ./.github/workflows/opensc.yml openssh: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' openssh ') uses: ./.github/workflows/openssh.yml - openssl-version: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' openssl-version ') - uses: ./.github/workflows/openssl-version.yml openvpn: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' openvpn ') uses: ./.github/workflows/openvpn.yml - pam-pkcs11: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' pam-pkcs11 ') - uses: ./.github/workflows/pam-pkcs11.yml ppp: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' ppp ') @@ -187,18 +145,6 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' socat ') uses: ./.github/workflows/socat.yml - sscep: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' sscep ') - uses: ./.github/workflows/sscep.yml - sssd: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' sssd ') - uses: ./.github/workflows/sssd.yml - static-analysis: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' static-analysis ') - uses: ./.github/workflows/static-analysis.yml stunnel: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' stunnel ') @@ -215,10 +161,6 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' tnftp ') uses: ./.github/workflows/tnftp.yml - tpm2-tools: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' tpm2-tools ') - uses: ./.github/workflows/tpm2-tools.yml x11vnc: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' x11vnc ') @@ -227,19 +169,3 @@ jobs: needs: select if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' xmlsec ') uses: ./.github/workflows/xmlsec.yml - multi-compiler: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' multi-compiler ') - uses: ./.github/workflows/nightly-multi-compiler.yml - musl: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' musl ') - uses: ./.github/workflows/musl.yml - fips-ready: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' fips-ready ') - uses: ./.github/workflows/nightly-fips-ready.yml - perf: - needs: select - if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' perf ') - uses: ./.github/workflows/perf-regression.yml diff --git a/.github/workflows/pr-osp-select-validation.yml b/.github/workflows/pr-osp-select-validation.yml new file mode 100644 index 00000000..78a9cfad --- /dev/null +++ b/.github/workflows/pr-osp-select-validation.yml @@ -0,0 +1,87 @@ +name: PR OSP (label-selected, validation) + +# Run any nightly OSP / sweep job on a PR by adding a label. Add +# `ci:` (e.g. ci:hostap) to run that job, or `ci:all` for the +# whole set. Add several at once and they run in ONE run per file: +# the burst of label events collapses (cancel-in-progress) to a single +# run whose select reads every current ci:* label. Re-add a label to +# re-run after a push. workflow_dispatch `jobs` input is the off-PR +# equivalent (space list, or "all"). +# +# GitHub caps one workflow file at 50 referenced workflows, nested calls +# included, so the jobs are split across pr-osp-select-network.yml, +# pr-osp-select-auth-crypto.yml and pr-osp-select-validation.yml, by +# their section in .github/workflows/README.md. Every label triggers +# all three files. + +on: + pull_request: + types: [labeled] + workflow_dispatch: + inputs: + jobs: + description: "space-separated job names, or 'all'" + required: false + default: "" + +permissions: + contents: read + packages: write + actions: read + +concurrency: + group: pr-osp-select-validation-${{ github.ref }} + cancel-in-progress: true + +jobs: + select: + runs-on: ubuntu-latest + outputs: + run: ${{ steps.p.outputs.run }} + steps: + - id: p + env: + LABELS: ${{ join(github.event.pull_request.labels.*.name, ' ') }} + DISPATCH: ${{ github.event.inputs.jobs }} + run: | + sel="" + for l in $LABELS; do + case "$l" in + ci:*) sel="$sel ${l#ci:}" ;; + esac + done + [ -n "$DISPATCH" ] && sel="$sel $DISPATCH" + echo "run= $sel " >> "$GITHUB_OUTPUT" + + debian-package: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' debian-package ') + uses: ./.github/workflows/debian-package.yml + libacvp-pqc: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' libacvp-pqc ') + uses: ./.github/workflows/libacvp-pqc.yml + openssl-version: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' openssl-version ') + uses: ./.github/workflows/openssl-version.yml + static-analysis: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' static-analysis ') + uses: ./.github/workflows/static-analysis.yml + multi-compiler: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' multi-compiler ') + uses: ./.github/workflows/nightly-multi-compiler.yml + musl: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' musl ') + uses: ./.github/workflows/musl.yml + fips-ready: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' fips-ready ') + uses: ./.github/workflows/nightly-fips-ready.yml + perf: + needs: select + if: contains(needs.select.outputs.run, ' all ') || contains(needs.select.outputs.run, ' perf ') + uses: ./.github/workflows/perf-regression.yml