Using code references
The Code references section is only a small component of a feature flag and was detailed in Chapter 8, Migrations and Testing Your Infrastructure. Please refer to that chapter to learn how to use code references. However, there is one thing to note that was not covered in that chapter.
Figure 9.19 shows the default variation to be served at the bottom right, where it says If LaunchDarkly is unreachable or if no off variation is set, serve false. LaunchDarkly's code reference tool has detected where the flag is implemented within the code and reads the value that is hardcoded as the default value. This is useful information as a flag could be configured within LaunchDarkly to return true
for all targeting rules and even when targeting is disabled. However, if the service is unreachable and the default value is hardcoded as false
, then that is the value that the application will work with.
In this scenario, it is a good practice to remove feature flag...