You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a merge export plugin CLI command, the script generated should not have any const values more than once, especially naming them the same thing as doing so would be a basic violation of the JS runtime.
Actual Behavior
When running the CLI with the merge plugin, as below
yarn dlx contentful space migration --space-id [redacted] --environment-id master stage-master.cjs
The generated migration script contains multiple variables that are named the same thing and immediately fail in a scripted deployment, as they are a syntax error.
Possible Solution
Before writing the file to disk, check all const variables for uniqueness across the script.
Steps to Reproduce
Generate a simple content model that contains a model with a name like toolLanguage
Generate another simple model that's named language for instance
Generate a third simple model that's named tool and make a reference relationship between tool and language called toolLanguage
Generate a migration script from that environment into a new environment
See constant variable name clashing
Context
We attempted to generate a migration script that had closely related naming values and the generated script had multiple conflicting constant names. As this could be running in a headless environment, this should be strictly guarded against. This occurred, in our case, inside a Github action run.
Environment
Node v20
Yarn v4.1.1
Ubuntu-22.04
Github Action worker v2.316.1
The text was updated successfully, but these errors were encountered:
qbunt
changed the title
Merge plugin generates const values more than once
Merge plugin generates identical const values more than once
May 15, 2024
qbunt
changed the title
Merge plugin generates identical const values more than once
Merge plugin generates identical const variables more than once
May 15, 2024
Anyone care to take a look at this? This issue borked a production build, thought that maybe generating syntactically invalid JS would be a bigger deal 🤷
Expected Behavior
merge export
plugin CLI command, the script generated should not have anyconst
values more than once, especially naming them the same thing as doing so would be a basic violation of the JS runtime.Actual Behavior
When running the CLI with the merge plugin, as below
The generated migration script contains multiple variables that are named the same thing and immediately fail in a scripted deployment, as they are a syntax error.
Possible Solution
Before writing the file to disk, check all
const
variables for uniqueness across the script.Steps to Reproduce
toolLanguage
language
for instancetool
and make a reference relationship betweentool
andlanguage
calledtoolLanguage
Context
We attempted to generate a migration script that had closely related naming values and the generated script had multiple conflicting constant names. As this could be running in a headless environment, this should be strictly guarded against. This occurred, in our case, inside a Github action run.
Environment
The text was updated successfully, but these errors were encountered: