Closed tangrammer closed 4 years ago
In a pairing session with @valllllll2000 we checked the available options for making code changes behind a feature flag. There are several options:
https://lumen.akvotest.org/?rqg=true
app_metadata
- https://auth0.com/docs/users/concepts/overview-user-metadataconfig.edn
config.edn
via k8s ConfigMap
environment
per tenant and expose those records in the /env
endpointWe understand that the flag should be short-lived. We would like:
There are services like launchdarkly.com that solves all the problems related to features flags.
Pros:
Cons:
We can enable a different code-path by adding a query-string parameter, e.g. /?rqg=true
. Some team members have experience with this.
Pros:
Cons:
We have experience with this approach. Previous flags were attached to a user configuration.
Pros:
Cons:
config.edn
We configure the system with config.edn
. We could add the configuration for one instance there.
Pros:
/env
endpointCons:
config.edn
via k8s ConfigMap
This is a variation of the previous approach. Instead of having a fixed configuration in config.edn
we could merge with with some other configuration exposed via a k8s ConfigMap
.
Pros:
/env
endpointCons:
environment
per tenant and expose those records in the /env
endpointIn this approach we add a new table to the tenant database environment
(or env
) and expose its content via the /env
endpoint.
Pros:
/env
Cons:
From the available list, I vote for the last one (new table env
with configuration per instance).
The pro/cons of each option misses the granularity of the feature flag. The first option is per segment, the second "a la carte", third per user, last per instance.
For testing "a la carte" is awesome. Per segment can implement all of the above options.
The pro/cons should also include which options are reusable for Flow or other services.
I am not endorsing any particular option.
And now talking without understanding the details, but please be careful to not overdo feature flags. From the description above it seems that we want to feature flag the import process. I would argue that we do not need a feature flag for that. All users seeing a new column with a piece of json seems like little risk.
@valllllll2000 @iperdomo @dlebrero
my only concern about using last approach Use a new table environment
is that so far we don't connect to the db if user isn't authenticated and keycloak authorized. My feeling is that not connecting to DB without having a not-boot-user is good, but maybe I'm overestimating that 🤔
Thanks for the feedback
The pro/cons of each option misses the granularity of the feature flag. The first option is per segment, the second "a la carte", third per user, last per instance.
Who needs that now?
For testing "a la carte" is awesome. Per segment can implement all of the above options.
a la carte is awesome but we don't need it
The pro/cons should also include which options are reusable for Flow or other services.
Also not a requirement right now. Flow already uses its own way via System.properties
.
I am not endorsing any particular option.
Thanks :+1:
And now talking without understanding the details, but please be careful to not overdo feature flags. From the description above it seems that we want to feature flag the import process. I would argue that we do not need a feature flag for that. All users seeing a new column with a piece of json seems like little risk.
That's why having a key -> value is the simplest way IMO.
my only concern about using last approach Use a new table environment is that so far we don't connect to the db if user isn't authenticated and keycloak authorized. My feeling is that not connecting to DB without having a not-boot-user is good, but maybe I'm overestimating tha
For my this is not a concern. If we want to optimize (for a reason I really don't understand) those DB calls, we can add a query parameter to include the dynamic part. By default _pre-authentication /env
only respond with static config settings (IdP, piwik, etc). Post-authentication /env?dynamic=true
or something similar that actual makes the DB and includes the environment: {}
key.
@tangrammer and @iperdomo I believe we can close this issue. Is that correct or do you need to do something more related to the feature flag we have in place?
Nothing pending
Context
Relates #2127
https://github.com/akvo/akvo-lumen/commit/ecbb395947a2dcebfe60e7a857380ad563c7f981
The new columns created by RQGs should be invisible with no feature flag.
Once included in client-side we need to adapt backend to it.