Deprecations
Engine changes with time as new features are introduced and other features get improved or even removed. Since removing features can break existing processes, it doesn't happen overnight.
When a feature is set for removal, first a deprecation note is added that signals the feature will be removed in a future release. Additionally, the workspace adds a deprecation badge to resources containing deprecated features.
Finding Deprecation Notes in Logs
Let's say there is a flow API method that will be removed in the future, hence a deprecation note is added. Every time this method is called by an execution, the execution will log that this feature is deprecated. A simple way to look for deprecation notes within your whole workspace, is to head over to the workspace logs and search for 'deprecat' in the subject field.
Here's how you can get an overview of deprecation notes in the workspace logs
Deprecation notes are only created if a deprecated flow API method is called. If parts of your scripts contain deprecated features but those parts are not usually executed (for example they cover edge cases that only happen infrequently, or are scheduled only yearly) they might not create deprecation notes.
Similarly, if you delete logs for security reasons, you won't find deprecation notes in the logs.
In these cases you can only find deprecated features by analyzing your scripts e.g. by exporting them and using the search function on an IDE to look for deprecated methods.
Automatic Migration for Schemas
Cloudomation Engine automatically adds a deprecation badge and the button "Migrate deprecations" to resources containing deprecated schemas.
This feature currently only recognizes deprecations in schemas (e.g. connector or wrapper inputs). You can find deprecated flow_api
methods, as described in the logs section.
The badge and the button
Clicking on the "Migrate deprecations" button attempts to automatically migrate the deprecated schema
Migrating a schema in a connector resource.
Before:
# configuration for a REST connector containing the deprecated parameter `url`
url: https://httpbin.org/get
After clicking the "Migrate deprecations" button:
# automatically migrated configuration for the connector
host: httpbin.org
path: get
scheme: https
schema_version: '10.0'
Migrating a schema in a flow resource.
A user creates a flow with the following script:
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='REST',
url='https://httpbin.org/get'
)
return this.success('all done')
Upon saving the script get automatically modified to use the correct schema:
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='REST',
schema_version='10.0',
scheme='https',
host='httpbin.org',
path='get',
)
return this.success('all done')
Limitations
Some schemas that are evaluated at runtime can not be automatically migrated.
E.g. the url
parameter in a REST connector is deprecated and need to be split into host
, path
and scheme
. If
the value of url
is dynamic it can not be determined what the values for the new parameters should be.
A schema within a flow script where the schema is evaluated at runtime:
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
my_url = inputs['url'] # e.g. my_url='https://httpbin.org/get'
this.connect(
connector_type='REST',
url=my_url # the URL is evaluated at runtime
)
return this.success('all done')
If a user clicks on the button "Migrate deprecations" in a resource that contains schemas that cannot be automatically migrated, a warning is shown:
The warning when a schema cannot be automatically migrated
To circumvent this limitation you can manually edit the schema by splitting the url
parameter into host
, path
and scheme
and
specifying the schema version.
Manual migration of a schema within a flow script where the schema is evaluated at runtime:
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
my_url = inputs['url'] # e.g. my_url='https://httpbin.org/get'
scheme=my_url.split('://')[0]
host=my_url.split('://')[1].split('/')[0]
path=my_url.split('://')[1].split('/')[1]
this.connect(
connector_type='REST',
schema_version='10.0',
scheme=scheme,
host=host,
path=path,
)
return this.success('all done')