Skip to content
Merged
9 changes: 9 additions & 0 deletions changelog.d/0-release-notes/WPB-27912-background-effects
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* The `backgroundEffects` team feature flag is **deprecated** (WPB-27912). Its
default is now **enabled and locked**, and the Helm configuration override for
`backgroundEffects` has been removed from `charts/wire-server`. The flag's
data type and its public/internal HTTP endpoints are retained for backward
compatibility; any Helm overrides for `backgroundEffects` are now ignored and
can be removed. The public/internal HTTP endpoints return 404 at API version
v17 and remain available through v16; the flag type remains deprecated. The
aggregate `GET /feature-configs` and `GET /teams/:tid/features` endpoints
continue to include `backgroundEffects` at all API versions, including v17.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The `backgroundEffects` team feature endpoints are deprecated and return 404 for
clients on API version v17: the public `GET`/`PUT /teams/:tid/features/backgroundEffects`
and the internal legacy lock `PUT /i/teams/:tid/features/backgroundEffects/(un)?locked`.
They remain available through v16. The aggregate endpoints
`GET /feature-configs` and `GET /teams/:tid/features` are unaffected and continue
to include `backgroundEffects` at all API versions: the aggregate feature list is
version-agnostic, like other version-gated features such as MLS.
4 changes: 0 additions & 4 deletions charts/wire-server/templates/galley/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,5 @@ data:
meetings:
{{- toYaml .settings.featureFlags.meetings | nindent 10 }}
{{- end }}
{{- if .settings.featureFlags.backgroundEffects }}
backgroundEffects:
{{- toYaml .settings.featureFlags.backgroundEffects | nindent 10 }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 0 additions & 4 deletions charts/wire-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,6 @@ galley:
defaults:
status: disabled
lockStatus: locked
backgroundEffects:
defaults:
status: disabled
lockStatus: locked
aws:
region: "eu-west-1"
proxy: {}
Expand Down
23 changes: 12 additions & 11 deletions docs/src/developer/reference/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,20 @@ The aggregate list endpoints (`GET /feature-configs`,
`GET /teams/:tid/features`) continue to include `meetingsPremium` at all API
versions, including v17.

### Background Effects
### Background Effects (deprecated)

The `backgroundEffects` feature flag controls whether background effects are available in meetings. It is disabled and locked by default. If you want a different configuration, use the following syntax:
```yaml
backgroundEffects:
defaults:
status: disabled|enabled
lockStatus: locked|unlocked
```
> **Deprecated (WPB-27912).** The `backgroundEffects` feature flag no longer
> affects meeting behaviour. The flag, its data type and its public/internal
> endpoints are retained for backward compatibility and are scheduled for
> removal in a future release.

The lock status for individual teams can be changed via the internal API (`PUT /i/teams/:tid/features/backgroundEffects/(un)?locked`).

The feature status for individual teams can be changed via the public API (if the feature is unlocked).
The flag now defaults to **enabled and locked** and the Helm configuration
override has been removed (operators can no longer change it via Helm). The
`GET/PUT /teams/:tid/features/backgroundEffects` and internal lock-status
endpoints return 404 at API version v17; they remain available through v16.
The aggregate endpoints `GET /feature-configs` and
`GET /teams/:tid/features` continue to include `backgroundEffects` at all API
versions, including v17.

### File Sharing

Expand Down
2 changes: 1 addition & 1 deletion integration/test/Test/FeatureFlags.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ testNonMemberAccess (Feature featureName) = do
-- authz check (403 no-team-member) is still exercised.
let getFeature = Public.getTeamFeature nonMember tid featureName
resp <-
if featureName == "meetingsPremium"
if featureName `elem` ["meetingsPremium", "backgroundEffects"]
then withAPIVersion 16 getFeature
else getFeature
assertForbidden resp
39 changes: 37 additions & 2 deletions integration/test/Test/FeatureFlags/BackgroundEffects.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,49 @@

module Test.FeatureFlags.BackgroundEffects where

import SetupHelpers (createTeam)
import Test.FeatureFlags.Util
import Testlib.Prelude

testPatchBackgroundEffects :: (HasCallStack) => App ()
testPatchBackgroundEffects = checkPatch OwnDomain "backgroundEffects" enabled
testPatchBackgroundEffects = withAPIVersion 16 $ checkPatch OwnDomain "backgroundEffects" enabled

testBackgroundEffects :: (HasCallStack) => APIAccess -> App ()
testBackgroundEffects access =
mkFeatureTests "backgroundEffects"
withAPIVersion 16
$ mkFeatureTests "backgroundEffects"
& addUpdate enabled
& runFeatureTests OwnDomain access

-- | WPB-27912: the public backgroundEffects endpoints are gated at v17 (404)
-- while remaining available through v16. Only the v16 GET is asserted here:
-- v16 PUT success is covered by 'testBackgroundEffects' (whose runFeatureTests
-- unlocks the feature first), and a public PUT in this test would 409
-- feature-locked against the default enabled+locked state.
testBackgroundEffectsRemovedAtV17 :: (HasCallStack) => App ()
testBackgroundEffectsRemovedAtV17 = do
(owner, tid, []) <- createTeam OwnDomain 0
let p = joinHttpPath ["teams", tid, "features", "backgroundEffects"]
body = object ["status" .= "enabled", "lockStatus" .= "locked"]
bindResponse (baseRequest owner Galley (ExplicitVersion 17) p >>= submit "GET") $ assertStatus 404
bindResponse (baseRequest owner Galley (ExplicitVersion 17) p <&> addJSON body >>= submit "PUT") $ assertStatus 404
bindResponse (baseRequest owner Galley (ExplicitVersion 16) p >>= submit "GET") $ \resp -> do
resp.status `shouldMatchInt` 200
resp.json %. "status" `shouldMatch` "enabled"
resp.json %. "lockStatus" `shouldMatch` "locked"

-- | Test version agnostic feature endpoints for `backgroundEffects`
--
-- Across versions, `backgroundEffects` is always set to `enabled` and `locked` to provide backwards compatibility.
-- From `V17` on, the feature itself has been removed.
testBackgroundEffectsListedAtV17 :: (HasCallStack) => App ()
testBackgroundEffectsListedAtV17 = do
(owner, tid, []) <- createTeam OwnDomain 0
let assertBackgroundEffects resp = do
resp.status `shouldMatchInt` 200
be <- resp.json %. "backgroundEffects"
be %. "status" `shouldMatch` "enabled"
be %. "lockStatus" `shouldMatch` "locked"
teamFeatures = joinHttpPath ["teams", tid, "features"]
bindResponse (baseRequest owner Galley (ExplicitVersion 17) "/feature-configs" >>= submit "GET") assertBackgroundEffects
bindResponse (baseRequest owner Galley (ExplicitVersion 17) teamFeatures >>= submit "GET") assertBackgroundEffects
2 changes: 1 addition & 1 deletion integration/test/Test/FeatureFlags/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ defAllFeatures =
],
"meetings" .= enabled,
"meetingsPremium" .= enabledLocked,
"backgroundEffects" .= disabledLocked,
"backgroundEffects" .= enabledLocked,
"preventAdminlessGroups"
.= object
[ "lockStatus" .= "unlocked",
Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type IFeatureAPI =
:<|> IFeatureStatusLockStatusPut StealthUsersConfig
:<|> IFeatureStatusLockStatusPut MeetingsConfig
:<|> Until 'V17 ::> IFeatureStatusLockStatusPut MeetingsPremiumConfig
:<|> IFeatureStatusLockStatusPut BackgroundEffectsConfig
:<|> Until 'V17 ::> IFeatureStatusLockStatusPut BackgroundEffectsConfig
Comment on lines 102 to +103

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAIK we don't use internal endpoints in a versioned manner. Please check that this doesn't break e.g. stern.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The Until 'V17 on the internal endpoint is safe: internal calls omit X-Wire-API-Version, so getVersionHeader defaults to V0, and the gate V0 >= V17 is False (never fires). Matches the existing
MeetingsPremiumConfig precedent on the adjacent line; plus, there is no reference in stern.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@blackheaven Have you considered to completely remove the internal endpoint? Or, who will use the versioned internal endpoint? 🤔

-- all feature configs
:<|> Named
"feature-configs-internal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ type FeatureAPI =
:<|> FeatureAPIGetPut MeetingsConfig
:<|> Deprecated ::> Until 'V17 ::> FeatureAPIGet MeetingsPremiumConfig
:<|> Deprecated ::> Until 'V17 ::> FeatureAPIPut MeetingsPremiumConfig
:<|> FeatureAPIGetPut BackgroundEffectsConfig
:<|> Deprecated ::> Until 'V17 ::> FeatureAPIGet BackgroundEffectsConfig
:<|> Deprecated ::> Until 'V17 ::> FeatureAPIPut BackgroundEffectsConfig

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See https://github.com/wireapp/wire-server/pull/5431/changes#r3758084593 - I unfortunately don't understand this split 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have squashed them


type VersionedFeatureAPIPut named reqBodyVersion cfg =
Named
Expand Down
8 changes: 6 additions & 2 deletions libs/wire-api/src/Wire/API/Team/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,11 @@ instance ToObjectSchema MeetingsPremiumConfig where
--------------------------------------------------------------------------------
-- BackgroundEffects Feature
--
-- Controls whether background effects are available in meetings.
-- /Deprecated (WPB-27912)./ This feature flag no longer affects meeting
-- behaviour and is kept solely for API compatibility. It defaults to
-- /enabled and locked/. Scheduled for removal in a future release.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should probably be Haddock of the data BackgroundEffectsConfig type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved down


{-# DEPRECATED BackgroundEffectsConfig "Deprecated (WPB-27912): no longer affects meeting behaviour; kept for API compatibility." #-}

data BackgroundEffectsConfig = BackgroundEffectsConfig
deriving (Eq, Show, Generic, GSOP.Generic)
Expand All @@ -2441,7 +2445,7 @@ instance ToSchema BackgroundEffectsConfig where
schema = object objectSchema

instance Default (LockableFeature BackgroundEffectsConfig) where
def = defLockedFeature
def = defLockedFeature {status = FeatureStatusEnabled}

instance IsFeatureConfig BackgroundEffectsConfig where
type FeatureSymbol BackgroundEffectsConfig = "backgroundEffects"
Expand Down
3 changes: 2 additions & 1 deletion services/galley/src/Galley/API/Public/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ featureAPI =
<@> featureAPIGetPut @MeetingsConfig
<@> mkNamedAPI @'("get", MeetingsPremiumConfig) getFeature
<@> mkNamedAPI @'("put", MeetingsPremiumConfig) setFeature
<@> featureAPIGetPut @BackgroundEffectsConfig
<@> mkNamedAPI @'("get", BackgroundEffectsConfig) getFeature
<@> mkNamedAPI @'("put", BackgroundEffectsConfig) setFeature

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, why do we need this change? Or, what changes it? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

outdated


deprecatedFeatureConfigAPI :: API DeprecatedFeatureAPI GalleyEffects
deprecatedFeatureConfigAPI =
Expand Down
Loading