feat: Add WeChat authentication helpers#468
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds complete WeChat authentication integration to Parse-Swift, including callback-based core APIs, async/await and Combine compatibility layers, comprehensive test coverage across all three paradigms, and Xcode project configuration updates. ChangesParseWeChat Authentication Integration
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
6356b8b to
e0ccbb2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
Sources/ParseSwift/Authentication/3rd Party/ParseWeChat/ParseWeChat+combine.swift (1)
36-38: ⚡ Quick winAdd deprecation annotations to legacy Combine publisher overloads.
Line 30 and Line 79 document deprecated behavior, but these APIs should also be declared with
@available(*, deprecated, ...)so callers get warnings.Also applies to: 86-88
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Sources/ParseSwift/Authentication/3rd` Party/ParseWeChat/ParseWeChat+combine.swift around lines 36 - 38, Add `@available`(*, deprecated, "<brief reason>") annotations to the legacy Combine publisher overloads so callers receive compile-time warnings: annotate the loginPublisher(id:accessToken:options:) method and the other deprecated Combine overloads in ParseWeChat+combine.swift (the methods documented as deprecated around the earlier comment at line ~30 and the ones around lines ~79 and ~86-88). Use a short deprecation message matching the existing docs (e.g., "Use async/await or new API") and place the annotation immediately above each function declaration (e.g., above the loginPublisher signatures) to ensure callers are warned.Sources/ParseSwift/Authentication/3rd Party/ParseWeChat/ParseWeChat+async.swift (1)
38-40: ⚡ Quick winMark async legacy token-flow APIs as deprecated at declaration level.
Line 31 and Line 84 mark these as deprecated in comments, but missing
@available(*, deprecated, ...)means no compile-time warning for async callers.Also applies to: 91-93
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Sources/ParseSwift/Authentication/3rd` Party/ParseWeChat/ParseWeChat+async.swift around lines 38 - 40, The async legacy token-flow APIs (e.g., the login(id:accessToken:options:) async function shown and the other async legacy token-flow methods around lines 91–93) must be annotated with a deprecation attribute at declaration level; add an `@available`(*, deprecated, message: "Use the modern OAuth-compliant async APIs or tokenless flows") (or a project-appropriate deprecation message) directly above each async function signature (for example above func login(id:accessToken:options:) and the other async legacy token-flow methods) so callers receive compile-time deprecation warnings instead of only comment-based notes.Sources/ParseSwift/Authentication/3rd Party/ParseWeChat/ParseWeChat.swift (1)
98-103: ⚡ Quick winAdd real Swift deprecation attributes to legacy token-flow overloads.
Line 91 and Line 154 describe these APIs as deprecated, but the declarations aren’t annotated with
@available(*, deprecated, ...), so consumers won’t get compiler warnings.Suggested change
+ `@available`(*, deprecated, message: "Use login(code:) instead.") func login(id: String, accessToken: String, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: `@escaping` (Result<AuthenticatedUser, ParseError>) -> Void) { @@ + `@available`(*, deprecated, message: "Use link(code:) instead.") func link(id: String, accessToken: String, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: `@escaping` (Result<AuthenticatedUser, ParseError>) -> Void) {Also applies to: 161-166
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Sources/ParseSwift/Authentication/3rd` Party/ParseWeChat/ParseWeChat.swift around lines 98 - 103, The legacy token-flow overloads of ParseWeChat's login (including the signature login(id:accessToken:options:callbackQueue:completion:) and the other id+accessToken overloads in the same file) should be annotated with a Swift deprecation attribute; add `@available`(*, deprecated, message: "Deprecated: use the newer authentication flow") (or a more specific replacement message) immediately before each deprecated method declaration so callers receive compiler warnings about the legacy token-flow APIs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Around line 7-9: Remove the manual changelog entry from CHANGELOG.md by
deleting the added lines "__New features__" and "- Add ParseWeChat
authentication." so the file remains managed by semantic-release; do not add any
manual changelog text in this PR and revert the file to its
previous/autogenerated state.
---
Nitpick comments:
In `@Sources/ParseSwift/Authentication/3rd` Party/ParseWeChat/ParseWeChat.swift:
- Around line 98-103: The legacy token-flow overloads of ParseWeChat's login
(including the signature login(id:accessToken:options:callbackQueue:completion:)
and the other id+accessToken overloads in the same file) should be annotated
with a Swift deprecation attribute; add `@available`(*, deprecated, message:
"Deprecated: use the newer authentication flow") (or a more specific replacement
message) immediately before each deprecated method declaration so callers
receive compiler warnings about the legacy token-flow APIs.
In `@Sources/ParseSwift/Authentication/3rd`
Party/ParseWeChat/ParseWeChat+async.swift:
- Around line 38-40: The async legacy token-flow APIs (e.g., the
login(id:accessToken:options:) async function shown and the other async legacy
token-flow methods around lines 91–93) must be annotated with a deprecation
attribute at declaration level; add an `@available`(*, deprecated, message: "Use
the modern OAuth-compliant async APIs or tokenless flows") (or a
project-appropriate deprecation message) directly above each async function
signature (for example above func login(id:accessToken:options:) and the other
async legacy token-flow methods) so callers receive compile-time deprecation
warnings instead of only comment-based notes.
In `@Sources/ParseSwift/Authentication/3rd`
Party/ParseWeChat/ParseWeChat+combine.swift:
- Around line 36-38: Add `@available`(*, deprecated, "<brief reason>") annotations
to the legacy Combine publisher overloads so callers receive compile-time
warnings: annotate the loginPublisher(id:accessToken:options:) method and the
other deprecated Combine overloads in ParseWeChat+combine.swift (the methods
documented as deprecated around the earlier comment at line ~30 and the ones
around lines ~79 and ~86-88). Use a short deprecation message matching the
existing docs (e.g., "Use async/await or new API") and place the annotation
immediately above each function declaration (e.g., above the loginPublisher
signatures) to ensure callers are warned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7c9b4e36-3d3e-4462-9656-63a0df513cd1
📒 Files selected for processing (7)
CHANGELOG.mdParseSwift.xcodeproj/project.pbxprojSources/ParseSwift/Authentication/3rd Party/ParseWeChat/ParseWeChat+async.swiftSources/ParseSwift/Authentication/3rd Party/ParseWeChat/ParseWeChat+combine.swiftSources/ParseSwift/Authentication/3rd Party/ParseWeChat/ParseWeChat.swiftTests/ParseSwiftTests/ParseWeChatCombineTests.swiftTests/ParseSwiftTests/ParseWeChatTests.swift
| __New features__ | ||
| - Add ParseWeChat authentication. | ||
|
|
There was a problem hiding this comment.
Remove manual changelog entry—changelog is auto-generated by semantic-release.
This manual addition to CHANGELOG.md violates the project's established workflow. Based on learnings, CHANGELOG.md entries should be automatically generated by semantic-release during the release process, not manually edited in pull requests. Manual edits can cause conflicts with automated generation and lead to release inconsistencies.
Please remove these lines. The changelog will be automatically updated when this PR is released.
🔧 Proposed fix
-__New features__
-- Add ParseWeChat authentication.
-Based on learnings: "Never manually add or modify entries in CHANGELOG.md. These files should be generated automatically by semantic-release during the release process."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| __New features__ | |
| - Add ParseWeChat authentication. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` around lines 7 - 9, Remove the manual changelog entry from
CHANGELOG.md by deleting the added lines "__New features__" and "- Add
ParseWeChat authentication." so the file remains managed by semantic-release; do
not add any manual changelog text in this PR and revert the file to its
previous/autogenerated state.
|
I will reformat the title to use the proper commit message syntax. |
|
I will reformat the title to use the proper commit message syntax. |
e0ccbb2 to
c1723fb
Compare
|
Addressed the CodeRabbit feedback in
|
|
@coderabbitai review Current head no longer changes |
|
✅ Actions performedReview triggered.
|
New Pull Request Checklist
Issue Description
Refs: #55
Adds the missing WeChat third-party authentication helper surface so WeChat auth can use the same provider/data pattern as the existing ParseSwift auth integrations.
Approach
ParseWeChatauth data/provider typesTesting
git diff --checkCHANGELOG.mdmatches upstreammainand is not part of the current PR diff.swift buildswift test --enable-code-coverage --filter ParseWeChatpassed: 19 tests, 0 failures.