Skip to content

Refactor Specs task for better code organization#10950

Merged
loks0n merged 3 commits into1.8.xfrom
refactor-specs-task-methods
Dec 16, 2025
Merged

Refactor Specs task for better code organization#10950
loks0n merged 3 commits into1.8.xfrom
refactor-specs-task-methods

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

Summary

Refactors the Specs task class to improve code organization and maintainability by extracting inline arrays and logic into dedicated methods.

Changes

  • Extract platform definitions into getPlatforms() method
  • Extract authentication counts into getAuthCounts() method
  • Extract security keys into getKeys() method
  • Extract SDK platform determination logic into getSDKPlatformsForRouteSecurity() method
  • Add comprehensive PHPDoc comments with proper type hints for all new methods
  • Reorganize class structure by moving constructor to the top

Benefits

  • Improved code readability and maintainability
  • Better separation of concerns
  • Easier to test individual methods
  • Enhanced documentation with type hints

Test plan

  • Verify spec generation works correctly
  • Ensure all platforms (client, server, console) generate properly
  • Check that authentication methods are correctly identified

@ChiragAgg5k ChiragAgg5k changed the base branch from main to 1.8.x December 13, 2025 16:07
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 13, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

The PR adds a constructor and five helper methods to src/Appwrite/Platform/Tasks/Specs.php (getPlatforms, getAuthCounts, getKeys, getSDKPlatformsForRouteSecurity, plus _construct) and refactors Specs::action() to use them. OpenAPI3 and Swagger2 formatters were changed to call Specs::getSDKPlatformsForRouteSecurity() instead of using inline auth→platform mapping and to conditionally add edit links. app/config/sdks.php renames three SDK platform constants to the APP_SDK* namespace. app/config/services.php adds a new 'platforms' array to many service entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect Specs::__construct() for unintended side effects and initialization correctness.
  • Validate getSDKPlatformsForRouteSecurity() logic for all security combinations and empty-security fallbacks.
  • Confirm getPlatforms(), getAuthCounts(), getKeys() match previously expected data shapes used by action().
  • Verify action() preserves output ordering/semantics across OpenAPI3 and Swagger2 formats.
  • Check OpenAPI3.php and Swagger2.php imports and edit-link changes for correctness.
  • Review app/config/sdks.php constant renames and all inserted 'platforms' entries in app/config/services.php for consistency and completeness.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.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 title accurately reflects the main change: refactoring the Specs task class to improve code organization through method extraction and class structure reorganization.
Description check ✅ Passed The description is well-related to the changeset, providing clear details about the extraction of inline logic into methods, addition of PHPDoc comments, and reorganization of class structure.
✨ 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 refactor-specs-task-methods

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5daacb7 and c6b6b7c.

⛔ Files ignored due to path filters (14)
  • app/config/specs/open-api3-1.8.x-client.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-1.8.x-console.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-1.8.x-server.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-latest-client.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-latest-console.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-latest-server.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-1.8.x-client.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-1.8.x-console.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-1.8.x-server.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-latest-client.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-latest-console.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-latest-server.json is excluded by !app/config/specs/**
  • docs/examples/1.8.x/console-web/examples/databases/create-collection.md is excluded by !docs/examples/**
  • docs/examples/1.8.x/console-web/examples/tablesdb/create-table.md is excluded by !docs/examples/**
📒 Files selected for processing (2)
  • src/Appwrite/SDK/Specification/Format/OpenAPI3.php (4 hunks)
  • src/Appwrite/SDK/Specification/Format/Swagger2.php (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-29T15:29:23.250Z
Learnt from: ChiragAgg5k
Repo: appwrite/appwrite PR: 10408
File: app/controllers/general.php:0-0
Timestamp: 2025-08-29T15:29:23.250Z
Learning: In app/controllers/general.php, the deprecation warning logic is safely implemented: it first checks isDeprecated() for all SDK items (which returns $this->deprecated !== null), and only when all are deprecated does it call getDeprecated(). This logical flow guarantees that getDeprecated() cannot return null in that context, making additional null checks unnecessary.

Applied to files:

  • src/Appwrite/SDK/Specification/Format/Swagger2.php
  • src/Appwrite/SDK/Specification/Format/OpenAPI3.php
📚 Learning: 2025-08-29T15:29:23.250Z
Learnt from: ChiragAgg5k
Repo: appwrite/appwrite PR: 10408
File: app/controllers/general.php:0-0
Timestamp: 2025-08-29T15:29:23.250Z
Learning: In the Appwrite codebase, when SDK methods are marked as deprecated (isDeprecated() returns true), the getDeprecated() method is guaranteed to return valid deprecation metadata objects, not null. The deprecation checking logic first verifies isDeprecated() before accessing getDeprecated(), providing implicit null-safety.

Applied to files:

  • src/Appwrite/SDK/Specification/Format/Swagger2.php
  • src/Appwrite/SDK/Specification/Format/OpenAPI3.php
🧬 Code graph analysis (2)
src/Appwrite/SDK/Specification/Format/Swagger2.php (1)
src/Appwrite/Platform/Tasks/Specs.php (2)
  • Specs (29-383)
  • getSDKPlatformsForRouteSecurity (206-225)
src/Appwrite/SDK/Specification/Format/OpenAPI3.php (3)
src/Appwrite/Platform/Tasks/Specs.php (2)
  • Specs (29-383)
  • getSDKPlatformsForRouteSecurity (206-225)
src/Appwrite/SDK/Method.php (2)
  • getDescriptionFilePath (160-163)
  • getDescription (150-153)
src/Appwrite/Utopia/Database/Validator/Operation.php (1)
  • getDescription (76-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan
  • GitHub Check: Setup & Build SDK
🔇 Additional comments (2)
src/Appwrite/SDK/Specification/Format/OpenAPI3.php (1)

155-157: Conditional x-appwrite.edit link looks good.

Only emitting the edit URL when a description file path exists is a clean way to avoid broken GitHub links for inline or missing descriptions. No changes needed here.

src/Appwrite/SDK/Specification/Format/Swagger2.php (1)

159-161: Edit-link gating is correct and mirrors OpenAPI3.

Guarding x-appwrite.edit on getDescriptionFilePath() !== null avoids generating edit URLs for non-file descriptions while preserving the existing URL pattern. This change looks good.


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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Dec 13, 2025

Open in StackBlitz

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

commit: c744354

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 13, 2025

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!

@ChiragAgg5k ChiragAgg5k force-pushed the refactor-specs-task-methods branch from de017b5 to 8b00e95 Compare December 13, 2025 16:12
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 refactors the Specs task class to improve maintainability by extracting inline logic into dedicated methods. The constructor is moved to the top of the class, and platform definitions, authentication counts, security keys, and SDK platform determination logic are extracted into separate methods with PHPDoc annotations.

Key Changes:

  • Constructor relocated to top of class following common PHP conventions
  • Inline arrays for platforms, auth counts, and keys extracted into dedicated getter methods
  • SDK platform security logic extracted into getSDKPlatformsForRouteSecurity() method

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (3)
src/Appwrite/Platform/Tasks/Specs.php (3)

64-68: PHPDoc description remains too brief.

The PHPDoc still only says "Platforms" without describing what the method does or what the returned mapping represents.


93-97: PHPDoc doesn't document the nested array structure.

The return type array{client: array, server: array, console: array} doesn't describe the nested configuration object structure with type, name, description, and in fields.


206-224: Missing PHPDoc documentation.

This method lacks PHPDoc describing its purpose, parameter types, and return type.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d2a95c and 8b00e95.

📒 Files selected for processing (1)
  • src/Appwrite/Platform/Tasks/Specs.php (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Benchmark
  • GitHub Check: E2E Service Test (GraphQL)
  • GitHub Check: E2E Service Test (Health)
  • GitHub Check: E2E Service Test (Proxy)
  • GitHub Check: E2E Service Test (Migrations)
  • GitHub Check: E2E Service Test (Messaging)
  • GitHub Check: E2E Service Test (Webhooks)
  • GitHub Check: E2E Service Test (Sites)
  • GitHub Check: E2E Service Test (Realtime)
  • GitHub Check: E2E Service Test (FunctionsSchedule)
  • GitHub Check: E2E Service Test (Databases/Legacy)
  • GitHub Check: E2E Service Test (Avatars)
  • GitHub Check: E2E Service Test (Functions)
  • GitHub Check: E2E Service Test (Databases/TablesDB)
🔇 Additional comments (2)
src/Appwrite/Platform/Tasks/Specs.php (2)

31-38: LGTM!

The constructor is properly implemented, correctly configuring the task with description, parameters, and callback using Utopia Platform conventions.


226-241: Clean refactoring of action() method.

The method correctly initializes resources and delegates to the new helper methods. The use of null coalescing at line 330 ($authCounts[$platform] ?? 0) provides safe handling for any missing platform keys.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 13, 2025

✨ Benchmark results

  • Requests per second: 1,142
  • Requests with 200 status code: 205,619
  • P99 latency: 0.169432401

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,142 1,198
200 205,619 215,658
P99 0.169432401 0.169177366

@ChiragAgg5k ChiragAgg5k force-pushed the refactor-specs-task-methods branch 3 times, most recently from 6d674be to cc3b7dc Compare December 13, 2025 16:57
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Appwrite/Platform/Tasks/Specs.php (1)

273-279: Remove redundant platform addition causing duplicates.

The getSDKPlatformsForRouteSecurity() method already handles empty $routeSecurity by adding default platforms (lines 224-227). The check at lines 276-279 duplicates this logic, resulting in duplicate platform entries when $routeSecurity is empty.

Trace: When $routeSecurity is []:

  1. Line 274 calls getSDKPlatformsForRouteSecurity([]) → returns [APP_PLATFORM_SERVER, APP_PLATFORM_CLIENT]
  2. Lines 276-279 check if (empty($routeSecurity))true, appends again
  3. Result: [APP_PLATFORM_SERVER, APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CLIENT]

Apply this diff to remove the redundant check:

             $routeSecurity = $sdk->getAuth();
             $sdkPlatforms = $this->getSDKPlatformsForRouteSecurity($routeSecurity);
 
-            if (empty($routeSecurity)) {
-                $sdkPlatforms[] = APP_PLATFORM_SERVER;
-                $sdkPlatforms[] = APP_PLATFORM_CLIENT;
-            }
-
             if (!$route->getLabel('docs', true)) {
                 continue;
             }
♻️ Duplicate comments (1)
src/Appwrite/Platform/Tasks/Specs.php (1)

206-206: Add PHPDoc documentation for this public method.

The method is missing documentation describing its purpose, parameter types, and return value. This is important for a public API method.

Apply this diff:

+    /**
+     * Returns an array of platform identifiers corresponding to the given route security types.
+     *
+     * Maps authentication types (SESSION, JWT, KEY, ADMIN) to their respective SDK platforms.
+     * Defaults to SERVER and CLIENT platforms when no security types are provided.
+     *
+     * @param array $routeSecurity Array of AuthType enum values representing route security
+     * @return array Array of platform constant strings
+     */
     public function getSDKPlatformsForRouteSecurity(array $routeSecurity): array
🧹 Nitpick comments (2)
src/Appwrite/Platform/Tasks/Specs.php (2)

64-68: Improve the PHPDoc description.

The current description "Platforms" is too brief. Consider a more descriptive comment that explains the method's purpose.

Apply this diff:

     /**
-     * Platforms
+     * Returns platform identifiers mapped to their constants.
+     * Used to determine the platforms for which API specifications should be generated.
      *
      * @return array{client: string, server: string, console: string}
      */

93-97: Consider enhancing the PHPDoc with structure details.

The current PHPDoc "Keys for each platform" doesn't document the nested array structure. Consider adding details about the configuration object fields (type, name, description, in) to improve maintainability.

Example improvement:

     /**
      * Keys for each platform.
+     *
+     * Returns an associative array where each platform key maps to an array
+     * of authentication/header configuration objects with fields:
+     *   - type: string ('apiKey')
+     *   - name: string (header name)
+     *   - description: string (description of the key)
+     *   - in: string ('header')
      *
      * @return array{client: array, server: array, console: array}
      */
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b791941 and 6d674be.

📒 Files selected for processing (3)
  • src/Appwrite/Platform/Tasks/Specs.php (4 hunks)
  • src/Appwrite/SDK/Specification/Format/OpenAPI3.php (3 hunks)
  • src/Appwrite/SDK/Specification/Format/Swagger2.php (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-05T15:30:59.312Z
Learnt from: ArnabChatterjee20k
Repo: appwrite/appwrite PR: 10443
File: src/Appwrite/SDK/Specification/Format/OpenAPI3.php:450-458
Timestamp: 2025-09-05T15:30:59.312Z
Learning: In OpenAPI 3.0.x, using oneOf: [{'type': 'array'}] for array items is the correct approach for spatial data validation, as it ensures each element is specifically an array type. Using new \stdClass() or empty objects {} for items can cause compatibility issues with OpenAPI 3.0.x specification.

Applied to files:

  • src/Appwrite/SDK/Specification/Format/OpenAPI3.php
🧬 Code graph analysis (2)
src/Appwrite/SDK/Specification/Format/OpenAPI3.php (1)
src/Appwrite/Platform/Tasks/Specs.php (2)
  • Specs (29-385)
  • getSDKPlatformsForRouteSecurity (206-230)
src/Appwrite/SDK/Specification/Format/Swagger2.php (1)
src/Appwrite/Platform/Tasks/Specs.php (2)
  • Specs (29-385)
  • getSDKPlatformsForRouteSecurity (206-230)
🪛 GitHub Actions: Linter
src/Appwrite/SDK/Specification/Format/OpenAPI3.php

[error] 1-1: Pint: PSR-12 ordered_imports violation. File has imports not sorted lexicographically.

src/Appwrite/SDK/Specification/Format/Swagger2.php

[error] 1-1: Pint: PSR-12 ordered_imports violation. File has imports not sorted lexicographically.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (Realtime)
  • GitHub Check: E2E Service Test (Users)
  • GitHub Check: E2E Service Test (Sites)
  • GitHub Check: E2E Service Test (Messaging)
  • GitHub Check: E2E Service Test (FunctionsSchedule)
  • GitHub Check: E2E Service Test (Account)
  • GitHub Check: E2E Service Test (Projects)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E Service Test (Webhooks)
  • GitHub Check: E2E Service Test (Databases/Legacy)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Functions)
  • GitHub Check: E2E Service Test (Databases/TablesDB)
  • GitHub Check: E2E Service Test (Dev Keys)
  • GitHub Check: Unit Test
  • GitHub Check: E2E General Test
  • GitHub Check: E2E Service Test (Site Screenshots)
  • GitHub Check: Benchmark
  • GitHub Check: scan
🔇 Additional comments (4)
src/Appwrite/Platform/Tasks/Specs.php (4)

31-38: LGTM!

The constructor properly initializes the action with appropriate parameters, validators, and callback registration following Utopia conventions.


78-91: LGTM!

The method correctly returns authentication counts for each platform, and the documentation is consistent with the implementation.


207-230: LGTM!

The method correctly maps authentication types to platform identifiers with appropriate fallback behavior for empty security arrays.


245-247: LGTM!

Good refactoring using the new helper methods to initialize platforms, authentication counts, and keys. This improves code organization and maintainability.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Appwrite/Platform/Tasks/Specs.php (1)

276-279: Remove redundant default platform logic.

The getSDKPlatformsForRouteSecurity() method already returns default platforms when the input array is empty (lines 224-227). Adding the same defaults again here results in duplicate platforms in the $sdkPlatforms array.

Remove this redundant block:

         $routeSecurity = $sdk->getAuth();
         $sdkPlatforms = $this->getSDKPlatformsForRouteSecurity($routeSecurity);

-        if (empty($routeSecurity)) {
-            $sdkPlatforms[] = APP_PLATFORM_SERVER;
-            $sdkPlatforms[] = APP_PLATFORM_CLIENT;
-        }
-
         if (!$route->getLabel('docs', true)) {
♻️ Duplicate comments (5)
src/Appwrite/SDK/Specification/Format/OpenAPI3.php (3)

5-5: Import order violation already flagged.

This issue was identified in previous reviews.


123-124: Repeated instantiation in loop already flagged.

This performance issue was identified and marked as addressed in previous reviews, but the code still shows the instance being created inside the loop.


170-171: Repeated instantiation in nested loop already flagged.

This performance issue in the nested loop was identified in previous reviews.

src/Appwrite/Platform/Tasks/Specs.php (2)

64-76: Brief PHPDoc already flagged.

The PHPDoc comment for this method was identified as too brief in previous reviews.


93-204: Brief PHPDoc already flagged.

The PHPDoc for this method was identified as needing more detail in previous reviews.

🧹 Nitpick comments (1)
src/Appwrite/Platform/Tasks/Specs.php (1)

206-230: Add PHPDoc for public method.

This public method lacks documentation describing its purpose, parameters, and return value. Consider adding a docblock.

Example:

/**
 * Maps route security types to SDK platform identifiers.
 *
 * @param array $routeSecurity Array of AuthType enum values
 * @return array Array of platform constants (APP_PLATFORM_*)
 */
public function getSDKPlatformsForRouteSecurity(array $routeSecurity): array
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d674be and cc3b7dc.

📒 Files selected for processing (3)
  • src/Appwrite/Platform/Tasks/Specs.php (4 hunks)
  • src/Appwrite/SDK/Specification/Format/OpenAPI3.php (3 hunks)
  • src/Appwrite/SDK/Specification/Format/Swagger2.php (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Appwrite/SDK/Specification/Format/Swagger2.php
🧰 Additional context used
🧬 Code graph analysis (1)
src/Appwrite/SDK/Specification/Format/OpenAPI3.php (1)
src/Appwrite/Platform/Tasks/Specs.php (2)
  • Specs (29-385)
  • getSDKPlatformsForRouteSecurity (206-230)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Benchmark
  • GitHub Check: moderate
  • GitHub Check: E2E Service Test (Databases/Legacy)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E Service Test (Teams)
  • GitHub Check: E2E Service Test (Avatars)
  • GitHub Check: E2E Service Test (Sites)
  • GitHub Check: E2E Service Test (Realtime)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (Proxy)
  • GitHub Check: E2E Service Test (GraphQL)
  • GitHub Check: E2E Service Test (Tokens)
  • GitHub Check: E2E Service Test (FunctionsSchedule)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Messaging)
  • GitHub Check: E2E Service Test (Migrations)
  • GitHub Check: E2E Service Test (Users)
  • GitHub Check: E2E Service Test (Databases/TablesDB)
  • GitHub Check: E2E Service Test (Webhooks)
  • GitHub Check: E2E General Test
🔇 Additional comments (2)
src/Appwrite/Platform/Tasks/Specs.php (2)

31-38: LGTM!

The constructor is properly implemented with appropriate parameter validation and callback setup.


78-91: LGTM!

The manager inconsistency from previous reviews has been resolved. The documentation and implementation now match correctly.

@ChiragAgg5k ChiragAgg5k force-pushed the refactor-specs-task-methods branch from cc3b7dc to 77ee2f6 Compare December 13, 2025 17:42
@ChiragAgg5k ChiragAgg5k requested a review from Copilot December 13, 2025 17:43
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

- Extract platform, auth counts, and keys into separate methods
- Add getPlatforms(), getAuthCounts(), and getKeys() methods
- Extract SDK platform logic into getSDKPlatformsForRouteSecurity()
- Add PHPDoc comments with proper type hints
- Move constructor to top of class for better readability
@ChiragAgg5k ChiragAgg5k force-pushed the refactor-specs-task-methods branch from 77ee2f6 to 5daacb7 Compare December 14, 2025 05:51
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc3b7dc and 5daacb7.

⛔ Files ignored due to path filters (12)
  • app/config/specs/open-api3-1.8.x-client.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-1.8.x-console.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-1.8.x-server.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-latest-client.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-latest-console.json is excluded by !app/config/specs/**
  • app/config/specs/open-api3-latest-server.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-1.8.x-client.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-1.8.x-console.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-1.8.x-server.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-latest-client.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-latest-console.json is excluded by !app/config/specs/**
  • app/config/specs/swagger2-latest-server.json is excluded by !app/config/specs/**
📒 Files selected for processing (2)
  • app/config/sdks.php (24 hunks)
  • app/config/services.php (22 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: E2E Service Test (Teams)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Tokens)
  • GitHub Check: E2E Service Test (Projects)
  • GitHub Check: E2E Service Test (Realtime)
  • GitHub Check: E2E Service Test (Migrations)
  • GitHub Check: E2E Service Test (Proxy)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E Service Test (Health)
  • GitHub Check: E2E Service Test (Account)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (FunctionsSchedule)
  • GitHub Check: E2E Service Test (Avatars)
  • GitHub Check: E2E Service Test (Databases/Legacy)
  • GitHub Check: Unit Test
  • GitHub Check: E2E Service Test (Dev Keys)
  • GitHub Check: E2E General Test
  • GitHub Check: E2E Service Test (Site Screenshots)
  • GitHub Check: Setup & Build SDK
  • GitHub Check: scan
🔇 Additional comments (1)
app/config/sdks.php (1)

4-5: Constants properly defined and all references updated.

The constants have been consistently renamed from APP_PLATFORM_* to APP_SDK_PLATFORM_* throughout the file and codebase. Verification confirms:

  • Constants are properly defined as class constants in app/init/constants.php (lines 92-94)
  • No remaining references to old constant names exist across the codebase
  • New constants are consistently used in app/config/sdks.php, src/Appwrite/Platform/Tasks/Specs.php, src/Appwrite/Platform/Tasks/SDKs.php, and app/init/resources.php

@loks0n loks0n merged commit 9ba970b into 1.8.x Dec 16, 2025
43 checks passed
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