ci: fix the Periphery formatter, and stop paying for advisory work on PRs - #6
Conversation
… PRs
Three fixes from the first real run of the gate.
Periphery failed on its first execution (it is gated to push, so the PR that
added it could not exercise it): `--format github-actions` refuses to run
without `--relative-results`. It failed visibly rather than reporting green
only because the else branch got an `exit 1` just before merge.
Measured from run 35162639482:
Format & lint 16s (3s brew, 3s format, 3s lint)
Test 709s of which Test (Debug) 141s
and SwiftLint analyze 553s
The advisory analyzer step was 78% of the test job — nine minutes on every
pull request for output that cannot fail the build, sitting in front of the
blocking test result. It moves to push only, matching Periphery. Pull requests
now get a ~2.5 min test job; unused_import feedback lands post-merge.
With lint at 16s against a 12 min test job, `needs: lint` costs no meaningful
latency and skips a full macOS runner on any revision that fails lint.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe CI workflow now gates tests on lint success, runs SwiftLint analyzer rules only for pushes, and passes relative result paths to Periphery. ChangesCI workflow behavior
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The CI changes preserve the intended post-merge analyzer behavior while reducing pull-request runner time. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Three fixes, all from the first real run of the gate merged in #5.
1. Periphery was broken on its first execution
The job is gated to
push, so the PR that introduced it could not exercise it — it ran for the first time on the merge tomainand failed immediately. Adding--relative-results.Worth noting: it failed visibly only because of the
exit 1added in 0ae2e55 right before merge (CodeRabbit's catch). Without it, a Periphery that never ran once would have reported a green job indefinitely.2. Advisory work was 78% of the PR gate
Measured from run 35162639482:
Nine minutes on every pull request for output that cannot fail the build — and it sat in front of the blocking test result, since the job doesn't report until its last step finishes.
swiftlint analyzere-parses every file through SourceKit, so this is inherent, not a misconfiguration.Moving it to
pushonly, matching the Periphery convention: advisory work belongs post-merge. PRs now get a ~2.5 min test job;unused_importfeedback lands onmain.3.
needs: linton the test jobFrom CodeRabbit's review on #5, which I initially declined on the grounds that its stated rationale (cross-job ordering of the SwiftFormat pre-build phase) misread the code — each job has its own runner and checkout, so there was never a correctness issue there.
The measured numbers make the real case, which is fail-fast economics: lint is 16s against a 12 min test job. Gating costs no meaningful latency and skips a full macOS runner on any revision that fails lint. Right call, adopted.
Testing
YAML validated;
--relative-resultsconfirmed present in Periphery 2.21.2. As with #5, thedeadcodejob cannot be exercised from a pull request — its fix is only provable on the merge tomain.Summary by CodeRabbit