-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: [cawemo-migration] Add script to migrate from Cawemo to Web Modeler #329
feature: [cawemo-migration] Add script to migrate from Cawemo to Web Modeler #329
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🚀 A few smaller things I've noticed though.
By the way, the migration does not seem to work yet for DMN diagrams (400 Bad Request
is returned from Web Modeler).
cawemo-to-web-modeler-migration/migrate-cawemo-to-web-modeler.sh
Outdated
Show resolved
Hide resolved
cawemo-to-web-modeler-migration/migrate-cawemo-to-web-modeler.sh
Outdated
Show resolved
Hide resolved
cawemo-to-web-modeler-migration/migrate-cawemo-to-web-modeler.sh
Outdated
Show resolved
Hide resolved
NEW_PROJECT_ID=$(jq -r .id <<< "$NEW_PROJECT") | ||
|
||
# maps folder IDs to original IDs to not create them twice + create file in right folder | ||
declare -A folderIds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not seem to work in Zsh on macOS:
./migrate-cawemo-to-web-modeler.sh: line 77: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only happens when I run the script directly with ./migrate-cawemo-to-web-modeler.sh
, not with zsh migrate-cawemo-to-web-modeler.sh
🤔.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess declare
does not exist in sh
the shell specified by the shebang at the top of the script.
To align behaviours the first line should be changed to #!/usr/bin/env zsh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now when using #!/bin/zsh
@jfriedenstab please verify
echo "⚠ POST https://modeler.cloud.camunda.io/api/beta/files failed with status code $HTTP_STATUS" | ||
echo "[$(date +%s)] ⚠ POST https://modeler.cloud.camunda.io/api/beta/files failed with status code $HTTP_STATUS" >> migration.log | ||
else | ||
echo "\e[1A\e[K$FILE_TREE_SPACES$TREE_SYMBOL ✔ Migrated file ${GREEN}$FILE_NAME${NC} (Type: $FILE_TYPE, ID: $OLD_FILE_ID)." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The character is not displayed correctly:
\e[1A\e[K├── ✔ Migrated file New BPMN Diagram (Type: BPMN, ID: 561e690c-4424-4b9e-a483-bdbec98e8176).
Probably related to this shellcheck warning (see above):
SC2028 (info): echo may not expand escape sequences. Use printf
Only happens when I run the script directly with ./migrate-cawemo-to-web-modeler.sh
, not with zsh migrate-cawemo-to-web-modeler.sh
🤔.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now when using #!/bin/zsh
@jfriedenstab please verify
OLD_FOLDER_ID=$(_folder_jq '.id') | ||
|
||
# skip this folder if already created | ||
if [ -z "${folderIds[$OLD_FOLDER_ID]}" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got an error in this line:
./migrate-cawemo-to-web-modeler.sh: line 118: fc98fdfb-0e75: value too great for base (error token is "0e75")
Only happens when I run the script directly with ./migrate-cawemo-to-web-modeler.sh
, not with zsh migrate-cawemo-to-web-modeler.sh
🤔.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now when using #!/bin/zsh
@jfriedenstab please verify
Co-authored-by: Jan Friedenstab <8794084+jfriedenstab@users.noreply.github.com>
Co-authored-by: Jan Friedenstab <8794084+jfriedenstab@users.noreply.github.com>
Co-authored-by: Jan Friedenstab <8794084+jfriedenstab@users.noreply.github.com>
I'm out :-( |
As the script requires at least bash 4 or zsh to run, should we maybe migrate it to |
node.js is just another system dependency. What about the system admins in the customer companies that are using Windows? Provide a PowerShell script? Why not deliver a Spring-Boot Java application? I haven't taken a look into this section, but what are the requirements to migrate from Cawemo to web modeler? |
Node.js would be a system-agnostic runtime (just like a jre) that is quite likely to be present on a developer machine. However, I also like the approach of a spring-boot applicationn (backend). In the end, the script goes through projects, folders and files in cawemo and recreates the structure including files in web-modeler We could merge this PR for now so that we have something in place and then go and see whether we migrate it to another platform (given the audience is quite small) |
Hi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script works with zsh, so all good
Thank you @jonathanlukas for taking care as I wasn't able to find the time |
Add script to migrate from Cawemo to Web Modeler
Description
Solves #328
Testing your changes
Types of changes
Checklist: