WPB-29133 add runtime controlled development version for federation API - #5582
Open
battermann wants to merge 10 commits into
Open
battermann wants to merge 10 commits into
battermann wants to merge 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical federation enforcement, negotiation, compatibility, and configuration issues remain unresolved.
Review effort: Lite
Findings: 7
Open (8)
Legacy supported versions ignore disabled federation versions · New Version-prefixed federation requests bypass disabled-version checks · New Disabling V0 breaks federation version discovery · New Deployment fixtures lack required disabled API versions field · New Path-versioned requests bypass disabled federation-version checks · New Middleware ordering bypasses checks for path-versioned requests · New Federation middleware ordering bypasses path-version checks · New Legacy notifications unconditionally use disabled V0 · New
What changed in this PR
Adds runtime-controlled Federation API V5 support, including version negotiation, middleware enforcement, service configuration, tests, Helm wiring, and documentation.
Changes:
- Adds federation version configuration and V5 handling.
- Propagates enabled versions through services and clients.
- Adds tests, deployment settings, documentation, and a changelog entry.
Blocking findings:
- Critical (1 vote):
Version.hsallows/v5/federation/...to bypass disabled-version checks. - Critical (3 votes each): The same path-prefix bypass exists in Brig, Galley, and Cargohold middleware.
- Critical (1 vote): Disabling V0 breaks the unversioned discovery endpoint and negotiation.
- Critical (1 vote): The legacy
supportedfield still advertises disabled versions. - Moderate (2 votes): Background notifications unconditionally use V0.
- Critical (1 vote): Checked-in federation deployment fixtures lack the required configuration field.
| File | Summary |
|---|---|
services/galley/src/Galley/Run.hs |
Adds federation version middleware. |
services/galley/src/Galley/App.hs |
Supplies configured federation versions. |
services/galley/galley.integration.yaml |
Adds integration configuration. |
services/federator/test/unit/Test/Federator/Client.hs |
Updates client test environments. |
services/cargohold/src/CargoHold/Run.hs |
Adds federation version middleware. |
services/cargohold/src/CargoHold/Options.hs |
Adds federation version settings. |
services/cargohold/src/CargoHold/Federation.hs |
Propagates configured versions. |
services/cargohold/cargohold.integration.yaml |
Adds integration configuration. |
services/brig/test/integration/API/Federation.hs |
Updates federation integration tests. |
services/brig/src/Brig/Run.hs |
Adds federation version middleware. |
services/brig/src/Brig/Options.hs |
Parses federation settings. |
services/brig/src/Brig/CanonicalInterpreter.hs |
Supplies configured versions. |
services/brig/src/Brig/App.hs |
Stores federation version settings. |
services/brig/src/Brig/API/Federation.hs |
Filters advertised versions. |
services/brig/brig.integration.yaml |
Adds integration configuration. |
services/background-worker/test/Test/Wire/Util.hs |
Updates test environments. |
services/background-worker/test/Test/Wire/BackendNotificationPusherSpec.hs |
Updates notification tests. |
services/background-worker/src/Wire/Effects.hs |
Propagates federation versions. |
services/background-worker/src/Wire/BackgroundWorker/Env.hs |
Computes enabled versions. |
services/background-worker/src/Wire/BackendNotificationPusher.hs |
Applies versions to notifications. |
libs/wire-subsystems/src/Wire/Options/Galley.hs |
Adds Galley federation settings. |
libs/wire-subsystems/src/Wire/FederationAPIAccess/Interpreter.hs |
Propagates client version state. |
libs/wire-api-federation/wire-api-federation.cabal |
Registers dependencies and tests. |
libs/wire-api-federation/test/Test/Wire/API/Federation/API/VersionSpec.hs |
Tests federation version behavior. |
libs/wire-api-federation/src/Wire/API/Federation/Version.hs |
Implements V5, configuration, and middleware. |
libs/wire-api-federation/src/Wire/API/Federation/Client.hs |
Uses configured versions for negotiation. |
integration/test/Test/Version.hs |
Adds integration coverage. |
integration/test/API/Brig.hs |
Adds federation version requests. |
hack/helm_vars/wire-server/values.yaml.gotmpl |
Configures integration defaults. |
docs/src/developer/reference/config-options.md |
Documents federation settings. |
docs/src/developer/developer/api-versioning.md |
Documents federation versioning. |
charts/wire-server/values.yaml |
Sets the default disabled version. |
charts/wire-server/templates/galley/configmap.yaml |
Renders Galley settings. |
charts/wire-server/templates/cargohold/configmap.yaml |
Renders Cargohold settings. |
charts/wire-server/templates/brig/configmap.yaml |
Renders Brig settings. |
changelog.d/6-federation/WPB-29133 |
Adds the changelog entry. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
blackheaven
requested changes
Oct 2, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved critical negotiation and notification-delivery issues, plus middleware-ordering problems, block approval.
Review effort: Lite
Findings: 2
Open (5)
VersionInfo decoder rejects disabled-version negotiation responses · New Disabled V0 notifications are acknowledged without being delivered · New Public version middleware blocks independently enabled federation paths · New Cargohold public version gating overrides federation version settings · New Galley public version gating blocks federation development paths · New
Resolved since last review (8)
Federation middleware ordering bypasses path-version checks Middleware ordering bypasses checks for path-versioned requests Path-versioned requests bypass disabled federation-version checks Deployment fixtures lack required disabled API versions field Disabling V0 breaks federation version discovery Version-prefixed federation requests bypass disabled-version checks Legacy supported versions ignore disabled federation versions Legacy notifications unconditionally use disabled V0
| toJSON VersionInfo {vinfoSupported} = | ||
| Aeson.object | ||
| [ "supported_versions" Aeson..= vinfoSupported, | ||
| "supported" Aeson..= filter (`elem` [0, 1]) vinfoSupported |
| -- this also rewrites the request | ||
| . requestIdMiddleware e.appLogger defaultRequestIdHeaderName | ||
| . Metrics.servantPrometheusMiddleware (Proxy @ServantCombinedAPI) | ||
| . federationVersionMiddleware e.disabledFederationVersions |
| versionMiddleware (foldMap expandVersionExp o.settings.disabledAPIVersions) | ||
| . requestIdMiddleware e.appLogger defaultRequestIdHeaderName | ||
| . servantPrometheusMiddleware (Proxy @CombinedAPI) | ||
| . federationVersionMiddleware (foldMap Federation.expandVersionExp o.settings.disabledFederationAPIVersions) |
Comment on lines
+114
to
+115
| . federationVersionMiddleware | ||
| (foldMap Federation.expandVersionExp (opts ^. settings . disabledFederationAPIVersions)) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


https://wearezeta.atlassian.net/browse/WPB-29133
Checklist
changelog.d