Skip to content

Add swiftinterface API diff tracking for RevenueCatUI#6450

Merged
facumenzella merged 12 commits intomainfrom
facundo/add-revenuecatui-swiftinterface-tracking
Apr 23, 2026
Merged

Add swiftinterface API diff tracking for RevenueCatUI#6450
facumenzella merged 12 commits intomainfrom
facundo/add-revenuecatui-swiftinterface-tracking

Conversation

@facumenzella
Copy link
Copy Markdown
Member

@facumenzella facumenzella commented Mar 12, 2026

Summary

  • Ports CircleCI API-diff changes to dynamic config in `.circleci/default_config.yml`
  • Splits API diff coverage into parallel `check-api-changes-revenuecat` and `check-api-changes-revenuecatui` jobs, and updates the requested-jobs allowlist for both names
  • Adds the initial `RevenueCatUI` `.swiftinterface` baseline files across all platforms
  • Extracts shared API diff logic into `fastlane/api_diff_helper.rb` (used by both `generate_swiftinterface` and `check_api_changes` lanes)
  • Keeps the `SubscriptionPeriod` Codable fix, with an explicit `CodingKeys` + `init(from:)` / `encode(to:)` implementation

Notes

  • `check_api_changes` uses plain `diff -u` to compare `.swiftinterface` files — any textual change (additive or breaking) will fail CI. To update baselines when changes are intentional: run `bundle exec fastlane ios generate_swiftinterface`, then copy the files from `/tmp/pr-swiftinterface/` into the `api/` directory.
  • The `generate_swiftinterface` CircleCI pipeline now updates both `RevenueCat` and `RevenueCatUI` baselines.

Test plan

  • `bundle exec fastlane ios generate_swiftinterface`
  • `bundle exec fastlane ios check_api_changes`
  • `REQUESTED_JOBS='check-api-changes-revenuecat check-api-changes-revenuecatui' node .circleci/generate-requested-jobs-config.js`

@facumenzella facumenzella requested a review from a team as a code owner March 12, 2026 13:08
Comment thread fastlane/Fastfile
@RevenueCat-Danger-Bot
Copy link
Copy Markdown

RevenueCat-Danger-Bot commented Mar 12, 2026

2 Warnings
⚠️ Size check is being bypassed due to the presence of the label "danger-bypass-size-limit"
⚠️ Size increase: 295.47 KB

Generated by 🚫 Danger

@facumenzella facumenzella added the danger-bypass-size-limit Apply this label to bypass Dangerbot's size limit. label Mar 12, 2026
@facumenzella facumenzella force-pushed the facundo/add-revenuecatui-swiftinterface-tracking branch from ccd7927 to d38c553 Compare April 21, 2026 09:15
@facumenzella facumenzella requested a review from a team as a code owner April 21, 2026 09:15
Comment thread Sources/Purchasing/StoreKitAbstractions/SubscriptionPeriod.swift Outdated
Comment thread api/revenuecatui-api-ios-simulator.swiftinterface Outdated
Comment thread fastlane/api_diff_helper.rb Outdated
Comment thread fastlane/api_diff_helper.rb
Comment thread fastlane/api_diff_helper.rb Outdated
Comment thread fastlane/api_diff_helper.rb
facumenzella and others added 2 commits April 21, 2026 15:10
- Remove hardcoded `= "RevenueCat"` defaults from swiftinterface_pattern_for_sdk
  and find_swiftinterface_file — callers always pass module_name explicitly
- Remove error_callback from sh call so sh raises on non-zero exit, making
  the rescue block actually reachable for breaking API change detection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread api/revenuecatui-api-ios.swiftinterface Outdated
Replace branch-specific `purchases_ios_pr6450_fix` with the canonical
`purchases_ios` derived from the repo directory name on main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@facumenzella facumenzella requested a review from ajpallares April 21, 2026 13:39
Comment thread api/revenuecatui-api-tvos.swiftinterface
@facumenzella facumenzella enabled auto-merge (squash) April 22, 2026 09:33
Using public-api-diff only caught breaking changes, not additions.
This meant a new API added in PR 1 (no baseline update required) could
be silently broken in PR 2 — the tool would compare against the old
baseline that never contained the new API and report no issue.

Restoring FileUtils.identical? + diff -u ensures any divergence from
the committed baseline fails CI and forces an explicit baseline update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 505ea10. Configure here.

Comment thread .circleci/default_config.yml Outdated
The committed baselines were generated locally with different build
settings (missing -package-name, different declaration ordering) than
what CI produces. Since check_api_changes now uses diff -u, the
baselines must exactly match CI output. Downloaded from CircleCI
jobs 541296 (RevenueCat) and 541284 (RevenueCatUI).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

I have some more comments. Mostly about some seemingly unrelated diffs in this PR.

Also, the PR description should be updated and simplified I believe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are these files changing in this PR? There shouldn't be changes in the interfaces

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This diff shouldn't be in this PR I believe?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These changes are required. When building RevenueCatUI with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, the compiler performs stricter validation of its dependencies' interfaces. The synthesized Codable conformance on the class declaration produces different (and stricter) swiftinterface output than an explicit extension conformance, which caused build failures. Moving the conformance to an explicit extension with CodingKeys, init(from:), and encode(to:) resolves this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Tried different things, and this was the only thing that worked

Comment thread .circleci/default_config.yml Outdated
Comment thread fastlane/Fastfile Outdated
facumenzella and others added 2 commits April 22, 2026 18:19
@emerge-tools
Copy link
Copy Markdown

emerge-tools Bot commented Apr 23, 2026

📸 Snapshot Test

264 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 264 0 N/A

🛸 Powered by Emerge Tools

Copy link
Copy Markdown
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

It's great to have this! Just one suggestion of splitting this into 2 PRs, but I don't have a strong opinion, so I'm approving

Comment thread fastlane/Fastfile

Dir.chdir("..") do
sh("xcodebuild", "clean", "build",
"-workspace", ".",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suspect -workspace . was added to make RevenueCatUI resolve RevenueCat through the SPM graph?

Could this be the reason why we're seeing all the revenuecat-api-*.swiftinterface files change in this PR?

If so, for better traceability, this should probably be split into two PRs. WDYT @facumenzella? Not a blocker, but seems like it's better for traceability

@facumenzella facumenzella merged commit 4c0672c into main Apr 23, 2026
16 of 18 checks passed
@facumenzella facumenzella deleted the facundo/add-revenuecatui-swiftinterface-tracking branch April 23, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

danger-bypass-size-limit Apply this label to bypass Dangerbot's size limit. pr:other

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants