Skip to content

Conversation

@battermann
Copy link
Contributor

@battermann battermann commented Jan 26, 2026

https://wearezeta.atlassian.net/browse/WPB-22959

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@battermann battermann force-pushed the WPB-22959-migrate-team-feature-data-to-postgres branch from 50ce8a9 to 988e78d Compare January 27, 2026 11:42
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jan 27, 2026
@battermann battermann force-pushed the WPB-22959-migrate-team-feature-data-to-postgres branch from b8c3f52 to e18928a Compare January 28, 2026 12:34
@battermann battermann force-pushed the WPB-22959-migrate-team-feature-data-to-postgres branch from 8ddaeb0 to de4a599 Compare January 29, 2026 11:49
@battermann battermann marked this pull request as ready for review January 30, 2026 12:52
@battermann battermann requested review from a team as code owners January 30, 2026 12:52
@battermann battermann requested a review from Copilot January 30, 2026 12:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements the migration of team feature data from Cassandra to PostgreSQL, following the established pattern used for conversation and conversation codes migrations.

Changes:

  • Adds PostgreSQL support for team features storage with a new table schema and queries
  • Implements a migrating interpreter that handles dual-write scenarios during the migration phase
  • Introduces a migration lock mechanism for team features using PostgreSQL advisory locks
  • Adds configuration options to control the migration across galley and background-worker services
  • Includes comprehensive integration tests covering all migration phases

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/wire-subsystems/src/Wire/PostgresMigrationOpts.hs New module defining storage location options and migration configuration
libs/wire-subsystems/src/Wire/TeamFeatureStore/Postgres.hs PostgreSQL interpreter for team feature store operations
libs/wire-subsystems/src/Wire/TeamFeatureStore/Postgres/Queries.hs SQL queries for PostgreSQL team features storage
libs/wire-subsystems/src/Wire/TeamFeatureStore/Cassandra.hs Refactored Cassandra interpreter with extracted query definitions
libs/wire-subsystems/src/Wire/TeamFeatureStore/Cassandra/Queries.hs Cassandra query definitions extracted to separate module
libs/wire-subsystems/src/Wire/TeamFeatureStore/Migrating.hs Dual-write interpreter managing Cassandra-to-PostgreSQL cutover
libs/wire-subsystems/src/Wire/TeamFeatureStore/Migration.hs Migration logic for backfilling data from Cassandra to PostgreSQL
libs/wire-subsystems/src/Wire/TeamFeatureStore/Error.hs Error types for team feature store operations
libs/wire-subsystems/src/Wire/MigrationLock.hs Extended with support for team feature locking
libs/wire-api/src/Wire/API/Team/Feature.hs PostgreSQL marshalling instances for feature types
services/galley/src/Galley/App.hs Integration of team feature migration into galley service
services/galley/src/Galley/Options.hs Import update for PostgresMigrationOpts
services/background-worker/src/Wire/PostgresMigrations.hs Team features migration entrypoint
services/background-worker/src/Wire/BackgroundWorker.hs Integration of team features migration worker
services/background-worker/src/Wire/BackgroundWorker/Options.hs Migration option for team features
postgres-schema.sql New team_features table schema
libs/wire-subsystems/postgres-migrations/20260123124917-team-features.sql Migration file for team_features table
integration/test/Test/Migration/TeamFeatures.hs Comprehensive integration tests for the migration
docs/src/developer/reference/config-options.md Documentation updates for migration configuration
Configuration files Updates across galley, background-worker, and helm charts
Comments suppressed due to low confidence (1)

docs/src/developer/reference/config-options.md:1885

  • The documentation should be updated to include the team features migration metric name. After line 1885 where conversation codes metric is mentioned, you should add information about the team features migration metric: wire_team_features_migration_finished.
   Wait for the store-specific migration metrics to reach `1.0`. For
   conversations: `wire_local_convs_migration_finished` and
   `wire_user_remote_convs_migration_finished`. For conversation codes:
   `wire_conv_codes_migration_finished`.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants