- Deploy step should use
transformations-cli@main
instead ofjetfire-cli@v2
:
# GitHub Workflow
- name: Transformations Deploy step
uses: cognitedata/transformations-cli@main
project-name
input should be renamed ascdf-project-name
:
# GitHub Workflow
with:
path: <transformations_folder>
..
cdf-project-name: extractor-bluefield-testing
...
3- Make sure scopes
are space separated if you need multiple scopes:
# GitHub Workflow
with:
path: <transformations_folder>
...
scopes: scope1 scope2 scope3
...
4- You can reference values as environment values or actual values in manifests, make sure you provide env variables you need in your manifests.
# GitHub Workflow
env:
TOKEN_URL: https://login.microsoftonline.com/someaad/oauth2/v2.0/token
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
FIXED_TRANSFORMATION_NAME: example
# Transformation manifest file
name: ${FIXED_TRANSFORMATION_NAME} # read from environment variable
externalId: hello # value is used directly
authentication:
clientSecret: ${CLIENT_SECRET} # read from environment variable
clientId: randomclientid # value is used directly
tokenUrl: ${TOKEN_URL} # read from environment variable
There are two options to achieve this: Set legacy
flag on your existing manifest with no changes or start using the new format!
Add legacy: true
to your legacy transformation manifests.
# Legacy transformation manifest
legacy: true
name: hello
externalId: hello
...
Although we provide backward compatibility with the legacy
flag, we recommend using the new manifest format as:
- it has an improved structure
- new functionality will only be made available in the new format
- it enables the use of environment variables
You can find the full documentation of the transformation manifest here.
The following sections show the requirements for migrating the different fields of the manifest:
- No changes required.
- No changes required.
assets
,events
,timeseries
,datapoints
,sequences
,labels
,relationships
,files
,raw
are now case sensitive and should be lower case.- We now also support
data_sets
. - These resource types change formatting:
Legacy (Case insensitive) | New (Case sensitive with underscores) |
---|---|
|
|
|
|
- No changes required.
In the old version, the query
field expected the path to a SQL file. Now you can either provide a SQL file path or provide the query directly as a string.
Legacy | New |
---|---|
# Legacy transformation manifest
query: my_query.sql |
# Transformation manifest
query: "select 'asset1' as name" # Transformation manifest
query:
file:
my_query.sql |
- No changes required.
is_paused
option is supported in the new CLI. If you need to pause some schedules, you can use the following format:
# Transformation manifest
schedule:
interval: "* * * * *"
is_paused: true
- No changes required, default is changed to
true
.
- No changes required.
apiKey
values used to be treated as environment variables injetfire-cli
. Now you need to reference them as${API_KEY}
instead ofAPI_KEY
to treat them as environment variables.
Legacy | New |
---|---|
# Legacy transformation manifest
apiKey: API_KEY # as provided in deploy step |
# Transformation manifest
authentication:
apiKey: ${API_KEY} # as provided in deploy step |
clientId
andclientSecret
were assumed to be environment variables while others are used as actual values in the old CLI manifest.${MY_NAME}
will be treated as the value for the environment variable namedMY_NAME
whileMY_NAME
will be used as the value itself in the new manifest. This leaves where to use environment variables to the user so it is really flexible.- Also, we added support for
audience
parameter to retrieve the token.
Legacy | New |
---|---|
# Legacy transformation manifest
# The following two is given as the name of an environment variable
clientId: COGNITE_CLIENT_ID
clientSecret: COGNITE_CLIENT_SECRET
# The following are explicit values, not environment variables
tokenUrl: https://my-idp.com/oauth2/token
scopes:
- https://bluefield.cognitedata.com/.default
cdfProjectName: my-project |
# Transformation manifest
clientId: ${CLIENT_ID}
clientSecret: ${CLIENT_SECRET}
tokenUrl: https://my-idp.com/oauth2/token
scopes:
- https://bluefield.cognitedata.com/.default
cdfProjectName: my-project
# audience: "" |
apiKey
configuration is moved underauthentication
.
Legacy | New |
---|---|
# Legacy ransformation manifest
apiKey: API_KEY # as provided in deploy step # Legacy ransformation manifest
apiKey:
read: READ_API_KEY # as provided in deploy step
write: WRITE_API_KEY # as provided in deploy step |
# Transformation manifest
authentication:
apiKey: ${API_KEY} # as provided in deploy step # Transformation manifest
authentication:
apiKey:
read: ${READ_API_KEY} # as provided in deploy step
write: ${WRITE_API_KEY} # as provided in deploy step |
- No changes required for
jetfire-cli@v2
. - If you are migrating from
jetfire-cli@v1
, make sure that you reflect notifications in your manifests. Missing notifications on existing transformations get deleted.