-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Expected Behavior
- When running a
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
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 betweentool
andlanguage
calledtoolLanguage
- 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
Metadata
Metadata
Assignees
Labels
No labels