Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature flag refactoring (part 1) #4181

Merged
merged 34 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b87ad05
Rename feature types
pcapriotti Aug 1, 2024
18423bd
Cleanup LockableFeature
pcapriotti Aug 1, 2024
d1b6aa5
Cleanup LockableFeaturePatch
pcapriotti Aug 1, 2024
b8822a2
Remove FeatureLockBase
pcapriotti Aug 2, 2024
3de1a1f
Cleanup Feature
pcapriotti Aug 2, 2024
d6ec0b3
Remove unused function
pcapriotti Aug 2, 2024
6db8d66
Replace adhoc default methods with def
pcapriotti Aug 6, 2024
bd932f4
Move MakeFeature to a separate module
pcapriotti Aug 2, 2024
f9fa49f
Create StoredFeature type class
pcapriotti Aug 2, 2024
05a54ba
Abstract setFeature
pcapriotti Aug 2, 2024
bb9ddd1
Remove StoredFeature type class
pcapriotti Aug 5, 2024
41fd3e0
Unify FeatureReadRow and FeatureWriteRow
pcapriotti Aug 5, 2024
1093a94
Add lockStatusColumn to MakeFeature
pcapriotti Aug 6, 2024
24fc44e
Turn featureColumns into a list
pcapriotti Aug 6, 2024
3ba7688
Extend MakeFeature abstraction to nullary features
pcapriotti Aug 6, 2024
c503c87
Use Tagged to improve type inference
pcapriotti Aug 6, 2024
f0f551c
Add storeFeatureLockStatus
pcapriotti Aug 6, 2024
aa5183c
Use TH to generate feature singleton cases
pcapriotti Aug 6, 2024
325b298
Rename unDbFeature to applyDbFeature
pcapriotti Aug 6, 2024
a15c86b
[feat] galley - make compile with AllFeatures represented as NP
MangoIV Aug 6, 2024
e00b538
Incorporate lock status in feature queries
pcapriotti Aug 6, 2024
2bf29b7
Automate concatenation of rows
pcapriotti Aug 7, 2024
00f853a
[chore] add changelog entry
MangoIV Aug 7, 2024
9d328b3
Remove todo
pcapriotti Aug 8, 2024
70f1a1f
Add haddock to generateSOPInstances
pcapriotti Aug 8, 2024
59ce0ad
Recurse on all features in Arbitray Event instance
pcapriotti Aug 8, 2024
1b0d45b
Remove redundant hiding clause
pcapriotti Aug 8, 2024
cae9fef
Remove unnecessary extensions
pcapriotti Aug 8, 2024
d71e2e2
Rename mkFeature and unmkFeature
pcapriotti Aug 8, 2024
835f925
Add generated code excerpt to generateTupleP
pcapriotti Aug 8, 2024
cb76183
Remove unnecessary constraint
pcapriotti Aug 8, 2024
ca74ec3
Lint
pcapriotti Aug 8, 2024
e4737a1
Finish implementation of getAllFeatureConfigs
pcapriotti Aug 9, 2024
e269b7e
Fix conference calling flag assertions
pcapriotti Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ stack-dev.yaml
# HIE db files (e.g. generated for stan)
*.hie

# dump timings
*.dump-timings

# generated files under .local
.local

Expand Down
7 changes: 7 additions & 0 deletions changelog.d/5-internal/feature-flag-refactoring-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Refactor feature flags
- Improved naming slightly. Features types are now called `Feature`, `LockableFeature` and `LockableFeaturePatch`
- Turned `AllFeatures` into an extensible record type
- Removed `WithStatusBase` barbie.
- Deleted obsolete `computeFeatureConfigForTeamUser`
- Abstracted `getFeature` and `setFeature`
- Abstracted getAllTeamFeatures
5 changes: 2 additions & 3 deletions integration/test/Test/FeatureFlags.hs
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,7 @@ testConferenceCallingInternal = do
do
notif <- awaitMatch isFeatureConfigUpdateNotif ws
notif %. "payload.0.name" `shouldMatch` "conferenceCalling"
-- TODO: the patch event is currently wrong, and does not reflect the update
notif %. "payload.0.data" `shouldMatch` (confCalling defaultArgs {status = "disabled", lockStatus = Just "locked"})
notif %. "payload.0.data" `shouldMatch` (confCalling defaultArgs {status = "enabled", lockStatus = Just "unlocked"})
checkFeature "conferenceCalling" m tid (confCalling defaultArgs {status = "enabled", lockStatus = Just "unlocked"})

-- just disable
Expand All @@ -836,7 +835,7 @@ testConferenceCallingInternal = do
do
notif <- awaitMatch isFeatureConfigUpdateNotif ws
notif %. "payload.0.name" `shouldMatch` "conferenceCalling"
notif %. "payload.0.data" `shouldMatch` (confCalling defaultArgs {lockStatus = Just "unlocked"})
notif %. "payload.0.data" `shouldMatch` (confCalling defaultArgs)
checkFeature "conferenceCalling" m tid (confCalling defaultArgs)

_testLockStatusWithConfig ::
Expand Down
2 changes: 2 additions & 0 deletions libs/galley-types/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, bytestring-conversion
, containers
, crypton
, data-default
, errors
, gitignoreSource
, imports
Expand All @@ -34,6 +35,7 @@ mkDerivation {
bytestring-conversion
containers
crypton
data-default
errors
imports
lens
Expand Down
1 change: 1 addition & 0 deletions libs/galley-types/galley-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ library
, bytestring-conversion
, containers >=0.5
, crypton
, data-default
, errors
, imports
, lens >=4.12
Expand Down
45 changes: 23 additions & 22 deletions libs/galley-types/src/Galley/Types/Teams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import Data.Aeson
import Data.Aeson.Types qualified as A
import Data.ByteString (toStrict)
import Data.ByteString.UTF8 qualified as UTF8
import Data.Default
import Data.Id (UserId)
import Data.Schema qualified as Schema
import Data.Set qualified as Set
Expand All @@ -84,18 +85,18 @@ data FeatureFlags = FeatureFlags
_flagTeamSearchVisibility :: !FeatureTeamSearchVisibilityAvailability,
_flagAppLockDefaults :: !(Defaults (ImplicitLockStatus AppLockConfig)),
_flagClassifiedDomains :: !(ImplicitLockStatus ClassifiedDomainsConfig),
_flagFileSharing :: !(Defaults (WithStatus FileSharingConfig)),
_flagConferenceCalling :: !(Defaults (WithStatus ConferenceCallingConfig)),
_flagSelfDeletingMessages :: !(Defaults (WithStatus SelfDeletingMessagesConfig)),
_flagConversationGuestLinks :: !(Defaults (WithStatus GuestLinksConfig)),
_flagFileSharing :: !(Defaults (LockableFeature FileSharingConfig)),
_flagConferenceCalling :: !(Defaults (LockableFeature ConferenceCallingConfig)),
_flagSelfDeletingMessages :: !(Defaults (LockableFeature SelfDeletingMessagesConfig)),
_flagConversationGuestLinks :: !(Defaults (LockableFeature GuestLinksConfig)),
_flagsTeamFeatureValidateSAMLEmailsStatus :: !(Defaults (ImplicitLockStatus ValidateSAMLEmailsConfig)),
_flagTeamFeatureSndFactorPasswordChallengeStatus :: !(Defaults (WithStatus SndFactorPasswordChallengeConfig)),
_flagTeamFeatureSndFactorPasswordChallengeStatus :: !(Defaults (LockableFeature SndFactorPasswordChallengeConfig)),
_flagTeamFeatureSearchVisibilityInbound :: !(Defaults (ImplicitLockStatus SearchVisibilityInboundConfig)),
_flagMLS :: !(Defaults (WithStatus MLSConfig)),
_flagOutlookCalIntegration :: !(Defaults (WithStatus OutlookCalIntegrationConfig)),
_flagMlsE2EId :: !(Defaults (WithStatus MlsE2EIdConfig)),
_flagMlsMigration :: !(Defaults (WithStatus MlsMigrationConfig)),
_flagEnforceFileDownloadLocation :: !(Defaults (WithStatus EnforceFileDownloadLocationConfig)),
_flagMLS :: !(Defaults (LockableFeature MLSConfig)),
_flagOutlookCalIntegration :: !(Defaults (LockableFeature OutlookCalIntegrationConfig)),
_flagMlsE2EId :: !(Defaults (LockableFeature MlsE2EIdConfig)),
_flagMlsMigration :: !(Defaults (LockableFeature MlsMigrationConfig)),
_flagEnforceFileDownloadLocation :: !(Defaults (LockableFeature EnforceFileDownloadLocationConfig)),
_flagLimitedEventFanout :: !(Defaults (ImplicitLockStatus LimitedEventFanoutConfig))
}
deriving (Eq, Show, Generic)
Expand Down Expand Up @@ -137,23 +138,23 @@ instance FromJSON FeatureFlags where
<*> obj .: "legalhold"
<*> obj .: "teamSearchVisibility"
<*> withImplicitLockStatusOrDefault obj "appLock"
<*> (fromMaybe (ImplicitLockStatus (defFeatureStatus @ClassifiedDomainsConfig)) <$> (obj .:? "classifiedDomains"))
<*> (fromMaybe (Defaults (defFeatureStatus @FileSharingConfig)) <$> (obj .:? "fileSharing"))
<*> (fromMaybe (Defaults (defFeatureStatus @ConferenceCallingConfig)) <$> (obj .:? "conferenceCalling"))
<*> (fromMaybe (Defaults (defFeatureStatus @SelfDeletingMessagesConfig)) <$> (obj .:? "selfDeletingMessages"))
<*> (fromMaybe (Defaults (defFeatureStatus @GuestLinksConfig)) <$> (obj .:? "conversationGuestLinks"))
<*> (fromMaybe (ImplicitLockStatus def) <$> (obj .:? "classifiedDomains"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "fileSharing"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "conferenceCalling"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "selfDeletingMessages"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "conversationGuestLinks"))
<*> withImplicitLockStatusOrDefault obj "validateSAMLEmails"
<*> (fromMaybe (Defaults (defFeatureStatus @SndFactorPasswordChallengeConfig)) <$> (obj .:? "sndFactorPasswordChallenge"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "sndFactorPasswordChallenge"))
<*> withImplicitLockStatusOrDefault obj "searchVisibilityInbound"
<*> (fromMaybe (Defaults (defFeatureStatus @MLSConfig)) <$> (obj .:? "mls"))
<*> (fromMaybe (Defaults (defFeatureStatus @OutlookCalIntegrationConfig)) <$> (obj .:? "outlookCalIntegration"))
<*> (fromMaybe (Defaults (defFeatureStatus @MlsE2EIdConfig)) <$> (obj .:? "mlsE2EId"))
<*> (fromMaybe (Defaults (defFeatureStatus @MlsMigrationConfig)) <$> (obj .:? "mlsMigration"))
<*> (fromMaybe (Defaults (defFeatureStatus @EnforceFileDownloadLocationConfig)) <$> (obj .:? "enforceFileDownloadLocation"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "mls"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "outlookCalIntegration"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "mlsE2EId"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "mlsMigration"))
<*> (fromMaybe (Defaults def) <$> (obj .:? "enforceFileDownloadLocation"))
<*> withImplicitLockStatusOrDefault obj "limitedEventFanout"
where
withImplicitLockStatusOrDefault :: forall cfg. (IsFeatureConfig cfg, Schema.ToSchema cfg) => Object -> Key -> A.Parser (Defaults (ImplicitLockStatus cfg))
withImplicitLockStatusOrDefault obj fieldName = fromMaybe (Defaults (ImplicitLockStatus (defFeatureStatus @cfg))) <$> obj .:? fieldName
withImplicitLockStatusOrDefault obj fieldName = fromMaybe (Defaults (ImplicitLockStatus def)) <$> obj .:? fieldName

instance FromJSON FeatureSSO where
parseJSON (String "enabled-by-default") = pure FeatureSSOEnabledByDefault
Expand Down
49 changes: 25 additions & 24 deletions libs/wire-api/src/Wire/API/Event/FeatureConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Data.OpenApi qualified as S
import Data.Schema
import GHC.TypeLits (KnownSymbol)
import Imports
import Test.QuickCheck.Gen (oneof)
import Test.QuickCheck.Gen
import Wire.API.Team.Feature
import Wire.Arbitrary (Arbitrary (..), GenericUniform (..))

Expand All @@ -42,30 +42,31 @@ data Event = Event
deriving (Eq, Show, Generic)
deriving (A.ToJSON, A.FromJSON) via Schema Event

arbitraryFeature :: forall cfg. (IsFeatureConfig cfg, ToSchema cfg, Arbitrary cfg) => Gen A.Value
arbitraryFeature = toJSON <$> arbitrary @(LockableFeature cfg)

class AllArbitraryFeatures cfgs where
allArbitraryFeatures :: [Gen A.Value]

instance AllArbitraryFeatures '[] where
allArbitraryFeatures = []

instance
( IsFeatureConfig cfg,
ToSchema cfg,
Arbitrary cfg,
AllArbitraryFeatures cfgs
) =>
AllArbitraryFeatures (cfg : cfgs)
where
allArbitraryFeatures = arbitraryFeature @cfg : allArbitraryFeatures @cfgs
Comment on lines +48 to +62
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might be possible with recursion on SList which reifies the type level list. You also need a csontraint on all elements, so perhaps smth like cpara_SList might work this time.


instance Arbitrary Event where
arbitrary =
do
let arbConfig =
oneof
[ arbitrary @(WithStatus SSOConfig) <&> toJSON,
arbitrary @(WithStatus SearchVisibilityAvailableConfig) <&> toJSON,
arbitrary @(WithStatus ValidateSAMLEmailsConfig) <&> toJSON,
arbitrary @(WithStatus DigitalSignaturesConfig) <&> toJSON,
arbitrary @(WithStatus AppLockConfig) <&> toJSON,
arbitrary @(WithStatus FileSharingConfig) <&> toJSON,
arbitrary @(WithStatus ClassifiedDomainsConfig) <&> toJSON,
arbitrary @(WithStatus ConferenceCallingConfig) <&> toJSON,
arbitrary @(WithStatus SelfDeletingMessagesConfig) <&> toJSON,
arbitrary @(WithStatus GuestLinksConfig) <&> toJSON,
arbitrary @(WithStatus SndFactorPasswordChallengeConfig) <&> toJSON,
arbitrary @(WithStatus SearchVisibilityInboundConfig) <&> toJSON,
arbitrary @(WithStatus MLSConfig) <&> toJSON,
arbitrary @(WithStatus ExposeInvitationURLsToTeamAdminConfig) <&> toJSON
]
Event
<$> arbitrary
<*> arbitrary
<*> arbConfig
Event
<$> arbitrary
<*> arbitrary
<*> oneof (allArbitraryFeatures @Features)

data EventType = Update
deriving (Eq, Show, Generic)
Expand Down Expand Up @@ -98,5 +99,5 @@ instance ToJSONObject Event where
instance S.ToSchema Event where
declareNamedSchema = schemaToSwagger

mkUpdateEvent :: forall cfg. (IsFeatureConfig cfg, ToSchema cfg, KnownSymbol (FeatureSymbol cfg)) => WithStatus cfg -> Event
mkUpdateEvent :: forall cfg. (IsFeatureConfig cfg, ToSchema cfg, KnownSymbol (FeatureSymbol cfg)) => LockableFeature cfg -> Event
mkUpdateEvent ws = Event Update (featureName @cfg) (toJSON ws)
6 changes: 3 additions & 3 deletions libs/wire-api/src/Wire/API/Routes/Internal/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import Data.Text qualified as Text
import GHC.TypeLits
import Imports hiding (head)
import Network.HTTP.Client qualified as HTTP
import Servant hiding (Handler, WithStatus, addHeader, respond)
import Servant hiding (Handler, addHeader, respond)
import Servant.Client qualified as Servant
import Servant.Client.Core qualified as Servant
import Servant.OpenApi (HasOpenApi (toOpenApi))
Expand Down Expand Up @@ -114,7 +114,7 @@ type GetAccountConferenceCallingConfig =
:> Capture "uid" UserId
:> "features"
:> "conferenceCalling"
:> Get '[Servant.JSON] (WithStatusNoLock ConferenceCallingConfig)
:> Get '[Servant.JSON] (Feature ConferenceCallingConfig)

type PutAccountConferenceCallingConfig =
Summary
Expand All @@ -123,7 +123,7 @@ type PutAccountConferenceCallingConfig =
:> Capture "uid" UserId
:> "features"
:> "conferenceCalling"
:> Servant.ReqBody '[Servant.JSON] (WithStatusNoLock ConferenceCallingConfig)
:> Servant.ReqBody '[Servant.JSON] (Feature ConferenceCallingConfig)
:> Put '[Servant.JSON] NoContent

type DeleteAccountConferenceCallingConfig =
Expand Down
10 changes: 5 additions & 5 deletions libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Data.OpenApi (OpenApi, info, title)
import Data.Range
import GHC.TypeLits (AppendSymbol)
import Imports hiding (head)
import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi
import Wire.API.ApplyMods
import Wire.API.Bot
Expand Down Expand Up @@ -410,17 +410,17 @@ type FeatureStatusBasePutInternal errs featureConfig =
(AppendSymbol "Put config for " (FeatureSymbol featureConfig))
errs
featureConfig
( ReqBody '[JSON] (WithStatusNoLock featureConfig)
:> Put '[JSON] (WithStatus featureConfig)
( ReqBody '[JSON] (Feature featureConfig)
:> Put '[JSON] (LockableFeature featureConfig)
)

type FeatureStatusBasePatchInternal errs featureConfig =
FeatureStatusBaseInternal
(AppendSymbol "Patch config for " (FeatureSymbol featureConfig))
errs
featureConfig
( ReqBody '[JSON] (WithStatusPatch featureConfig)
:> Patch '[JSON] (WithStatus featureConfig)
( ReqBody '[JSON] (LockableFeaturePatch featureConfig)
:> Patch '[JSON] (LockableFeature featureConfig)
)

type FeatureStatusBaseInternal desc errs featureConfig a =
Expand Down
6 changes: 3 additions & 3 deletions libs/wire-api/src/Wire/API/Routes/Internal/LegalHold.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Data.OpenApi (OpenApi)
import Data.OpenApi.Lens
import Data.Proxy
import Imports
import Servant.API hiding (Header, WithStatus)
import Servant.API
import Servant.OpenApi
import Wire.API.Team.Feature

Expand All @@ -32,10 +32,10 @@ type InternalLegalHoldAPI =
:> "teams"
:> ( Capture "tid" TeamId
:> "legalhold"
:> Get '[JSON] (WithStatus LegalholdConfig)
:> Get '[JSON] (LockableFeature LegalholdConfig)
:<|> Capture "tid" TeamId
:> "legalhold"
:> ReqBody '[JSON] (WithStatusNoLock LegalholdConfig)
:> ReqBody '[JSON] (Feature LegalholdConfig)
:> Put '[] NoContent
)

Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/Routes/Public/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

module Wire.API.Routes.Public.Galley where

import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi.Internal.Orphans ()
import Wire.API.Routes.API
import Wire.API.Routes.Public.Galley.Bot
Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/Routes/Public/Galley/Bot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

module Wire.API.Routes.Public.Galley.Bot where

import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi.Internal.Orphans ()
import Wire.API.Error
import Wire.API.Error.Galley
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Data.Id
import Data.Range
import Data.SOP (I (..), NS (..))
import Imports hiding (head)
import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi.Internal.Orphans ()
import Wire.API.Conversation
import Wire.API.Conversation.Code
Expand Down Expand Up @@ -884,7 +884,7 @@ type ConversationAPI =
:> Capture' '[Description "Conversation ID"] "cnv" ConvId
:> "features"
:> FeatureSymbol GuestLinksConfig
:> Get '[Servant.JSON] (WithStatus GuestLinksConfig)
:> Get '[Servant.JSON] (LockableFeature GuestLinksConfig)
)
-- This endpoint can lead to the following events being sent:
-- - ConvCodeDelete event to members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
module Wire.API.Routes.Public.Galley.CustomBackend where

import Data.Domain
import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi.Internal.Orphans ()
import Wire.API.CustomBackend
import Wire.API.Error
Expand Down
16 changes: 8 additions & 8 deletions libs/wire-api/src/Wire/API/Routes/Public/Galley/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module Wire.API.Routes.Public.Galley.Feature where

import Data.Id
import GHC.TypeLits
import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi.Internal.Orphans ()
import Wire.API.ApplyMods
import Wire.API.Conversation.Role
Expand Down Expand Up @@ -157,7 +157,7 @@ type FeatureStatusBaseGet featureConfig =
:> Capture "tid" TeamId
:> "features"
:> FeatureSymbol featureConfig
:> Get '[Servant.JSON] (WithStatus featureConfig)
:> Get '[Servant.JSON] (LockableFeature featureConfig)

type FeatureStatusBasePutPublic errs featureConfig =
Summary (AppendSymbol "Put config for " (FeatureSymbol featureConfig))
Expand All @@ -170,8 +170,8 @@ type FeatureStatusBasePutPublic errs featureConfig =
:> Capture "tid" TeamId
:> "features"
:> FeatureSymbol featureConfig
:> ReqBody '[Servant.JSON] (WithStatusNoLock featureConfig)
:> Put '[Servant.JSON] (WithStatus featureConfig)
:> ReqBody '[Servant.JSON] (Feature featureConfig)
:> Put '[Servant.JSON] (LockableFeature featureConfig)

-- | A type for a GET endpoint for a feature with a deprecated path
type FeatureStatusBaseDeprecatedGet desc featureConfig =
Expand All @@ -191,7 +191,7 @@ type FeatureStatusBaseDeprecatedGet desc featureConfig =
:> Capture "tid" TeamId
:> "features"
:> DeprecatedFeatureName featureConfig
:> Get '[Servant.JSON] (WithStatus featureConfig)
:> Get '[Servant.JSON] (LockableFeature featureConfig)
)

-- | A type for a PUT endpoint for a feature with a deprecated path
Expand All @@ -213,8 +213,8 @@ type FeatureStatusBaseDeprecatedPut desc featureConfig =
:> Capture "tid" TeamId
:> "features"
:> DeprecatedFeatureName featureConfig
:> ReqBody '[Servant.JSON] (WithStatusNoLock featureConfig)
:> Put '[Servant.JSON] (WithStatus featureConfig)
:> ReqBody '[Servant.JSON] (Feature featureConfig)
:> Put '[Servant.JSON] (LockableFeature featureConfig)

type FeatureConfigDeprecatedGet desc featureConfig =
Named
Expand All @@ -228,7 +228,7 @@ type FeatureConfigDeprecatedGet desc featureConfig =
:> CanThrow 'TeamNotFound
:> "feature-configs"
:> FeatureSymbol featureConfig
:> Get '[Servant.JSON] (WithStatus featureConfig)
:> Get '[Servant.JSON] (LockableFeature featureConfig)
)

type AllFeatureConfigsUserGet =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module Wire.API.Routes.Public.Galley.LegalHold where
import Data.Id
import GHC.Generics
import Generics.SOP qualified as GSOP
import Servant hiding (WithStatus)
import Servant
import Servant.OpenApi.Internal.Orphans ()
import Wire.API.Conversation.Role
import Wire.API.Error
Expand Down
Loading
Loading