codeforboston / maple

MAPLE makes it easy for anyone to view and submit testimony to the Massachusetts Legislature about the bills that will shape our future.
https://mapletestimony.org
MIT License
38 stars 106 forks source link

Feature Flag Improvements #1503

Closed Mephistic closed 1 month ago

Mephistic commented 2 months ago

Detailed Description We should upgrade the feature flag system so that we can set the value of flags without requiring a code change and deploy.

Reason for the Suggestion The current feature flag system is useful for merging changes before we're fully ready to make them available in production, but it's limited by the fact that the flags are just static constants. This means that we have to set the value of the flags at merge time, and will need a new merge and deploy in order to actually change a flag value for an environment. This makes it impractical to test the different states of the flag in the dev environment before rolling out to production, which reduces our confidence in our ability to safely deploy to production.

A more robust flag system would have helped catch a bug in a recent deploy. We knew there was a specific flag state we wanted to test on the dev environment, but weren't able to configure the dev environment to set that flag.

Success Criteria

Additional Context

Checklist

Mephistic commented 2 months ago

Looks like the query param route may be the way to go here - it's intuitive for both devs and non-devs to use, and has the advantage of making it easy to pass links to the site with different flag states.

Statically generated pages would be nice to have for the MVP here, but we don't have many of those and likely won't need feature flagging on the ones we do have (e.g. the Learn Testimony pages), so I don't think it's worth going out of our way to include those in this issue.

The third-party solutions are definitely overkill for our immediate needs (and our foreseeable future needs).

Mephistic commented 1 month ago

The query param pass on this is implemented. There are certainly potential future improvements around flagging, but we can open a new issue for those as we hit pain points with the current method.