Skip to content

Pool hostname#863

Merged
abnegate merged 14 commits intomainfrom
setHostname
Apr 28, 2026
Merged

Pool hostname#863
abnegate merged 14 commits intomainfrom
setHostname

Conversation

@fogelito
Copy link
Copy Markdown
Contributor

@fogelito fogelito commented Apr 23, 2026

Summary by CodeRabbit

  • New Features

    • Added hostname retrieval for database adapters (MySQL, MariaDB, PostgreSQL, MongoDB).
  • Bug Fixes

    • Refined tenant scoping for metadata collections to produce more consistent cache keys.
  • Tests

    • Added E2E and unit tests validating adapter hostname reporting and cache-key behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

Adds public getHostname(): string to Mongo and Pool adapters; tightens tenant-segment nulling in Database::getCacheKeys() and extracts host via parse_url() when adapters support hostnames; adds unit and E2E tests validating hostname parsing and exposure.

Changes

Cohort / File(s) Summary
Adapter Hostname Exposure
src/Database/Adapter/Mongo.php, src/Database/Adapter/Pool.php
Added public function getHostname(): string to Mongo (returns client host string) and Pool (forwards to active adapter via delegate).
Cache Key & Tenant Logic
src/Database/Database.php
getCacheKeys() now extracts the URL host when adapter hostname support is present and only nullifies tenant segment for METADATA when shared-tables mode is enabled (not solely based on globalCollections).
Tests
tests/e2e/Adapter/Scopes/CollectionTests.php, tests/unit/CacheKeyTest.php
Added E2E testDatabaseHostname() to check adapter hostname allowlist and unit testParseHostname() to assert cache-key construction and metadata key behavior under global-collections toggling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feat mongodb #721: Related adapter API changes touching Mongo and Pool and earlier hostname-support work that this PR builds upon.

Poem

🐰 I sniff the hostnames, one by one,
From Mongo's pipe to Pool's bright sun,
Keys get tidy when the host is parsed,
Tests hop forward—nothing's left un-jarred,
A carrot cheer for code well sparred! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Pool hostname' directly refers to the main feature added: a new getHostname() method in the Pool adapter class that enables hostname retrieval.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch setHostname

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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR adds getHostname() to the Mongo and Pool adapters and incorporates the hostname into cache keys, while also tightening the tenantSegment = null path in getCacheKeys to only apply when shared tables are active. The utopia-php/mongo dependency is correctly bumped to 1.1.0 to provide the underlying getHost() API.

The previously reported issues (hardcoded 'mongo' string, commented-out parse_url result, dev-branch alias) appear to be resolved in this revision. The main outstanding concern flagged in earlier rounds — composer.lock regressions (utopia-php/di 0.3.1→0.1.0, utopia-php/servers 0.2.6→0.2.5, plugin-api-version 2.9.0→2.6.0) — is still present in the current diff and should be addressed before merging to main.

Confidence Score: 4/5

Safe to merge after confirming the composer.lock regressions are intentional or corrected.

No new P0/P1 logic bugs found in the changed source files. The previously flagged P1 on composer.lock downgrades is still present and unresolved, capping the score at 4.

composer.lock — verify the utopia-php/di, utopia-php/servers, and plugin-api-version regressions are intentional before merging.

Important Files Changed

Filename Overview
src/Database/Adapter/Mongo.php Adds getHostname() that correctly delegates to $this->client->getHost() via the updated utopia-php/mongo 1.1.0 package; getSupportForHostname() returns true consistent with real hostname availability.
src/Database/Adapter/Pool.php Adds getHostname() that correctly delegates through the pool to the underlying adapter, consistent with all other delegated methods (getSupportForHostname, startTransaction, etc.).
src/Database/Database.php Integrates hostname into cache keys via getCacheKeys; adds getSharedTables() guard to the tenantSegment = null path for global metadata collections, correcting over-eager cache sharing in non-shared-tables setups.
tests/unit/CacheKeyTest.php Adds testParseHostname covering hostname-aware cache key format and tenant-nulling for global collections; the comment "Check DSN is parsed correctly" is misleading since no DSN parsing occurs — the hostname string is used verbatim.
tests/e2e/Adapter/Scopes/CollectionTests.php Adds testDatabaseHostname with proper early-return guard; the assertContains allowlist ['mysql','mariadb','postgres','mongo'] is fragile for custom hostnames (already flagged in prior review rounds).
composer.lock Downgrades utopia-php/di (0.3.1→0.1.0) and utopia-php/servers (0.2.6→0.2.5); plugin-api-version regresses from 2.9.0 to 2.6.0, indicating an older Composer version was used to regenerate the lock file.

Reviews (9): Last reviewed commit: "Update tests" | Re-trigger Greptile

Comment thread tests/e2e/Adapter/Scopes/CollectionTests.php Outdated
Comment thread tests/e2e/Adapter/Scopes/CollectionTests.php Outdated
Comment thread tests/e2e/Adapter/Scopes/CollectionTests.php Outdated
Comment thread src/Database/Adapter/Mongo.php
Comment thread src/Database/Adapter/Mongo.php
Comment thread src/Database/Adapter/Mongo.php
@claude
Copy link
Copy Markdown

claude Bot commented Apr 23, 2026

CI failure on run 24836281128 is a flaky, timing-dependent test unrelated to this branch.

Failed test: Tests\E2E\Adapter\SharedTables\MariaDBTest::testSingleDocumentDateOperations
Assertion: Failed asserting that '2026-04-23T12:55:07.088+00:00' is not equal to '2026-04-23T12:55:07.088+00:00'. (DocumentTests.php:6029)

Root cause: The test creates doc11 with setPreserveDates(true) (providing $createdAt but no $updatedAt), captures $newUpdatedAt = $doc11->getUpdatedAt(), then immediately updates the document and asserts the new $updatedAt differs. Timestamps are stored at millisecond precision, so when create and update complete within the same millisecond the two values are identical and the assertion fires — which is exactly what happened here (both read 12:55:07.088+00:00).

Why it is not this branch's fault:

  • The failing test was added in commit 667878ca ("Refactor DocumentTests to improve test coverage and structure"), long before this branch.
  • This branch's only diff vs. main (git diff 9a1165f7..HEAD) is a 3-line tweak to tests/e2e/Adapter/Scopes/CollectionTests.php in the testHostName path — no src/ changes, no changes to date/timestamp handling.

No code changes made — exiting without commit per healing protocol for flaky failures. A retry of the CI run should be green. The underlying flakiness in testSingleDocumentDateOperations is worth fixing separately (e.g. a brief sleep or assertGreaterThanOrEqual) but is out of scope for this PR.

Comment thread composer.json Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Apr 23, 2026

CI Healing — Flaky Infra, No Fix Required

The failing job was Adapter Tests (MySQL) on run 24839927756. All 535 errors are identical:

PDOException: SQLSTATE[HY000] [2002] Connection refused
    at src/Database/PDO.php:29  (the initial `new \PDO(...)` call)

Why this is flake, not a code bug:

  • The job died in 1m0s — far shorter than a normal test run.
  • Errors originate at the first PDO constructor call, meaning the MySQL service never became reachable from the test container.
  • Every other adapter job on the same commit passed, including Adapter Tests (SharedTables/MySQL) (3m48s) which uses the same MySQL service image. If the branch's changes had broken MySQL, that job would have failed identically.
  • Nothing on this branch (Mongo::getHostname(), Pool::getHostname(), testDatabaseHostname, composer bump for utopia-php/mongo) touches MySQL connection setup, DSN parsing, or test bootstrap.

Action: No code change. Re-running the workflow should clear it.

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: 2

🧹 Nitpick comments (1)
src/Database/Adapter/Mongo.php (1)

81-84: Consider consistency with SQL adapter's error handling pattern, but not required.

The Mongo adapter's getHostname() differs from the SQL adapter: SQL wraps its call in try/catch for defensive error handling, while Mongo returns the result directly. However, the concern about Client::getHost() potentially throwing is unfounded—it's a simple property accessor that returns a string and cannot fail. The SQL adapter's defensive pattern exists because PDO::getHostname() can actually fail; Mongo's Client::getHost() simply returns an initialized string property.

Adding error handling for consistency is a reasonable stylistic choice, but it is not required for correctness.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Database/Adapter/Mongo.php` around lines 81 - 84, The Mongo adapter's
getHostname() currently returns $this->client->getHost() directly while the SQL
adapter wraps its hostname retrieval in a try/catch; to keep handling
consistent, update Mongo::getHostname() (method getHostname in class using
Client::getHost) to optionally wrap the call in a try/catch that returns the
host on success and logs/returns an empty string or fallback on exception, or
leave as-is if you prefer the simpler direct return since Client::getHost() is a
safe accessor—choose one approach and apply it to getHostname() for consistency
with the SQL adapter's defensive pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@composer.json`:
- Line 44: The dependency "utopia-php/mongo" is pinned to a dev-alias
("dev-get-host as 1.0.3") which should not be merged to main; wait for a proper
release of the utopia-php/mongo change (e.g., tag 1.0.4) and update the composer
constraint in composer.json (replace "utopia-php/mongo": "dev-get-host as
1.0.3") with a stable range such as "utopia-php/mongo": "^1.0.4" or "1.*" so
installations are stable and compatible with consumers' minimum-stability.

In `@tests/e2e/Adapter/Scopes/CollectionTests.php`:
- Around line 76-89: In testDatabaseHostname(), avoid calling getHostname()
before checking support: first call
$database->getAdapter()->getSupportForHostname() and bail with
$this->expectNotToPerformAssertions() if false, then call
$database->getAdapter()->getHostname(); replace the current
$this->assertTrue(in_array($host, [...])) with $this->assertContains($host,
['mysql','mariadb','postgres','mongo']) to get clearer failure output and better
semantics (referencing testDatabaseHostname, getAdapter(),
getSupportForHostname(), getHostname(), assertContains(), and
expectNotToPerformAssertions()).

---

Nitpick comments:
In `@src/Database/Adapter/Mongo.php`:
- Around line 81-84: The Mongo adapter's getHostname() currently returns
$this->client->getHost() directly while the SQL adapter wraps its hostname
retrieval in a try/catch; to keep handling consistent, update
Mongo::getHostname() (method getHostname in class using Client::getHost) to
optionally wrap the call in a try/catch that returns the host on success and
logs/returns an empty string or fallback on exception, or leave as-is if you
prefer the simpler direct return since Client::getHost() is a safe
accessor—choose one approach and apply it to getHostname() for consistency with
the SQL adapter's defensive pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cdb82fcc-73c1-46a3-8491-88c8cb05ca9e

📥 Commits

Reviewing files that changed from the base of the PR and between fd591ea and 6d3483a.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • composer.json
  • src/Database/Adapter/Mongo.php
  • src/Database/Adapter/Pool.php
  • tests/e2e/Adapter/Scopes/CollectionTests.php

Comment thread composer.json Outdated
Comment thread tests/e2e/Adapter/Scopes/CollectionTests.php
Comment thread tests/e2e/Adapter/Scopes/CollectionTests.php
@utopia-php utopia-php deleted a comment from coderabbitai Bot Apr 26, 2026
@claude
Copy link
Copy Markdown

claude Bot commented Apr 26, 2026

CI Heal — Adapter Tests (MySQL) flake

Run: 24953428998 / job 73067558612

What failed

All 535 tests in Adapter Tests (MySQL) errored with the same exception at the very first connection attempt:

PDOException: SQLSTATE[HY000] [2002] Connection refused
/usr/src/code/src/Database/PDO.php:29
/usr/src/code/tests/e2e/Adapter/MySQLTest.php:38   ← new PDO("mysql:host=mysql;port=3307;...")

Tests: 627, Assertions: 6, Errors: 535, Skipped: 90 — only 2 tests passed (the ones that don't open a DB connection).

Why this is a flake, not a code issue

  • Adapter Tests (SharedTables/MySQL) passed in the same run (3m41s) using the same mysql:8.0.43 container — so the image and connection config are fine.
  • The MySQL job exited in 57s, far short of the ~3min needed to actually run the suite. The connections were being refused immediately after docker compose up -d --wait returned.
  • This branch's diffs (setHostname / Mongo getHost / Pool hostname / assertContains) don't touch MySQLTest.php, src/Database/PDO.php, or docker-compose.yml.

Likely root cause (out of scope for this PR)

The MySQL healthcheck in docker-compose.yml:

test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u $$MYSQL_USER", "-p $$MYSQL_PASSWORD"]

uses -h localhost, which on Linux mysqladmin defaults to the unix socket. During MySQL's first-boot init, the socket comes up before TCP port 3307 is actually accepting connections, so --wait returns "healthy" while clients connecting via mysql:3307 still get ECONNREFUSED. The other MySQL job happened to win the race; this one didn't.

Action

No commits — re-running Adapter Tests (MySQL) should resolve it. Hardening the healthcheck (e.g. mysqladmin ping -h 127.0.0.1 -P 3307 to force TCP) would prevent recurrence but belongs in a separate PR.

— [healing task]

Comment thread src/Database/Database.php Outdated
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

🧹 Nitpick comments (2)
tests/unit/CacheKeyTest.php (2)

157-170: Minor: clarify the inline comments around the global-collection assertions.

The comments at lines 157-159 ("Check that tenant 999 exists") and 165-167 ("Check that tenant 999 was removed") read as if the tenant is being mutated on the adapter, when in reality the difference is driven by whether the collection is in the global set registered via setGlobalCollections(['users']). Re-wording to e.g. "non-global collection retains the tenant segment" / "global collection drops the tenant segment" would make the intent of each block clearer to future readers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/CacheKeyTest.php` around lines 157 - 170, Update the inline test
comments to accurately describe why the cache keys differ: replace "Check that
tenant 999 exists" with something like "non-global collection retains the tenant
segment" and replace "Check that tenant 999 was removed" with "global collection
drops the tenant segment" (these relate to getCacheKeys(Database::METADATA, ...)
behavior when collections are registered via setGlobalCollections(['users'])).
Ensure the comments reference the global vs non-global collection behavior
rather than implying the adapter mutates tenant membership.

134-188: Optional: collapse duplication between the two hostname tests via a data provider.

testParseHostname and testSimpleHostname share nearly identical adapter-mock setup. A @dataProvider (or a small private helper that builds the mocked adapter given a hostname) would shrink the duplication and make it easier to extend coverage to other hostname shapes (e.g. tcp://host:27017, IPv6, hostnames with credentials, empty string). Not blocking.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/CacheKeyTest.php` around lines 134 - 188, The two tests
testParseHostname and testSimpleHostname duplicate the same Adapter mock setup;
extract this into a reusable data provider or helper to reduce duplication. Add
either a `@dataProvider` method (e.g., hostnameProvider) that yields hostnames and
change tests to accept the hostname parameter and reuse the existing mock setup,
or implement a private helper method (e.g., createAdapterMock(string $hostname):
Adapter) that builds and returns the configured Adapter mock used by Database in
both testParseHostname and testSimpleHostname; update both tests to call the
provider/helper and keep assertions identical.
🤖 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/Database/Database.php`:
- Around line 9346-9347: The cache key generation leaves DSN-style hostnames
unnormalized because $parts from parse_url($hostname) is computed but not
applied; update the hostname normalization in the cache key logic (around the
parse_url call) to assign $hostname to the parsed host when present (use
$parts['host'] if set, otherwise keep the original $hostname) so DSN URLs like
"scheme://host?..." yield just the host; ensure this change satisfies the
expected format used by testParseHostname().

---

Nitpick comments:
In `@tests/unit/CacheKeyTest.php`:
- Around line 157-170: Update the inline test comments to accurately describe
why the cache keys differ: replace "Check that tenant 999 exists" with something
like "non-global collection retains the tenant segment" and replace "Check that
tenant 999 was removed" with "global collection drops the tenant segment" (these
relate to getCacheKeys(Database::METADATA, ...) behavior when collections are
registered via setGlobalCollections(['users'])). Ensure the comments reference
the global vs non-global collection behavior rather than implying the adapter
mutates tenant membership.
- Around line 134-188: The two tests testParseHostname and testSimpleHostname
duplicate the same Adapter mock setup; extract this into a reusable data
provider or helper to reduce duplication. Add either a `@dataProvider` method
(e.g., hostnameProvider) that yields hostnames and change tests to accept the
hostname parameter and reuse the existing mock setup, or implement a private
helper method (e.g., createAdapterMock(string $hostname): Adapter) that builds
and returns the configured Adapter mock used by Database in both
testParseHostname and testSimpleHostname; update both tests to call the
provider/helper and keep assertions identical.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: acfef3c1-011b-46ec-adec-012e4441e457

📥 Commits

Reviewing files that changed from the base of the PR and between 6d3483a and 8c2ecad.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • src/Database/Database.php
  • tests/e2e/Adapter/Scopes/CollectionTests.php
  • tests/unit/CacheKeyTest.php
✅ Files skipped from review due to trivial changes (1)
  • tests/e2e/Adapter/Scopes/CollectionTests.php

Comment thread src/Database/Database.php Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Apr 26, 2026

CI healing — fixed unit test, MySQL adapter failures look infrastructural

Unit Test (real bug, fixed): Tests\Unit\CacheKeyTest::testParseHostname was failing because Database::getCacheKeys() parsed the hostname URL but then never used the parsed host part — the extraction line was commented out:

$parts = parse_url($hostname);
//$hostname = $parts['host'] ?? $hostname;

Cache keys ended up containing the full DSN (appwrite://database_db_nyc3_self_hosted_0_0?database=appwrite&namespace=_1) instead of just the host. Fix: uncommented the assignment in src/Database/Database.php:9347. Verified locally — all 345 unit tests pass.

Adapter Tests (MySQL): All 535 errors were PDOException: SQLSTATE[HY000] [2002] Connection refused at src/Database/PDO.php:29 (initial connect), which means the MySQL container did not accept connections. The same workflow's Adapter Tests (MariaDB), Adapter Tests (Pool), and Adapter Tests (SharedTables/MySQL) jobs — which use the same docker setup — all passed. Treating this as flaky CI infrastructure; a re-run should clear it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Claude pushed fixes from: healing

8c2ecad...74768db

@claude
Copy link
Copy Markdown

claude Bot commented Apr 26, 2026

CI failure analysis (run 24961752121)

Failure: Tests\E2E\Adapter\MariaDBTest::testSingleDocumentDateOperations at tests/e2e/Adapter/Scopes/DocumentTests.php:6029

Failed asserting that '2026-04-26T16:44:29.207+00:00' is not equal to '2026-04-26T16:44:29.207+00:00'.

Root cause: Flaky timing race, unrelated to this branch.

The test creates a document with setPreserveDates(true) and only $createdAt set, then immediately calls updateDocument and asserts $updatedAt has changed. When both calls land in the same millisecond, the auto-generated timestamps are identical and the assertion fails. The two timestamps in the error message are byte-identical, confirming the race.

This branch (setHostname) only modifies hostname/cache-key handling (Mongo.php, Pool.php, Database.php, CollectionTests.php, CacheKeyTest.php, composer.lock) — none of those touch date handling or this test.

A prior fix exists on the unmerged fix-performance branch (commit f7467014, "fix: prevent flaky date test by using past timestamp for $updatedAt") which sets $updatedAt => $customDate in the test setup. That fix was never merged to main, so the flake persists.

Action: No commit. Re-running CI should clear it; the proper fix belongs in a separate PR that targets the test itself.

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.

🧹 Nitpick comments (1)
tests/unit/CacheKeyTest.php (1)

147-152: Misleading docblock: no DSN parsing is exercised here.

The "Check DSN is parsed correctly" comment doesn't match what the test actually verifies. getHostname() is mocked to return a literal string, so this assertion only validates that Database::getCacheKeys() embeds the hostname into the cache key — DSN/parse_url() parsing lives in the adapter (Pool/Mongo) and isn't covered by this unit test. Consider rewording to avoid confusion.

📝 Proposed wording
-        /**
-         * Check DSN is parsed correctly
-         */
+        /**
+         * Hostname is included in the cache key when the adapter supports it
+         */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/CacheKeyTest.php` around lines 147 - 152, The test's docblock
"Check DSN is parsed correctly" is misleading because getHostname() is mocked
and the test only verifies that Database::getCacheKeys() embeds the hostname
into the cache key; update the comment to accurately describe the behavior under
test (e.g., "Check hostname is embedded into cache key when getHostname() is
provided/mocked") and, if helpful, mention that DSN/parse_url() logic is covered
by the adapter-level tests (Pool/Mongo) rather than this unit test; locate the
comment above the call to $db->getCacheKeys('users') and replace it accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/unit/CacheKeyTest.php`:
- Around line 147-152: The test's docblock "Check DSN is parsed correctly" is
misleading because getHostname() is mocked and the test only verifies that
Database::getCacheKeys() embeds the hostname into the cache key; update the
comment to accurately describe the behavior under test (e.g., "Check hostname is
embedded into cache key when getHostname() is provided/mocked") and, if helpful,
mention that DSN/parse_url() logic is covered by the adapter-level tests
(Pool/Mongo) rather than this unit test; locate the comment above the call to
$db->getCacheKeys('users') and replace it accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c4f9572-b6e6-4ae2-9dff-e8d6ab2bb8d0

📥 Commits

Reviewing files that changed from the base of the PR and between 74768db and c3ac5f1.

📒 Files selected for processing (2)
  • src/Database/Database.php
  • tests/unit/CacheKeyTest.php
✅ Files skipped from review due to trivial changes (1)
  • src/Database/Database.php

@abnegate abnegate merged commit bbeaf38 into main Apr 28, 2026
25 checks passed
@abnegate abnegate deleted the setHostname branch April 28, 2026 06:24
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