ci(swift-sdk): isolate fork builds from self-hosted runner#4202
Conversation
Address review findings on the DS-CAND-103 guards: - Extend the caller and callee guards with the thepastaclaw trusted-fork exception used by tests-rs-wallet.yml and tests-rs-workspace.yml, so the Swift job applies the same policy as the sibling self-hosted workflows. - Rewrite the policy checker on structured YAML parsing (PyYAML) so harmless reformatting cannot break CI while any semantic change to the guard expressions still fails the check. - Document that the in-repo guards are defense in depth: for pull_request events GitHub evaluates workflow YAML from the PR merge commit, so the authoritative trust boundary is the server-side Actions approval requirement for outside-collaborator workflow runs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🕓 Ready for review — 57 ahead in queue (commit df775a7) |
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Describe the fork/self-hosted-runner boundary in plain language instead of an internal tracking ID that won't mean anything to future readers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v4.1-dev #4202 +/- ##
==========================================
Coverage 87.50% 87.51%
==========================================
Files 2666 2667 +1
Lines 336721 336972 +251
==========================================
+ Hits 294659 294902 +243
- Misses 42062 42070 +8
🚀 New features to boost your workflow:
|
Issue being fixed or feature implemented
Fork pull requests could route attacker-controlled code onto the persistent self-hosted macOS runner: the Swift SDK build job ran for any PR that touched
packages/swift-sdk, regardless of where the PR came from.Recreates #4102 on top of the current v4.1-dev (the original PR's diff view was polluted by a stale merge base after a base-update merge, so it was closed). All round-2 review fixes from #4102 are included.
What was done?
thepastaclaw-owned fork, matching the policy of the sibling self-hosted workflows (tests-rs-wallet.yml,tests-rs-workspace.yml) — before invoking the reusable Swift workflow.changesjob (pull requests, pushes tov*-dev, and the nightly schedule).pull_requestevents GitHub evaluates workflow YAML from the PR merge commit, so a malicious fork can edit the guards and the checker together. The authoritative trust boundary is the server-side Actions approval requirement for outside-collaborator workflow runs; the guards and checker protect trusted runs against accidental regressions.Review fixes carried over from #4102
thepastaclawtrusted-fork exception to the caller guard, the callee guard, and the checker, for consistency with the sibling self-hosted workflows.How Has This Been Tested?
|| truebypass is rejected on both the caller and the callee guard.git diff --checkpasses.Breaking Changes
None. Same-repository pull requests, pushes, schedules, and manual runs preserve their existing eligibility, as do trusted
thepastaclaw-owned fork PRs. Other fork pull requests no longer allocate the persistent Swift self-hosted runner.Checklist:
For repository code-owners and collaborators only