Skip to content

refactor(cache)!: remove completed migration bridge and legacy state - #1052

Merged
loks0n merged 5 commits into
mainfrom
codex/remove-cache-bridge
Oct 31, 2026
Merged

loks0n merged 5 commits into
mainfrom
codex/remove-cache-bridge

Conversation

@loks0n

@loks0n loks0n commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Remove the completed rolling migration bridge and legacy writer bookkeeping. Mutation coordination now always uses the existing single-record opaque CAS protocol; the bridge-only query TTL parameter disappears. Delete the cache-5 compatibility process, frozen lockfile and Docker installation tier, together with bridge-only tests and failure adapter.

Applications replacing the v2 bridge must preserve their existing v2: cache view, keys and CAS identities. The underlying v2 state/data format does not change, so old bridge-v2 and replacement clients can overlap. This cleanup requires every legacy reader to have exited; it does not discover or migrate a fleet automatically.

Query epoch purges remain unconditional and recorded even when the local region is cold, so cross-region replay invalidates warm remote withCache readers. The regression was observed failing before the fix and passing afterward. Consumers must require database ^10.0 to retain this behavior.

Validation:

  • Full database unit suite: 13,141 tests / 199,561 assertions passed.
  • Cache suite against the companion v2-only cache source: 133 tests / 1,421 assertions passed.
  • Full PHPStan and Pint passed; all 20 PR checks succeeded.
  • Separate real PHP processes sharing Redis verified the released bridge v2 and the replacement: warm values and purges both directions, old writer completion after state eviction, preserving a newer writer, and permission/list stale-fill rejection both directions.

The dependency range accepts stable cache 6.1.3 or stable 7.x cleanup; the lock remains on stable 6.1.3 with no package updates or development pins. Removing the public Bridge/Legacy classes is breaking; published stable database 10.0.0. Cache 7.0.0 is also published.

Do not change namespaces or clear cache data. Keep old Cloud migration flags until the complete replacement fleet is deployed; remove flags last. Cleanup release/deployment remains tracked separately: https://github.com/appwrite-labs/cloud/issues/7152. Migration completion evidence: https://github.com/appwrite-labs/cloud/issues/7145.

Summary by CodeRabbit

  • Changes
    • Legacy cache-bridge and compatibility-runtime support have been removed. Cache reads and writes now use the mutation-record path.
    • The cache dependency now permits versions 6.1.3 and later in the 6.x series, as well as 7.x.
    • Integrations that rely on the removed legacy cache classes or compatibility runner may need updates.

@loks0n loks0n self-assigned this Oct 31, 2026
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between fb7a650 and 5837885.

Files selected for processing: 2
  • src/Database/Trait/Documents.php
  • tests/unit/Cache/QueryPurgeTest.php

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 90e2b4e and fb7a650.

Files ignored due to path filters: 3
  • compat/composer.lock is excluded by !**/*.lock
  • composer.lock is excluded by !**/*.lock
  • docs/cache-invalidation-state.md is excluded by !docs/**
Files selected for processing: 10
  • Dockerfile
  • compat/composer.json
  • compat/runtime.php
  • composer.json
  • src/Database/Cache/Bridge.php
  • src/Database/Cache/Legacy.php
  • src/Database/Cache/Mutation.php
  • src/Database/Cache/Query.php
  • tests/unit/Cache/BridgeTest.php
  • tests/unit/Cache/FailingLegacyRedis.php
Files with no reviewable changes: 6
  • compat/composer.json
  • tests/unit/Cache/BridgeTest.php
  • compat/runtime.php
  • tests/unit/Cache/FailingLegacyRedis.php
  • src/Database/Cache/Legacy.php
  • src/Database/Cache/Bridge.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

This change removes the cache bridge, legacy cache coordinator, and compatibility runtime. Mutation operations now use the change path, and the utopia-php/cache constraint accepts versions ^6.1.3 or ^7.0.

Changes: Cache compatibility removal

Layer / File(s) Summary
Remove cache migration handling
composer.json, src/Database/Cache/*, tests/unit/Cache/*
The Bridge and Legacy classes and their tests are removed. Mutation uses change for reads, begins, and finishes. Query no longer passes the collection region TTL to Mutation::read. The cache dependency constraint now includes ^7.0.
Remove compatibility runtime setup
Dockerfile, compat/*
The compatibility Composer manifest and runtime script are removed. The Docker build no longer installs or copies the compatibility vendor directory.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

Suggested reviewers: abnegate

Merge Risk: Minimal · previous review fb7a6

No actionable merge-blocking issue was identified. Deployment must preserve the existing v2 cache namespace, wait until legacy readers have exited, and publish the public API removal with the next database major.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: removal of the completed cache migration bridge and legacy state. It is concise and specific.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@loks0n

loks0n commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

CI exposed one remaining fully-qualified Bridge branch in purgeCachedQueries. Removed it and preserved the released v2 bridge behavior: always purge the query epoch before rotating it, including when the local epoch is cold. Added a behavior regression that warms a remote caller-owned cache, purges a cold local region, replays the recorded purges and requires a fresh remote result. Observed it fail with stale data before the change, then pass. Query/withCache suites:30 tests/99 assertions passed. Full static analysis and unit suite rerunning; all adapter lanes on the previous head passed. No ignores or baseline changes.

@loks0n
loks0n merged commit 06db36e into main Oct 31, 2026
21 checks passed
@loks0n
loks0n deleted the codex/remove-cache-bridge branch October 31, 2026 22:42
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