As an alternative to branching, switching applications over to use persons v4 and BDPs can be cleanly cut over via feature flags:
1. environment variables
Services being called are conditionally controlled with environment variables. Switching flags is as easy as updating a variable but requires a redeployment.
Example implementation:
USE_BDP=true
if (USE_BDP) {
// get data new way
} else {
// use old implementation
}
2. config file
Use a single config file with every feature flag contained within. Import that file to access certain flags.
{
"bdp": true
}
flags = require('./app/config/flags.json')
if (flags.bdp) {
// get data new way
} else {
// use old implementation
}
3. use 3rd party feature flag service
Toggle feature flags in real time via api provided by our service or 3rd party service. Centralized, but huge overhead.
Possible Vue example (snippet from email alias manager)
<template>
<div>
<!-- <h2>Admin Functions: </h2> -->
<div v-if="namesearch">
<h2>Proxy Search by Person: </h2>
<br>
<byu-person-lookup
@byu-lookup-results-select="found_person"
id="person_navigation"
context="admin">
<byu-personsv4-datasource v-if="PERSONS_V4"></byu-personsv4-datasource>
<byu-personsv3-datasource v-else></byu-personsv3-datasource>
</byu-person-lookup>
</div>
</template>
Transitioning these endpoints using feature flags allows us to commit the necessary changes without changing anything for the production application. Instead of the changes sitting in a separate branch until March, (which could get forgotten or outdated), we can commit the changes now and test that they work by simply changing an environment variable/config property locally while being certain that the transitioned changes will remain compatible as the application is maintained for next few months.
Possible steps:
- Add new endpoints that are toggled behind a feature flag, add the feature flags using one of the methods above.
- Test that it works locally, leave the flag with the old endpoints until March
- When it's time to transition, update the flag and ensure everything works exactly the same
- Remove the old endpoints and feature flags