Skip to content

ci: fix the Periphery formatter, and stop paying for advisory work on PRs - #6

Merged
plz12345 merged 1 commit into
mainfrom
ci/tune-gate
Sep 17, 2026
Merged

plz12345 merged 1 commit into
mainfrom
ci/tune-gate

Conversation

@plz12345

@plz12345 plz12345 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Three fixes, all from the first real run of the gate merged in #5.

1. Periphery was broken on its first execution

error: `periphery scan` must be ran with `--relative-results` when using the GitHub Actions formatter

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 to main and failed immediately. Adding --relative-results.

Worth noting: it failed visibly only because of the exit 1 added 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:

Step Duration Blocking?
Format & lint (whole job) 16s yes
Test (Debug) 141s yes
SwiftLint analyzer rules 553s no

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 analyze re-parses every file through SourceKit, so this is inherent, not a misconfiguration.

Moving it to push only, matching the Periphery convention: advisory work belongs post-merge. PRs now get a ~2.5 min test job; unused_import feedback lands on main.

3. needs: lint on the test job

From 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-results confirmed present in Periphery 2.21.2. As with #5, the deadcode job cannot be exercised from a pull request — its fix is only provable on the merge to main.

Summary by CodeRabbit

  • Tests
    • Updated continuous integration checks so tests run only after linting succeeds.
    • Limited SwiftLint analyzer checks to push events.
    • Improved Periphery scan result path handling.

… 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.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c463d5f4-fa74-4792-a9d3-0389c6967b27

📥 Commits

Reviewing files that changed from the base of the PR and between ffa3751 and 8ab63fc.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The CI workflow now gates tests on lint success, runs SwiftLint analyzer rules only for pushes, and passes relative result paths to Periphery.

Changes

CI workflow behavior

Layer / File(s) Summary
Workflow checks and tool options
.github/workflows/ci.yml
The test job requires successful completion of lint. SwiftLint analyzer rules run only on push events. The Periphery scan uses --relative-results.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8ab63

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two primary CI changes: fixing Periphery formatter output and moving advisory SwiftLint analysis off pull request runs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/tune-gate

Comment @coderabbitai help to get the list of available commands.

@plz12345
plz12345 merged commit d52df61 into main Sep 17, 2026
5 checks passed
@plz12345
plz12345 deleted the ci/tune-gate branch September 17, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant