Skip to content

Add public visibility control for deprecated methods#10933

Merged
ChiragAgg5k merged 1 commit into1.8.xfrom
hide-deprecated-methods-from-docs
Dec 11, 2025
Merged

Add public visibility control for deprecated methods#10933
ChiragAgg5k merged 1 commit into1.8.xfrom
hide-deprecated-methods-from-docs

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

Summary

This PR adds a visibility control mechanism for deprecated methods to prevent them from appearing in public documentation while maintaining backward compatibility in the API.

Changes

  • Added public parameter to the Method class to control documentation visibility
  • Added isPublic() and setPublic() methods to the Method class
  • Marked deprecated methods as non-public (public: false) across:
    • Account verification endpoints
    • Messaging provider endpoints (SMTP, FCM, APNS)
    • Messaging SMS endpoints
    • Account MFA authenticators, challenges, factors, and recovery codes
  • Updated OpenAPI 3 and Swagger 2 specs (both 1.8.x and latest versions) to reflect visibility changes

Test plan

  • Verify deprecated methods still function correctly in the API
  • Confirm deprecated methods are hidden from public documentation
  • Ensure non-deprecated methods remain visible in documentation
  • Check that SDK generation works correctly with the new public parameter

- Add 'public' parameter to SDK Method class to control documentation visibility
- Mark deprecated methods as non-public (public: false) to hide them from docs
- Update OpenAPI and Swagger specs to reflect visibility changes
- Affected endpoints: account verification, messaging providers, and MFA authenticators
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 11, 2025

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This pull request implements a comprehensive authentication and API infrastructure refactoring. The primary changes include: migrating the authorization system from static Auth class methods to User document-based checks; introducing nullable parameter wrappers and includeTotal flags across multiple API list endpoints; updating database collections with new attributes (emailCanonical, emailIsCanonical, emailIsFree, emailIsDisposable, emailIsCorporate, transformations); adding support for password/token proofs and store-based session management; implementing dark-mode support in email templates; introducing TanStack Start framework support; adding new logging configuration for realtime operations; and updating numerous dependency versions in composer.json.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • Auth refactoring across multiple files: Systematic replacement of Auth class methods (isPrivilegedUser, isAppUser, etc.) with User document equivalents (isPrivileged, isApp) in controllers (api/users.php, api/teams.php, api/storage.php, api/graphql.php, shared/api.php, shared/api/auth.php, general.php, realtime.php). Verify all permission checks function correctly with new User-based authorization model.
  • Public API signature changes: includeTotal parameter additions and nullable wrapper implementations across numerous list/get endpoints in messaging.php, migrations.php, projects.php, teams.php, users.php, and vcs.php. Ensure backward compatibility and proper count computation logic.
  • Database collection updates: New attributes added to Users collection (emailCanonical, emailIsCanonical, etc.) and Buckets collection (transformations). Verify schema migrations are handled appropriately.
  • Password/token proof system introduction: New ProofsPassword, Token, Store, and Code resource injections in app/init/resources.php and propagated usage throughout authentication flows. Ensure session/token validation logic is correctly implemented.
  • Email template dark mode styling: Changes to email-base.tpl and email-base-styled.tpl with media query additions. Verify dark-mode appearance in various email clients.
  • Framework template additions: TanStack Start framework integration across app/config/frameworks.php and app/config/templates/site.php. Verify runtime detection and adapter configurations.
  • Realtime logger configuration: New realtimeLogger registry and _APP_LOGGING_CONFIG_REALTIME environment variable in app/init/registers.php and docker-compose.yml. Verify logging provider initialization and fallback behavior.

Possibly related PRs

  • Add teamId to project array in e2e test #10875: Makes overlapping changes to the same files including _APP_LOGGING_CONFIG_REALTIME environment variable, Dockerfile updates, User document type mappings, realtimeLogger registration, and database configuration changes.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Add public visibility control for deprecated methods' accurately describes the main objective of adding a visibility control mechanism to hide deprecated methods from public documentation.
Description check ✅ Passed The PR description clearly explains the purpose, changes made, and test plan for implementing visibility control for deprecated methods, directly relating to the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hide-deprecated-methods-from-docs

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 and usage tips.

@ChiragAgg5k ChiragAgg5k changed the base branch from main to 1.8.x December 11, 2025 08:24
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Dec 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@10933

commit: aa12ef6

@github-actions
Copy link
Copy Markdown

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libpng 1.6.51-r0 CVE-2025-66293 HIGH
libpng-dev 1.6.51-r0 CVE-2025-66293 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a visibility control mechanism for deprecated API methods to hide them from public documentation while maintaining backward compatibility. The implementation adds a public parameter to the Method class and systematically marks deprecated methods across account verification, MFA, messaging providers, and project configuration endpoints as non-public.

Key Changes

  • Added public property with getter/setter methods to the Method class (defaults to true)
  • Updated OpenAPI 3 and Swagger 2 specification generators to include the public field at both SDK and method levels
  • Marked 30+ deprecated methods as non-public (public: false) across account, messaging, projects, and users modules
  • Updated specification JSON files to reflect the visibility changes for all endpoints

Reviewed changes

Copilot reviewed 19 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Appwrite/SDK/Method.php Adds public property with default value true, plus isPublic() and setPublic() methods
src/Appwrite/SDK/Specification/Format/OpenAPI3.php Adds public field to SDK info and method metadata in parsed specification
src/Appwrite/SDK/Specification/Format/Swagger2.php Adds public field to SDK info and method metadata in parsed specification
src/Appwrite/Platform/Modules/Account/Http/Account/MFA/* Marks deprecated MFA authenticators, challenges, factors, and recovery codes as non-public
app/controllers/api/account.php Marks deprecated account verification endpoints as non-public
app/controllers/api/messaging.php Marks deprecated SMTP, FCM, APNS provider and SMS endpoints as non-public
app/controllers/api/projects.php Marks deprecated API status and SMTP/SMS template endpoints as non-public
app/controllers/api/users.php Marks deprecated user MFA endpoints as non-public
app/config/specs/swagger2-latest-server.json Updates specification with public fields for all methods and deprecated method visibility
app/config/specs/swagger2-latest-console.json Updates specification with public fields for all methods and deprecated method visibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

✨ Benchmark results

  • Requests per second: 1,239
  • Requests with 200 status code: 223,094
  • P99 latency: 0.15641714

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,239 1,199
200 223,094 215,785
P99 0.15641714 0.172087357

@ChiragAgg5k ChiragAgg5k merged commit f8c39c8 into 1.8.x Dec 11, 2025
97 checks passed
@ChiragAgg5k ChiragAgg5k deleted the hide-deprecated-methods-from-docs branch December 11, 2025 08:53
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.

3 participants