feat: improve SDK PR summary with platform grouping and clipboard copy#11639
feat: improve SDK PR summary with platform grouping and clipboard copy#11639ChiragAgg5k merged 4 commits into1.9.xfrom
Conversation
- Group PR links by platform (Client, Console, Server) in the summary - Add option to copy PR summary to clipboard in markdown format - Support comma-separated platform selection (e.g. "client,server")
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPlatform selection now accepts comma-separated platform keys (or Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR enhances the The structural change to Key concerns:
Confidence Score: 3/5
Important Files Changed
Reviews (1): Last reviewed commit: "feat: improve SDK PR summary with platfo..." | Re-trigger Greptile |
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.02s | Logs |
TablesDBPermissionsGuestTest::testReadDocuments with data set #5 |
1 | 241.03s | Logs |
Commit 647099e - 4 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.10s | Logs |
LegacyConsoleClientTest::testAttributeResponseModels |
1 | 242.27s | Logs |
LegacyCustomClientTest::testAttributeResponseModels |
1 | 242.55s | Logs |
LegacyCustomClientTest::testInvalidDocumentStructure |
1 | 240.55s | Logs |
Commit f3fcdec - 2 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.07s | Logs |
FunctionsScheduleTest::testCreateScheduledAtExecution |
1 | 129.54s | Logs |
Commit b742f1c - 6 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.16s | Logs |
LegacyConsoleClientTest::testTimeout |
1 | 123.75s | Logs |
LegacyCustomClientTest::testAttributeResponseModels |
1 | 242.33s | Logs |
LegacyCustomServerTest::testCreateAttributes |
1 | 242.26s | Logs |
LegacyCustomServerTest::testPatchAttribute |
1 | 240.85s | Logs |
LegacyTransactionsConsoleClientTest::testBulkDeleteOperations |
1 | 240.36s | Logs |
✨ Benchmark results
⚡ Benchmark Comparison
|
- Guard clipboard prompt with posix_isatty() to avoid blocking CI/automated runs - Add Wayland support (wl-copy) and improve error message for missing clipboard tools - Validate comma-separated platform names against getPlatforms()
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/Appwrite/Platform/Tasks/SDKs.php (1)
705-706: Document the nestedprUrlsshape on these helpers.Both signatures now depend on
array<string, array<string, string>> &$prUrls, but that contract is still implicit. A short PHPDoc block here would make the new platform grouping much easier to follow.📝 Example docblocks
+ /** + * `@param` array<string, mixed> $language + * `@param` array<string, array<string, string>> $prUrls + */ private function createPullRequest(array $language, string $platformName, string $target, string $gitBranch, string $repoBranch, string $aiChangelog, array &$prUrls): void + /** + * `@param` array<string, array<string, string>> $prUrls + */ private function updateExistingPr(string $repoName, string $gitBranch, string $prTitle, string $prBody, string $platformName, string $sdkName, array &$prUrls, string $existingPrUrl = ''): voidAs per coding guidelines, "Include comprehensive PHPDoc comments".
Also applies to: 1129-1130
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/SDKs.php` around lines 705 - 706, The helper createPullRequest currently accepts a reference parameter &$prUrls but does not document its nested shape; add a PHPDoc block above createPullRequest (and any other function that takes the same &$prUrls reference) declaring `@param` array<string, array<string,string>> &$prUrls and describing the mapping (e.g. platformName => [language => prUrl], with examples like ['github' => ['php' => 'https://...']]) so callers and future maintainers understand the exact nested array structure; ensure the PHPDoc mentions that the array is mutated by the function and include a short return/void description.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 154-157: The platform loop currently bypasses the platform filter
when $sdks is set because the condition includes "&& ($sdks === null)"; update
the condition in the foreach over $platforms so the platform selection check
only depends on $selectedPlatforms (i.e. keep the check "if ($selectedPlatforms
!== null && !\in_array($key, $selectedPlatforms)) { continue; }"), removing the
$sdks === null clause so the --platform and --sdks selectors are intersected;
touch the loop that references $platforms, $selectedPlatforms and $sdks to apply
this change.
- Around line 581-595: The code assumes success if popen() returns a resource
but ignores the exit status of the clipboard command; change the logic in the
block that sets $copyCommand and uses \popen($copyCommand, 'w') so you capture
and check the return value of \pclose($process) and only call
Console::success('PR summary copied to clipboard!') when pclose returns a zero
(successful) exit status, otherwise call Console::error(...) with the exit code
or a descriptive message; reference the variables and functions $copyCommand,
\popen(), \fwrite(), \pclose(), and Console::success()/Console::error() so the
check is added immediately after the existing fwrite/pclose sequence.
---
Nitpick comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 705-706: The helper createPullRequest currently accepts a
reference parameter &$prUrls but does not document its nested shape; add a
PHPDoc block above createPullRequest (and any other function that takes the same
&$prUrls reference) declaring `@param` array<string, array<string,string>>
&$prUrls and describing the mapping (e.g. platformName => [language => prUrl],
with examples like ['github' => ['php' => 'https://...']]) so callers and future
maintainers understand the exact nested array structure; ensure the PHPDoc
mentions that the array is mutated by the function and include a short
return/void description.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e28c31b3-9ba3-489e-8395-1b82a63f90c6
📒 Files selected for processing (1)
src/Appwrite/Platform/Tasks/SDKs.php
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/Appwrite/Platform/Tasks/SDKs.php (1)
154-157:⚠️ Potential issue | 🟠 Major
--sdksstill bypasses the platform filter.Line 156 keeps the
&& ($sdks === null)escape hatch, so--platform=client,server --sdks=webstill walks every platform that defineswebinstead of intersecting the two selectors.🔧 Minimal fix
- if ($selectedPlatforms !== null && ! \in_array($key, $selectedPlatforms) && ($sdks === null)) { + if ($selectedPlatforms !== null && ! \in_array($key, $selectedPlatforms, true)) { continue; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/SDKs.php` around lines 154 - 157, The platform-loop filter currently lets --sdks bypass --platform because the condition includes "&& ($sdks === null)"; update the foreach filter so it only checks $selectedPlatforms against $key (remove the $sdks === null check) — i.e., in the loop over $platforms ($platforms, foreach with $key and $platform) use if ($selectedPlatforms !== null && !\in_array($key, $selectedPlatforms)) continue; so both $selectedPlatforms and $sdks selectors are applied (ensure subsequent logic that filters SDK entries still uses $sdks).
🧹 Nitpick comments (1)
src/Appwrite/Platform/Tasks/SDKs.php (1)
675-676: Add PHPDoc for the new PR-helper contracts.Both signatures gained extra context plus a nested by-reference array, but neither method documents the expected
$languagekeys or the$prUrls[$platformName][$sdkName]shape. Please add/update PHPDoc here so the contract is explicit.As per coding guidelines, "Include comprehensive PHPDoc comments".
Also applies to: 1099-1100
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/SDKs.php` around lines 675 - 676, Add/update comprehensive PHPDoc for the PR-helper methods (including createPullRequest and the other PR-helper in this class) that documents the expected structure of the $language array (list the required keys and their types/meaning) and the exact shape of the by-reference $prUrls structure (clarify that $prUrls[$platformName][$sdkName] will be populated with URL strings, its types, and when/why it is mutated). Also annotate parameter types (array|string) and the void return, and mention that $prUrls is modified by reference so callers can rely on populated entries for the given $platformName and $sdkName.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 557-568: The current summary block prints the grouped PR URLs
using $prUrls and Console::log/Console::info but never constructs the Markdown,
prompts the user, or invokes the clipboard copy, so add those steps after the
existing Console::log('') that ends the block: call a markdown builder (e.g.,
buildPullRequestMarkdown($prUrls) or buildPRSummaryMarkdown($prUrls)) to produce
the markdown string, then prompt/wait for Enter with
Console::info/Console::prompt (e.g., "Press Enter to copy the PR summary"), and
finally call the clipboard helper (e.g., Clipboard::copy($markdown) or
copyToClipboard($markdown)) and log a success message; reference the same
$prUrls variable and existing Console methods when inserting these calls.
---
Duplicate comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 154-157: The platform-loop filter currently lets --sdks bypass
--platform because the condition includes "&& ($sdks === null)"; update the
foreach filter so it only checks $selectedPlatforms against $key (remove the
$sdks === null check) — i.e., in the loop over $platforms ($platforms, foreach
with $key and $platform) use if ($selectedPlatforms !== null && !\in_array($key,
$selectedPlatforms)) continue; so both $selectedPlatforms and $sdks selectors
are applied (ensure subsequent logic that filters SDK entries still uses $sdks).
---
Nitpick comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 675-676: Add/update comprehensive PHPDoc for the PR-helper methods
(including createPullRequest and the other PR-helper in this class) that
documents the expected structure of the $language array (list the required keys
and their types/meaning) and the exact shape of the by-reference $prUrls
structure (clarify that $prUrls[$platformName][$sdkName] will be populated with
URL strings, its types, and when/why it is mutated). Also annotate parameter
types (array|string) and the void return, and mention that $prUrls is modified
by reference so callers can rely on populated entries for the given
$platformName and $sdkName.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1a6ff669-1df0-4944-a5c6-e2f94a6735a2
📒 Files selected for processing (1)
src/Appwrite/Platform/Tasks/SDKs.php
Summary
client,server) in addition to single platform or*Test plan
sdkstask with git push enabled and verify PR summary is grouped by platformclient,server)*still work as before