Integrate with OSM Teams using a feature flag#408
Integrate with OSM Teams using a feature flag#408modulitos wants to merge 5 commits intoOSMCha:mainfrom
Conversation
|
Just quick thoughts: @modulitos - I'd favour keeping it simple and having an environment variable turn this feature on / off for now. It seems like as is it would allow other developers and users to try it out and see how using the OSM Teams API for this would work for the end-user. @willemarcel - it would be great to get your initial thoughts on this -- do you think it's a better idea to have a flag to use OSM-teams or OSMCha, or let users filter by either? I do think it would be really nice if we could incrementally move toward letting teams management happen in OSM-Teams and OSMCha handle the search and filter. Not sure if this seems reasonable / what you think it might take to get us there? |
| export const isProd = process.env.REACT_APP_STACK === 'PRODUCTION'; | ||
| export const isLocal = process.env.NODE_ENV === 'development'; | ||
| export const stack = process.env.REACT_APP_STACK; | ||
| export const isOsmTeamsEnabled = false; |
There was a problem hiding this comment.
This feature flag is off by default. Setting it to true will have OSM Cha send requests to the OSM Teams api, instead of the OSM Cha mapping-teams endpoint
Addresses: #390
This branch introduces the ability to fetch teams from the OSM Teams service instead of the OSMCha endpoint. This is controllable using a feature flag in the
/src/config/index.jsfile. This PR should not cause any changes to the production website, because the feature flag is set tofalseby default.I figured that a feature flag was the simplest and safest way to eventually migrating all team data to OSM Teams. Although here are all of the options I considered:
1. Choosing a service via feature flag
Keep the feature flag, but refactor it behind an environment variable or command line arg.
Non-goal, but worth considering in the future, is to make the feature flag configurable by the user (eg: via a menu checkbox option or directly in the js console)
PROS:
yarn run osm-teamswill start the app with the osm-teams feature flag enabled.CONS:
2. Implicitly merging the teams from both services
We can have the client fetch teams from both OSMCha and osm-teams, and merge them on the client as well. If we do this, however, we will need to answer some questions about merging teams. For example, are we going to have teams with the same id's on both services? If so, how will we handle the merge? And for how long do we want to persist teams from both endpoints?
3. Explicitly selecting the teams from both services
Add an extra UI widget that will allow the user to choose teams from OSMCha or osm-teams explicitely.
PROS
CONS
I think I would favor option 1 because it would allow incremental development, and once we feel that osm-teams is ready, we can enable the feature flag by default or remove it entirely. Also, it seems like the goal is to replace OSMCha's team service entirely with the osm-teams service, and not support the ability to use both services simultaneously. But of course, I'm lacking some context and there might be some use cases that I'm missing.
Let me know if there are any thoughts 👍
TODO's:
exclude_teamsandexclude_trusted_teamsfilters to make sure they are working with the OSM Teams service. I suspect they will need to be updated to leverage the new filter types.