-
Notifications
You must be signed in to change notification settings - Fork 325
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
Simplify team feature database interface; add validate-saml-emails feature to stern/backoffice #1129
Conversation
There was one Data.* module per column in the team_features table. That may make sense at some point in the distant future, but as long as all those columns are just booleans, having one haskell module to access any of them in a uniform way saves a lot of boilerplate.
3c6eaee
to
dfff96d
Compare
that was just one stupid typo.
done.
nothing needed to be done here: thanks to the generic end-points, stern needs no change any more if a new construct is added to not tested yet. i'm not sure any more how to run stern in an integration test setup. |
-- | Is a given feature enabled or disabled? (If field is null: disabled.) | ||
getFlag :: MonadClient m => TeamId -> TeamFeatureName -> m (Maybe TeamFeatureStatus) | ||
getFlag tid feature = fmap toFlag <$> retry x1 (query1 (select feature) (params Quorum (Identity tid))) | ||
where | ||
toFlag (Identity Nothing) = TeamFeatureDisabled | ||
toFlag (Identity (Just status)) = status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't default to TeamFeatureDisabled
here, for TeamSearchVisibility and SSO, the defaults come from galley config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks! hum, annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it was easier to fix than I thought, but it still was a bug: a2264fa
Now getFlag
will also return Nothing
for non-existant teams, but I think that was another bug: the situation that the entire row is missing should not be distinguished from the situation where the row is present, but the column is null. Which of the two happens arbitrarily depends on whether other team features have been touched for this team in the past.
Co-authored-by: Akshay Mankar <akshay@wire.com>
…/wireapp/wire-server into fisx/streamline-team-feature-flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
…ature to stern/backoffice (#1129) * Simplify team feature database interface. There was one Data.* module per column in the team_features table. That may make sense at some point in the distant future, but as long as all those columns are just booleans, having one haskell module to access any of them in a uniform way saves a lot of boilerplate. * Use new feature flag types and make a generic end-point in stern. * Add FUTUREWORKs. Co-authored-by: Akshay Mankar <akshay@wire.com>
Fixes https://github.com/zinfra/backend-issues/issues/1490
There was one Data.* module per column in the team_features table. That may make sense at some point in the distant future, but as long as all those columns are just booleans, having one haskell module to access any of them in a uniform way saves a lot of boilerplate.
I tried to sneak this into #1113, but it wasn't ready: