#8313 Values of api.env.mode are inconsistent
Closed: fixed 3 years ago by cheimes. Opened 3 years ago by carbenium.

Issue

Values being assigned to api.env.mode I found so far:

  • production
  • unit_test
  • dummy

So for so good. Problematic are the next two:

Expected behavior

Values should be consistent. Use an Enum?

Version/Release/Distribution

$ master; 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 guess an Enum would be ok here I just wonder how much confusion it actually causes.

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

3 years ago

master:

  • 82ba4db Make api.env.mode consistent

ipa-4-8:

  • 3234892 Make api.env.mode consistent

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata