Skip to content

Update database#10596

Merged
abnegate merged 12 commits into1.8.xfrom
feat-update-relationships
Oct 6, 2025
Merged

Update database#10596
abnegate merged 12 commits into1.8.xfrom
feat-update-relationships

Conversation

@abnegate
Copy link
Copy Markdown
Member

@abnegate abnegate commented Oct 3, 2025

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 3, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

  • Bumps utopia-php/database from 1.* to 2.* in composer.json.
  • Replaces createOrUpdateDocuments → upsertDocuments in:
    • src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php
    • src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php
    • src/Appwrite/Platform/Workers/StatsResources.php
  • Replaces createOrUpdateDocumentsWithIncrease → upsertDocumentsWithIncrease in src/Appwrite/Platform/Workers/StatsUsage.php (two call sites).
  • Tests updated to select related fields via Query::select(['library.*']) and now expect nested-attribute queries to return 200 with library subdocument data (tests under tests/e2e/.../DatabasesBase.php).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • ItzNotABug
  • fogelito

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "Update database" is overly generic and does not convey the primary changes in this pull request, such as bumping the utopia-php/database dependency to 2.*, switching persistence calls to upsertDocuments across multiple modules, and updating E2E tests for nested attribute queries. It fails to highlight the specific intent or scope of the modifications in a concise manner. Please update the title to succinctly summarize the main change, for example “Bump utopia-php/database to v2 and switch to upsertDocuments with nested attribute test updates.”
Description Check ❓ Inconclusive The pull request description currently contains only the default contribution template and lacks any details about the actual changes, motivation, or verification steps, making it too vague to understand the scope or impact of the updates. It does not describe the modifications to persistence methods, dependency version, or test adjustments introduced by this PR. Please provide a clear description of what this PR does, why the changes are needed, how they were tested, and any related issues or PRs to help reviewers assess the implementation.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 3, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
binutils 2.44-r2 CVE-2025-5244 HIGH
binutils 2.44-r2 CVE-2025-5245 HIGH
libexpat 2.7.1-r0 CVE-2025-59375 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH
golang.org/x/oauth2 v0.24.0 CVE-2025-22868 HIGH
stdlib 1.22.10 CVE-2025-47907 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 3, 2025

✨ Benchmark results

  • Requests per second: 1,227
  • Requests with 200 status code: 220,952
  • P99 latency: 0.158393413

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,227 991
200 220,952 178,340
P99 0.158393413 0.196673042

@abnegate abnegate marked this pull request as ready for review October 4, 2025 11:35
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 59d5c49 and ce52dba.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • composer.json (1 hunks)
  • src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php (1 hunks)
  • src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php (1 hunks)
  • src/Appwrite/Platform/Workers/StatsResources.php (1 hunks)
  • src/Appwrite/Platform/Workers/StatsUsage.php (2 hunks)
  • tests/e2e/Services/Databases/Legacy/DatabasesBase.php (1 hunks)
  • tests/e2e/Services/Databases/TablesDB/DatabasesBase.php (1 hunks)
🔇 Additional comments (6)
tests/e2e/Services/Databases/Legacy/DatabasesBase.php (1)

4714-4717: Projection now aligns with relationship behavior.

Selecting library.* before filtering ensures the nested relationship payload is available under the new API semantics. Looks good.

src/Appwrite/Platform/Workers/StatsResources.php (1)

465-468: LGTM! Database method migration aligns with library upgrade.

The update from createOrUpdateDocuments to upsertDocuments is consistent with the utopia-php/database 2.* upgrade. The method signature, parameters, and error handling remain unchanged.

src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php (1)

246-252: LGTM! Consistent database method migration.

The update from createOrUpdateDocuments to upsertDocuments maintains the same signature and callback pattern, aligning with the database library upgrade.

src/Appwrite/Platform/Workers/StatsUsage.php (2)

455-455: LGTM! Database method migration for project stats.

The update from createOrUpdateDocumentsWithIncrease to upsertDocumentsWithIncrease is consistent with the database library upgrade and maintains the same increment semantics.


535-539: LGTM! Database method migration for logs DB.

The update from createOrUpdateDocumentsWithIncrease to upsertDocumentsWithIncrease mirrors the change in line 455, ensuring consistency across both database write paths.

src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php (1)

116-124: Approve bulk upsert migration

No remaining usages of createOrUpdateDocuments*; upsertDocuments now consistently replaces deprecated methods in both single and bulk operations.

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 ce52dba and 24f6da5.

📒 Files selected for processing (1)
  • tests/e2e/Services/Databases/TablesDB/DatabasesBase.php (1 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). (3)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan

@abnegate abnegate merged commit 3190d04 into 1.8.x Oct 6, 2025
86 checks passed
@abnegate abnegate deleted the feat-update-relationships branch October 6, 2025 05:29
@coderabbitai coderabbitai bot mentioned this pull request Oct 9, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 20, 2025
2 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 30, 2025
2 tasks
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.

1 participant