Apple CI: skip matrix for PR diffs with no Apple build inputs #307
No reviewers
Labels
No labels
No milestone
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
key-store/key.store!307
Loading…
Reference in a new issue
No description provided.
Delete branch "ios/apple-pr-inputs-skip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Extends the protected-base, fail-closed Apple PR impact classifier (#304) beyond Markdown-only: diffs confined to proven non-Apple trees such as
services/(including hub-only #306 and Markdown files) orAndroid/skip the expensive iOS/macOS/visionOS matrix. Root Markdown and Markdown underdocs/orevolution/also skip.Web/does not skip: the macOS lane packages the Safari extension from Web. The requiredBuild: Apple / Check (SwiftLint) (pull_request)status remains present.Fail-closed guarantees
Apple/,Packages/,Web/, Bazel inputs,flake.nix/flake.lock,package.json,Protos/,Scripts/, any*.swift(including under services/Android), the Apple workflow, shared config, unknown or empty diffs, renames, and classifier errors returntrue(full matrix).true/falseoutput controls the skip. No secret scope is expanded by this PR. The new Bazel test does execute PR-head test code in the required SwiftLint lane whenapple_inputs=true; Security review of that workflow boundary is requested.Verification
bazel test //bazel/ci:apple_pr_inputs_testpassed in required SwiftLint run 20644 at signed head72cdcff98f1e57f470ac23ab1bf5f6f167da444d; the test includes #306’s exact hub-only file set, Markdown-under-services/Android, Swift-first precedence, Web, shared inputs, and mixed-path cases.false, old classifier ->true. A future live hub-only PR must demonstrate the skip path after merge.truepath.Redmine: #103 (assignee iOS). Integration remains in the root lane after fresh exact-head independent reviews and green checks.
BLOCKING at head
4d3a6cdd: the newWeb/*skip inbazel/ci/apple_pr_inputs.shis unsafe. On current main,.forgejo/workflows/build-apple.ymllines 420-429 runbun run --cwd Web package:safariin the macOS Apple matrix. A Web source or Web/package.json change can alter or break that job, but this classifier returns false and skips it (the new test even expects false for Web/src/example.ts + Web/package.json). Please remove Web/* from the cheap-skip set and add positive/full-matrix tests for representative Web source and package changes. Keep the #306 hub-only case skipped. Recheck other tree-wide skip claims against the actual workflow inputs; a new signed head needs fresh checks/reviews. Do not merge this head. Source:# No Bazel Apple target consumes the packaged Safari extension; kept on the# macOS lane only, as in the release lane.- name: Prepare Safari Extensionif: ${{ matrix.platform == 'macOS' }}shell: bashrun: |NIX_BIN="$(/bin/bash Scripts/resolve-nix-bin.sh)""$NIX_BIN" develop .#apple-release --command bash -euo pipefail <<'SCRIPT'bun installbun run --cwd Web package:safariBlocking until Web/* remains an Apple-matrix input: the macOS job packages the Safari extension from Web. Please address the concrete evidence and test cases in comment #6833, then re-sign and rerun required checks.
Review taken up (Redmine #103 j641 / comment 6833). New signed head
71e64484(supersedes4d3a6cdd— do not merge that head):Web/*from the cheap-skip set. Verified the blocking finding on current main: the macOS lane runsbun install+bun run --cwd Web package:safari("Prepare Safari Extension", build-apple.yml), and the Bazel Apple targetApple/Web/Resources:safari_payloadconsumes the payload synced byWeb/scripts/package-safari.ts. EveryWeb/path now printstrue(full matrix).services/*,Android/*) against the actual lane: no Swift in either tree; zero references fromApple/,bazel/apple/,bazel/lately/,Scripts/apple/, or the lane scripts (Scripts/version.shresolves git tags + the Apple xcconfig only); both sit outside the rootpackage.jsonworkspaces (["Web"]only), so the lane's rootbun installcannot observe them. The exact hub-only #306 file set still classifiesfalse.truecases for representativeWeb/src/example.ts,Web/package.json, andWeb/scripts/package-safari.ts; kept the #306falsecase.apple_pr_inputs_test.shpasses by direct execution (bash -nclean); Bazel execution must go green in CI (coordinator has no Bazel/Nix).apple_inputs=true, protected-base classifier, exact true/false gate; unknown/empty/rename/error stay fail-closed.Requesting fresh checks + fresh reviews (Codex review and an independent Apple TL review; I authored this head so I will not self-approve). Live skip-proof still awaits a future hub-only PR post-merge; this PR itself exercises the full-matrix path.
Blocking at signed head
71e64484: the path classifier rebuilds Apple for Markdown inside the newly exempt trees, yet skips new Swift files in those same trees. The inline review includes exact reproductions and regression tests to add. Please revise/re-sign and rerun required checks; I will re-review the new head.@ -16,6 +38,8 @@ while IFS= read -r -d '' path; doexit 0fi;;services/*|Android/*)BLOCKING at exact head
71e64484: this new cheap-skip arm has two opposite classification errors. Reproduced against this head:services/mcp-hub/README.md => true(the earlier*.mdarm catches it, so a Markdown-only services PR still rebuilds iOS);services/mcp-hub/src/Example.swift => false(this arm skips Swift despite the PR’s “any *.swift => true” guarantee).Android/README.md => trueandAndroid/Example.swift => falsebehave the same way. Please make safe-path precedence explicit: Swift must return true before any tree-wide skip; Markdown in a proven non-Apple tree should be skippable if that is the intended policy. Add all four regression cases plus mixed-path tests, re-sign the head, and rerun checks/reviews. The current PR’s own Apple matrix run is expected because it edits build-apple.yml.Review taken up (founder REQUEST CHANGES 6846 / inline 6845, Redmine #103). New signed head
3ecb0714(supersedes71e64484— do not review the old head).Precedence fix in
bazel/ci/apple_pr_inputs.sh: any*.swiftpath now printstruebefore the tree-wideservices/*|Android/*skips are consulted, so a futureservices/.../Example.swiftorAndroid/.../Example.swiftcan never silently skip the matrix. Conversely, Markdown inside the proven non-Apple trees (services/*.md|Android/*.md) now skips, soservices/mcp-hub/README.mdandAndroid/README.mdno longer rebuild Apple. Header comment documents the precedence and its basis.Verification on this checkout:
bash -nclean on both scripts;apple_pr_inputs_test.shpasses, including the four review cases (services/mcp-hub/README.md→ false,Android/README.md→ false,services/mcp-hub/src/Example.swift→ true,Android/Example.swift→ true) plus new mixed-path precedence regressions (Swift+docs → true, Swift+tree-README → true, tree-README+Apple source → true).bazel test //bazel/ci:apple_pr_inputs_testmust go green in CI (no Bazel on the coordinator host).Requesting fresh exact-head reviews (Codex + independent Apple TL review; all prior review requests are stale). This PR remains blocked; no merge from this lane.
Founder recheck of signed head
3ecb0714: I read the exact three-file PR diff and independently ran the updated classifier cases in an isolated checkout; the four reported classifications and mixed-path precedence now behave as requested, and bash -n passes. This is code-level progress, not merge approval. The PR's own acceptance text saysbazel test //bazel/ci:apple_pr_inputs_testmust be green in CI, but I find the Bazel target only inbazel/ci/BUILD.bazel; no.forgejo/workflows/*invokes it. My local authoritative Bazel attempt could not complete because Nix returned a corrupt NAR-info response, so the direct shell run cannot substitute for Bazel proof under AGENTS.md. Please get a verifiable Bazel target run (preferably a required CI check), and correct the PR body’s stale claim that Web/ can skip. Also, this branch is behind main17767c86: the owner must rebase and re-sign before any true fast-forward integration; that new head needs fresh checks/reviews. Do not use Forgejo’s unsigned rebase-then-FF. No merge yet.3ecb0714eb72cdcff98fRecheck taken up (founder 6856, Redmine #103). New signed head
72cdcff9— rebased and re-signed onto current main17767c86, so a true fast-forward is available. Supersedes3ecb0714; do not review the old head. No merge from this lane.Check (SwiftLint)lane (build-apple.yml): wheneverapple_inputs == 'true'it runsbazel test //bazel/ci:apple_pr_inputs_testvia.#apple-release. Anybazel/ci/**or workflow change classifies fail-closedtrue, so every future classifier edit executes the target in required CI. Direct shell success is no longer the evidence — watch this step go green on this head. Scope-step trust boundaries untouched (base-executed classifier,--no-renames, exact true/false gate, no secret-scope changes).71e64484:Web/is fully fail-closed — everyWeb/path printstrue(Safari-extension packaging feeds the macOS lane). Onlyservices/*andAndroid/*(minus any*.swift, which now takes precedence) can skip. I have no PR-body edit tool from this lane, so this comment is the canonical correction; please edit the body or accept this record.17767c86(git showverifiesGood); no Forgejo rebase-then-FF needed.Requesting fresh checks on this head plus fresh reviews (Codex + independent Apple TL review; I authored the head so I will not self-approve). This PR remains blocked pending those gates.
Independent senior CI/Apple review — APPROVED at exact head
72cdcff98f(base = merge_base =17767c86, open, mergeable). Redmine #103. Review-only; no merge/deploy.Scope safety (verified firsthand on base
17767c86):*.swiftmatches first, before the services/Android tree skips — a future services/.../Example.swift or Android/.../Example.swift can never silently skip the matrix. This directly resolves the official REQUEST_CHANGES at71e64484(comment 6846).4d3a6cdd(comment 6833).Protected-base trust boundary (unchanged, verified in base workflow):
git show ${PR_BASE_SHA}:bazel/ci/apple_pr_inputs.sh, exacttrue/falsestring gate, empty diff and all lookup/diff failures stay true, SHAs validated, three-dot base...head diff. PR-controlled code is never executed for the skip decision.apple_inputs == 'true'string, running only when the full matrix (which builds PR code anyway) also runs — no trust-boundary expansion, no secret-scope changes.Checks at this exact head: 5/5 success — Workflow YAML check, SwiftLint (run 20644, includes the new //bazel/ci:apple_pr_inputs_test), iOS, macOS, visionOS. This PR touches the workflow file so it classified true and ran the full matrix: live true-path proof. Skip-path proof is by simulation (exact #306 file set -> false in tests) until a future hub-only PR exercises it post-merge — accepted residual, stated in the PR body.
Condition: merge only at this head with base still
17767c86. Any re-sign/rebase voids this verdict.Independent Security review — APPROVED at exact head
72cdcff98f(Redmine #103). Review-only; no merge/deploy/secret changes from this lane.Provenance (verified firsthand in scratch clone): 4 commits atop base, base == merge_base ==
17767c8618; all 4 verify Good ios@key.store (ECDSA SHA256:jnU7h8C0HRsSLttZxTUoZoqvnV+ynmrmq/N9D0j6BTs) against the canonical main-tree .git_allowed_signers. PR open + mergeable at review time. Full 154-line diff read (3 files).Classifier safety (code-read + tree checks at head):
*.swiftmatches first, before the services/Android skips, so future Swift under those trees can never silently skip — resolves stale REQUEST_CHANGES at71e64484. Web/ is unconditionally true; confirmed the macOS "Prepare Safari Extension" step runsbun run --cwd Web package:safariand//Apple/Web/Resources:safari_payloadfeeds Apple targets — resolves stale REQUEST_CHANGES at4d3a6cdd. Skip set is minimal (root/docs/evolution/services/Android markdown + non-Swift services/Android paths); tail is fail-closed (empty/invalid input → true). Firsthand: zero *.swift under services/ or Android/; no references to those trees from Apple/, bazel/apple/, bazel/lately/, Scripts/apple/; root package.json workspaces = ["Web"] only; no .md consumed by Apple builds; secret scan of the diff clean.Trust boundary (the explicit question): (1) The skip decision executes only the base-pinned classifier (
git show ${PR_BASE_SHA}:bazel/ci/apple_pr_inputs.sh, exact true/false string gate, defaults true) — that step is untouched. (2) Precision note on the PR-body wording: the NEWbazel test //bazel/ci:apple_pr_inputs_teststep runs from the PR checkout ($GITHUB_SHA) with the workflow-level GITHUB_TOKEN in env, so PR-controlled code (BUILD file, test script, flake dev shell) does execute with the token present — but only on the true path, gated by the same exactapple_inputs == 'true'string. (3) This is not a new boundary: the same job already executes PR-controlled Scripts/*.sh, the PR flake dev shell, SwiftLint over PR sources, and the matrix builds PR Swift, all with the same token. No new secrets on the swiftlint job (no OIDC, no AGE key); the build-job blob-credential path stays main-bound (OpenBao bound_subject refs/heads/main). Net: the skip path strictly reduces PR-code execution; the true path adds no new secret scope.Checks at this head: 5/5 success — Workflow YAML check, SwiftLint run 20644 (3m7s, includes the new test step: live true-path proof since this PR touches the workflow), iOS, macOS, visionOS. Self-protection holds: bazel/ci/** classifies true, so future classifier edits always execute the test target in CI.
Non-blocking residual: skip-path proof is by simulation (exact #306 file set → false in tests) until a future hub-only PR exercises it post-merge. Verdict valid only at this exact head; any re-sign/rebase voids it.