FloeSpecConverter is used to convert between two different Floe spec versions, as long as the final spec version is lower than the starting version.

Each conversion is programmed as a SpecConverter class in floe/versioning/converters.py.

Creating Spec Converter class

Each SpecConverter is a subclass of SpecConvertBaseClass. * SpecConverter is converting between two different Floe spec versions * there cannot be two SpecConverter classes that convert from the same Floe spec version to two different spec versions * SpecConverter does not convert to higher spec version. Old Floe spec can be parsed by newer version of Floe. * SpecConverter class cannot have from_version and to_version attributes pointing to the same version

Using Spec Converters

To perform Floe spec conversion between two arbitrary spec versions, SpecConverter classes are chained together by floe.versioning.parser.FloeSpecConverter. If the target version is the same as originating Floe spec version, FloeSpecConverter will not modify the input spec.

When running in Orion, Floe spec version produced by serializing Workfloe to JSON using Workfloe.json() is controlled by environment variable ORION_FLOE_SPEC_VERSION: * when ORION_FLOE_SPEC_VERSION is not set, Workfloe.json() will produce Floe spec 1.0 * when ORION_FLOE_SPEC_VERSION is set and points to valid Floe spec version, Workfloe.json() will produce Floe spec with this version

This logic is implemented to avoid Orion stacks running older versions of Floe package failing to parse specs produced by Workfloe packages created with newer version of Floe.

Note that when running locally ORION_FLOE_SPEC_VERSION variable has no effect and Floe will return Floe spec in current version. This is implemented to avoid situation when absence of this variable in user environment would cause Floe to silently produce Floe spec version 1.0. Different Floe spec version can be requested by calling Workfloe.json(output_spec_version=<version>).

Floe Package vs Floe Spec Versions

Floe Version

Spec Version