-
Notifications
You must be signed in to change notification settings - Fork 4
Generation and reverse generation
Generation is the process of creating content in the target system.
Content files most often return a single or multiple entities that we want generated. Each model object is broken down into a set of commands and entities that are passed to a standard REST API Client. From there they are sent to the respective target system API for creation or modification.
The order of generation is as follows:
- Content files may be prefixed with 3-digit index followed by dash (for example
010-my-content.groovy
).- Files with a lower index will be processed first.
- Files with the same index will be processed in parallel
- If no index is specified, the files will be treated as they have an index of 500 (default value)
- When multiple entities are to be created from a single content file, these are processed sequentially in the order of definition.
This is similar to the above, but it runs backwards. Using the client, all the required objects from the target system are fetched. These objects are translated into model objects that are written down to content files.
It's important to note, that even if this operation looks similar to exporting data from the target system, it doesn't have the same parity. Unlike exporting, When the data is translated from the API object to model object, only the known bits are written down. It's possible some things are lost in translation. It's also possible that some things are added if that makes sense for generation.
It's highly recommended to verify your content after reverse generation.
- Make sure all the passwords and secrets are put down - we cannot export these.
- Make sure there are no hardcoded IDs referenced, and if there are rework the respective code to use names instead. For instance, this may be observed for Cloud Assembly extensibility subscriptions criteria.
- Generate the content in another, test instance that is different than the one you exported the content from.