Skip to content

Make Swift compiler warnings fail CI - #140

Merged
HemSoft merged 1 commit into
mainfrom
chore/issue-138-swift-warnings-as-errors
Aug 4, 2026
Merged

Make Swift compiler warnings fail CI#140
HemSoft merged 1 commit into
mainfrom
chore/issue-138-swift-warnings-as-errors

Conversation

@HemSoft

@HemSoft HemSoft commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Closes #138

Summary

  • remove the unreachable Claude credential-refresh switch arm while preserving the existing unchanged-token fallback path
  • explicitly discard synchronized cache/test-helper mutation results
  • make Debug builds of the first-party app and test targets treat Swift warnings as errors without changing Sparkle build settings
  • document the clean-build gate under Unreleased / Developer Experience

Verification

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer ./test.sh — passed all smoke scripts and 329 tests
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -project CodexBarMac.xcodeproj -scheme CodexBarMac -destination 'platform=macOS' -configuration Debug CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO clean test — clean and test succeeded; 329 tests, 0 failures; no first-party Swift compiler warnings
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -project CodexBarMac.xcodeproj -scheme CodexBarMac -destination 'platform=macOS' -configuration Debug CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO clean analyze — clean and analyze succeeded; no first-party Swift compiler warnings
  • confirmed both first-party target compile commands include -warnings-as-errors
  • git diff --check — passed

Residual risk

  • none identified; the policy is target-scoped to Debug configurations and does not propagate to the Sparkle package.

Summary by cubic

Fail Debug builds on Swift warnings for the app and test targets to keep first‑party CI warning‑free; excludes Sparkle. Closes #138.

  • Refactors
    • Set SWIFT_TREAT_WARNINGS_AS_ERRORS=YES for Debug on app and tests; documented the clean-build gate.
    • Removed unreachable Claude credential refresh .unchanged case; kept fallback behavior.
    • Explicitly discarded lock.withLock results in Copilot token cache and tests to silence unused-result warnings.

Written for commit 4d9da06. Summary will update on new commits.

Review in cubic

Note

Make Swift compiler warnings fail CI builds

Macroscope summarized 4d9da06.

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ffa0176d-28ee-4594-b1ed-eb07120a1f3f

📥 Commits

Reviewing files that changed from the base of the PR and between 62a0919 and 4d9da06.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • CodexBarMac.xcodeproj/project.pbxproj
  • CodexBarMac/Services/ClaudeUsageProvider.swift
  • CodexBarMac/Services/CopilotUsageProvider.swift
  • CodexBarMacTests/CodexBarMacTests.swift
💤 Files with no reviewable changes (1)
  • CodexBarMac/Services/ClaudeUsageProvider.swift

📝 Walkthrough

Summary by CodeRabbit

  • Quality Improvements
    • Improved development and testing reliability by treating first-party Swift compiler warnings as errors in Debug builds.
    • Streamlined credential refresh handling without changing expected authentication behavior.
    • Improved consistency in background token invalidation and test locking operations.
  • Documentation
    • Added a changelog entry documenting the updated Debug build warning behavior.

Walkthrough

The change removes three first-party Swift compiler warnings, enables warnings-as-errors for app and test Debug builds, excludes Sparkle, and records the build policy in the changelog.

Changes

Swift warning gate

Layer / File(s) Summary
Remove first-party Swift warnings
CodexBarMac/Services/ClaudeUsageProvider.swift, CodexBarMac/Services/CopilotUsageProvider.swift, CodexBarMacTests/CodexBarMacTests.swift
Removes the unreachable Claude refresh branch and explicitly discards unused lock-operation results.
Enable Debug warnings-as-errors
CodexBarMac.xcodeproj/project.pbxproj, CHANGELOG.md
Enables SWIFT_TREAT_WARNINGS_AS_ERRORS for app and test Debug configurations and records the policy under Developer Experience.

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

Possibly related PRs

Suggested labels: refactor

Poem

A rabbit finds warnings hiding from sight,
And trims unreachable code just right.
Locks return values, now neatly dismissed,
Debug builds catch warnings on the list.
Sparkle stays outside the gate—
Hop, hop, clean builds await!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the primary change: making Swift compiler warnings fail CI.
Description check ✅ Passed The description directly covers the warning cleanup, target configuration, verification, and changelog updates.
Linked Issues check ✅ Passed The changes satisfy the linked issue objectives for warning cleanup, Debug gating, Sparkle exclusion, verification, and documentation.
Out of Scope Changes check ✅ Passed All changes support the linked issue and the stated objective of enforcing warning-free first-party Debug builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/issue-138-swift-warnings-as-errors

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.

❤️ Share

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

@HemSoft

HemSoft commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@HemSoft

HemSoft commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

@macroscope-app review

@macroscopeapp

macroscopeapp Bot commented Aug 4, 2026

Copy link
Copy Markdown

Manual reviews triggered for commit 4d9da06:

All prior checks · these links stay valid even if you push more commits.

@macroscopeapp

macroscopeapp Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review in progress. Results will be posted as check runs when complete.

@macroscopeapp

macroscopeapp Bot commented Aug 4, 2026

Copy link
Copy Markdown

Approvability

Verdict: Would Approve

CI policy change to fail on Swift compiler warnings, with mechanical fixes (removing dead code, discarding unused return values). These are trivial, low-risk changes with no runtime behavior impact.

Macroscope would have approved this PR. Enable approvability here.

@HemSoft

HemSoft commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4d9da06414

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai Bot added the refactor label Aug 4, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

@HemSoft
HemSoft merged commit 82b7bfd into main Aug 4, 2026
5 checks passed
@HemSoft
HemSoft deleted the chore/issue-138-swift-warnings-as-errors branch August 4, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Swift compiler warnings fail CI

1 participant