Skip to content

Pinned federation backend fixtures

Local federation tests use pinned backend binaries to verify interoperability with released Wire Server versions. A pinned fixture must use the service configuration from the same release as its container images. Do not use the current development configuration as the baseline for an older binary.

Choosing the release

Before creating a fixture:

  1. Identify the release in which the federation API version was finalized.
  2. Treat that finalized release as the stable baseline for the version.
  3. Record the exact chart tag and image tag used by the fixture.

The tag is the source of truth for the service configuration. Create a temporary worktree at that tag, for example:

git worktree add --detach ../wire-server-chart-<release> chart/<release>

Building the fixture

Use the tagged service integration configurations as the baseline. The usual inputs are:

1
2
3
4
5
6
7
8
9
services/cargohold/cargohold.integration.yaml
services/proxy/proxy.integration.yaml
services/brig/brig.integration.yaml
services/spar/spar.integration.yaml
services/background-worker/background-worker.integration.yaml
services/gundeck/gundeck.integration.yaml
services/federator/federator.integration.yaml
services/galley/galley.integration.yaml
services/cannon/cannon.integration.yaml

Use the configurations for the services that are started by the local federation Compose fixture. Other integration configurations in the release tag are not part of this fixture.

Adapt the tagged configurations for the local Docker environment only:

  • container hostnames and ports;
  • unique Cassandra keyspaces and database names;
  • RabbitMQ vhosts and queue names;
  • local AWS-compatible service endpoints;
  • local certificate, key, and secret paths;
  • federation domains and DNS records;
  • Redis topology and connection mode.

Do not add configuration introduced after the selected release merely because it exists in the current development configuration.

Registering the version

Update all shared local-test wiring for the new version:

  • add the federation-vN.yaml Compose overlay and its configuration directory;
  • add the version to deploy/dockerephemeral/run.sh;
  • create its RabbitMQ vhost and queues;
  • add required DynamoDB, S3, SES, SNS, and SQS resources;
  • add DNS SRV records for the new version to every CoreDNS fixture;
  • add the backend and RabbitMQ settings to services/integration.yaml;
  • add RABBITMQ_USERNAME_VN and RABBITMQ_PASSWORD_VN to .envrc so local test cleanup can delete queues for the pinned backend;
  • add the domain and queue cleanup handling to the integration test harness;
  • include the version in the parameterized federation tests.

The version should be optional through its ENABLE_FEDERATION_VN environment variable, so tests can run against one pinned version or several versions.

Validation checklist

Run the following checks before running the integration tests:

docker compose \
  -f deploy/dockerephemeral/docker-compose.yaml \
  -f deploy/dockerephemeral/federation-v0.yaml \
  -f deploy/dockerephemeral/federation-v1.yaml \
  -f deploy/dockerephemeral/federation-v2.yaml \
  -f deploy/dockerephemeral/federation-vN.yaml \
  config --quiet

bash -n deploy/dockerephemeral/run.sh
sh -n deploy/dockerephemeral/init.sh deploy/dockerephemeral/init_vhosts.sh

git diff --check

Also verify that the new fixture has no stale identifiers from the source version, all images use the selected release tag, all DNS records and queues are present, and every enabled container becomes healthy.

Finally, run the federation API-version and cross-backend smoke test with only the new version enabled, then run the broader federation use-case tests with the required version combinations.

Starting and testing one pinned version

Replace 3 below with the pinned federation version being tested:

ENABLE_FEDERATION_V3=1 ./deploy/dockerephemeral/run.sh

After the containers are healthy, run the API-version and cross-backend smoke test:

1
2
3
ENABLE_FEDERATION_V3=1 \
TEST_INCLUDE=testFederationAPIVersionLegacySmoke \
make ci-safe package=integration

CI and Kubernetes setup

Pinned federation backends used by the Kubernetes integration tests are deployed by the Cailleach repository. Add the new backend to the backend integration-test target in Cailleach:

  • add the wire-federation-vN namespace and domain locals;
  • add a wire_server_federation_vN module based on tf-modules/wire-server-with-bells, using the finalized chart version and the configuration required by that release;
  • configure the pinned backend with the federation test helper, federation CA, dedicated ingress, and any release-specific dependencies;
  • add the namespace to the per-version ingress controller map.

See the Cailleach V3 deployment change as a reference implementation.

The wire-server repository must also contain the matching integration setup:

  • add federation-vN and rabbitmq-vN to the integration ConfigMap;
  • enable ENABLE_FEDERATION_VN and provide its RabbitMQ credentials;
  • copy the RabbitMQ secret from the pinned namespace before running tests.

Make the Cailleach change available in the CI environment before opening or updating the wire-server PR. The PR pipeline then starts the test deployment and runs the existing service suites plus the main integration suite against the pinned backends. Verify the pinned namespace, services, certificates, and RabbitMQ secret as part of that pipeline when diagnosing setup failures.