Values being assigned to api.env.mode I found so far:
production
unit_test
dummy
So for so good. Problematic are the next two:
development
developer
Values should be consistent. Use an Enum?
$ master; edcfba6010c0b6a81841ca6e1e478835ce76191b
edcfba6010c0b6a81841ca6e1e478835ce76191b
Like api.env.context, this is a bit of a magic value.
The correct value is developer, but really, anything that's not production, unit_test or dummy has the same effect.
Historically this was used to avoid the API self-tests which are quite slow in production but something that should be done when developing a plugin or working directly on the API. unit_test was added to avoid logging so that the unit tests don't generate a bunch of useless logs.
I guess an Enum would be ok here I just wonder how much confusion it actually causes.
Azure tests should be fixed to use 'developer'. Should be a simple fix.
I suppose an Enum would the right place to properly document the different values. It's just something I noticed while skimming through the code.
Please keep in mind that we have had some customers that modified the mode flag in the past. An enum with validation may break installations.
Metadata Update from @cheimes: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/4684 - Issue assigned to cheimes - Issue priority set to: low - Issue set to the milestone: FreeIPA 4.8.7
master:
ipa-4-8:
Metadata Update from @cheimes: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.