Skip to content
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

Create UpgradeSettingsCommandlet #759

Open
12 tasks
hohwille opened this issue Nov 13, 2024 · 1 comment · May be fixed by #820
Open
12 tasks

Create UpgradeSettingsCommandlet #759

hohwille opened this issue Nov 13, 2024 · 1 comment · May be fixed by #820
Assignees
Labels
configuration should be configurable or configuration change enhancement New feature or request settings ide-settings repo and replated processes and features

Comments

@hohwille
Copy link
Member

hohwille commented Nov 13, 2024

As a IDEasy user comming from a devonfw-ide project, I want to have a command to upgrade my settings from devonfw-ide to IDEasy so that I can get rid of all legacy after all my team members have already switched to IDEasy.

An UpgradeSettingsCommandlet shall be added so I can run ide upgrade-settings to upgrade my settings:

  • all devon.properties are renamed to ide.properties. In case a corresponding ide.properties already exists, the config from the devon.properties is merged into the existing ide.properties where ide.properties is the new one and therefore has priority if different values for the same property are defined in both files, the one from devon.properties is ignored/lost. This not only applies to settings but also to conf and all workspaces.
  • We ensure all legacy variables in ide.properties are replaced with their new name (if both legacy and new variable name is defined, the legacy one is removed).
  • Duplicated variables in the same ide.properties are removed (only the last occurrence is kept).
  • If variable DEVON_IDE_CUSTOM_TOOLS exists, it is converted into a custom-tools.json file in settings and the variable is removed (see here and legacy).
  • if settings/devon folder exists, it is renamed to settings/templates
  • UpgradeSettingsCommandlet: settings/templates/conf/.m2 #807
  • if settings/projects folder exists, it is renamed to settings/repositories
  • we recursively traverse all files in settings/workspace and settings/*/workspace and replace all known IdeVariables from CURLY into ANGLED syntax and legacy variable names are replaced with their new names. So e.g. ${DEVON_IDE_HOME} is replaced with $[IDE_HOME] or ${MAVEN_VERSION} is replaced with $[MVN_VERSION]. We also need to replace ${SETTINGS_PATH} with $[IDE_HOME]/settings.
  • if we hit an xml file that is not containing the XML namespace of our merger, we print a warning with the filepath saying that this file is most-likely outdated and print a link to a documentation page about this settings migration feature and linking to our XML merger docs in configurator and telling the project to sync their workspace config manually with the official ide-settings git repo on github provided by us as template for the settings.
  • that documentation page needs to exist and open when I click the link from that warning and explain the migration from devonfw-ide to IDEasy.
  • if a replacement-patterns.properties is found in a workspace folder a warning will be logged if the file is not empty and the file will be deleted.
  • if settings/ide.properties does not contain IDE_VARIABLE_SYNTAX_LEGACY_SUPPORT_ENABLED=false it will be added.

General note:

  • Whenever it says a folder shall be renamed, it must be ensured that the new name does not already exist. Otherwise the rename should not take place and a warning must be logged.
@hohwille hohwille added the enhancement New feature or request label Nov 13, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Nov 13, 2024
@hohwille hohwille added settings ide-settings repo and replated processes and features configuration should be configurable or configuration change labels Nov 13, 2024
@KianRolf KianRolf self-assigned this Nov 19, 2024
@KianRolf KianRolf moved this from 🆕 New to 🏗 In progress in IDEasy board Nov 19, 2024
@leonrohne27 leonrohne27 self-assigned this Nov 19, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 19, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 20, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 20, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 20, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 20, 2024
delete devon.properties if ide.properties already exists in same directory
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 21, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 21, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 22, 2024
Removed testThatHomeIsRequired in EnvironmentCommanletTest
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
Added a method that checks if legacy folder exists and renames them
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
Added 2 methods that replace all legacy IdeVariables with updated ones, e.g ${DEVON_IDE_HOME} to $[IDE_HOME]
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
Added A method that deletes a 'replacement-patterns.properties' -file, if it exists
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 25, 2024
@hohwille
Copy link
Member Author

For the record: ide upgrade-settings is a planned feature to move a devonfw-ide project to IDEasy.
In this context also bugs like #808 are relevant to be aware of...

leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 26, 2024
added a method that reads out and checks all .xml files in settings/*/workspaces for the namespace. If not found, a warning is printed.
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 26, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 27, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 28, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 28, 2024
@leonrohne27 leonrohne27 linked a pull request Nov 28, 2024 that will close this issue
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
Changed variable name from file_path to filePath
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
Changed checkForXMLNameSpace() to checkForXmlNamespace()
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
Added BufferedReader which now only reads out the first 3 lines of all .xml files. Also, the BufferedReader now searches for a  more consistent String
@hohwille hohwille added this to the release:2024.12.001 milestone Nov 29, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
KianRolf added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
leonrohne27 added a commit to leonrohne27/IDEasy that referenced this issue Nov 29, 2024
jan-vcapgemini added a commit to leonrohne27/IDEasy that referenced this issue Dec 18, 2024
added more tests
added new CustomToolsJson class
moved constants to IdeContext
jan-vcapgemini added a commit to leonrohne27/IDEasy that referenced this issue Dec 18, 2024
changed return type of readCustomToolsFromJson to CustomToolsJson
jan-vcapgemini added a commit to leonrohne27/IDEasy that referenced this issue Dec 18, 2024
hohwille added a commit to leonrohne27/IDEasy that referenced this issue Dec 19, 2024
jan-vcapgemini added a commit to leonrohne27/IDEasy that referenced this issue Dec 20, 2024
replaced regex parsing with indexOf
added JsonIgnores and JsonProperties to CustomTool
converted version from versionIdentifier to String
added Tool record to CustomToolsJson
hohwille added a commit to leonrohne27/IDEasy that referenced this issue Dec 20, 2024
jan-vcapgemini added a commit to leonrohne27/IDEasy that referenced this issue Dec 20, 2024
moved fromString into VariableLine
replaced parenthesis parsing with VariableLine.fromString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration should be configurable or configuration change enhancement New feature or request settings ide-settings repo and replated processes and features
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

4 participants