Skip to content

Conversation

@abnegate
Copy link
Member

@abnegate abnegate commented Jan 15, 2026

Summary by CodeRabbit

  • Chores

    • Updated project dependencies to support broader version compatibility for core libraries.
  • Refactor

    • Internal authorization handling adjusted to use instance-level context rather than a global static approach, preserving external behavior while improving internal control flow and maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Walkthrough

Updates composer.json dependency constraints: utopia-php/database from "3.." to "4." and appwrite/appwrite from "19.." to "19.". Code changes in src/Abuse/Adapters/TimeLimit/Database.php replace static Authorization::skip(...) calls with instance-based $this->db->getAuthorization()->skip(...) in multiple methods (count, hit, set, getLogs, cleanup). No public APIs, class signatures, or exported declarations were added or removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update deps' is vague and generic, using a non-descriptive abbreviation that doesn't convey specific information about which dependencies were updated or why. Use a more descriptive title that specifies the key dependency updates, such as 'Update utopia-php/database to v4 and refactor authorization context' to clearly communicate the main changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33a24ad and b7fc951.

📒 Files selected for processing (1)
  • src/Abuse/Adapters/TimeLimit/Database.php
🔇 Additional comments (5)
src/Abuse/Adapters/TimeLimit/Database.php (5)

174-214: LGTM!

The authorization skip correctly wraps all database operations in the hit method. The $this->count++ after the closure executes as expected to track the hit.


228-269: LGTM!

The set method correctly migrates to the instance-based authorization pattern, with all database operations properly wrapped.


286-300: LGTM!

The closure correctly returns the query results, maintaining the expected behavior.


314-324: LGTM!

The cleanup method correctly wraps the batch deletion loop within the authorization skip.


141-146: The migration to instance-based authorization is consistent across all changed locations.

All 5 changed lines follow the pattern $this->db->getAuthorization()->skip(closure):

  • Lines 141 & 286: Properly return and assign results
  • Lines 174, 228, 314: Correctly omit return values for void operations

The closure implementations are appropriate for their contexts. However, the actual API signature of getAuthorization()->skip() in utopia-php/database v4.* should be verified against the official package documentation to confirm this is the correct method name and behavior.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Copy link

@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

🤖 Fix all issues with AI agents
In `@composer.json`:
- Around line 25-26: Update the PHP platform constraint in composer.json from
">=8.0" to ">=8.1" to satisfy the utopia-php/database v4 requirement; locate the
"php" entry in composer.json's "require" section and modify its version string
accordingly, then run composer validate (and composer update if needed) to
ensure dependencies resolve against PHP >=8.1.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3339d05 and 33a24ad.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • composer.json
⏰ 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). (2)
  • GitHub Check: Tests (8.1)
  • GitHub Check: Tests (8.2)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +25 to +26
"utopia-php/database": "4.*",
"appwrite/appwrite": "19.*"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for Database namespace usage patterns
echo "=== Searching for Database namespace usage ==="
rg "use Utopia\\\\Database" --type php -n

echo ""
echo "=== Searching for Database class instantiation ==="
rg "Database\b" --type php -n | head -20

echo ""
echo "=== Checking for specific database operations ==="
rg "(createDocument|updateDocument|deleteDocument|find|findOne|getDocument)" --type php -n | head -20

Repository: utopia-php/abuse

Length of output: 4819


🌐 Web query:

utopia-php/database v4 breaking changes migration

💡 Result:

Quick notes to start a v3 -> v4 migration for utopia-php/database:

  • Minimum PHP now >= 8.1 (composer metadata). [1]
  • See the project source and releases for the full v4 changelog / breaking-change list on the repository (tags/releases). I can extract the exact breaking changes and a step-by-step migration checklist if you want—should I fetch the repo's v4 changelog and PRs now? [2]

Sources:
[1] Packagist: utopia-php/database (package details, versions & requirements).
[2] GitHub: utopia-php/database (repository / releases).


🌐 Web query:

utopia-php/database v4.0.0 release notes changelog

💡 Result:

Do you want a brief summary of the v4.0.0 changes or the full changelog text and a link to the release on GitHub/Packagist?


🏁 Script executed:

#!/bin/bash
# Check if there's a CHANGELOG or MIGRATION guide in the repo
echo "=== Looking for changelog or migration docs ==="
fd "CHANGELOG|MIGRATION|UPGRADE|RELEASE" . --type f -i | head -20

Repository: utopia-php/abuse

Length of output: 107


🌐 Web query:

site:github.com utopia-php/database v4 breaking changes API migration

💡 Result:

I couldn't find a dedicated "v4 migration guide" inside the utopia-php/database GitHub repo, but these sources are relevant:

  • Package page (shows current v4.x releases and README). [1]
  • Appwrite community reports referencing breaking/migration issues tied to utopia-php/database during Appwrite upgrades (useful for practical migration problems you may hit). [2][3]

If you want, I can:

  • Open the utopia-php/database GitHub repo and search its CHANGELOG.md / releases for explicit v4 breaking-change notes; or
  • Scan the repo for files mentioning "migration", "upgrade", "breaking", or "CHANGELOG" and summarize the API changes.

Which would you like me to do?

Sources:
[1] Packagist — utopia-php/database (package page, versions/README). (packagist.org)
[2] Appwrite forum thread: "Build broken" referencing Utopia Database errors. (appwrite.io)
[3] Appwrite forum thread: "Fail migrate 1.6.2 to 1.7.1" showing Database API type errors during migration. (appwrite.io)

Citations:


🌐 Web query:

utopia-php/database releases v4.0.0 what's new breaking changes

💡 Result:

Do you want me to fetch the official v4.0.0 release notes and breaking-change list from the utopia-php/database GitHub (or Packagist) and summarize them?


🌐 Web query:

"utopia-php/database" "v4" "breaking change" OR "migration" API changes

💡 Result:

I couldn't find a published v4 migration / breaking-change guide for utopia-php/database. The package does have v4.x releases on Packagist (latest listed v4.3.0), but I couldn't locate a changelog or migration notes for v4 on the package pages I searched. Sources: [Packagist — utopia-php/database]. [Packagist — utopia-php/framework].

Do you want me to (1) fetch the repository releases/changelog on GitHub (please confirm the exact repo URL if different), or (2) scan the v4.x tag/commits for API changes and list breaking changes?


🏁 Script executed:

#!/bin/bash
# Check the composer.lock or composer files to see current installed versions
echo "=== Checking composer configuration ==="
head -50 composer.json | grep -A 5 -B 5 "utopia-php/database\|appwrite/appwrite"

Repository: utopia-php/abuse

Length of output: 416


🏁 Script executed:

#!/bin/bash
# Check if the change is already committed or proposed
echo "=== Checking composer.json git status ==="
git status composer.json 2>/dev/null || echo "Not a git repo"

echo ""
echo "=== Checking recent git history for composer.json changes ==="
git log --oneline -10 composer.json 2>/dev/null || echo "Git history unavailable"

echo ""
echo "=== Checking PHP version requirement against v4 needs ==="
echo "Current composer.json PHP requirement:"
grep '"php"' composer.json
echo ""
echo "v4 database likely requires PHP 8.1+, current constraint is PHP 8.0+"

Repository: utopia-php/abuse

Length of output: 505


Update PHP version constraint to >= 8.1 to match utopia-php/database v4 requirement.

The upgrade to utopia-php/database v4 introduces a PHP >= 8.1 requirement, but the library currently declares php: ">=8.0" in composer.json. Update the PHP constraint to ">=8.1" to ensure compatibility with the database package v4.

The appwrite/appwrite change from 19.*.* to 19.* is just constraint format normalization with no functional impact.

🤖 Prompt for AI Agents
In `@composer.json` around lines 25 - 26, Update the PHP platform constraint in
composer.json from ">=8.0" to ">=8.1" to satisfy the utopia-php/database v4
requirement; locate the "php" entry in composer.json's "require" section and
modify its version string accordingly, then run composer validate (and composer
update if needed) to ensure dependencies resolve against PHP >=8.1.

@abnegate abnegate merged commit 15cd5db into main Jan 15, 2026
7 checks passed
@abnegate abnegate deleted the chore-update-database branch January 15, 2026 02:09
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.

2 participants