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

Add UpgradeCommandlet #786

Open
4 tasks
hohwille opened this issue Nov 21, 2024 · 0 comments
Open
4 tasks

Add UpgradeCommandlet #786

hohwille opened this issue Nov 21, 2024 · 0 comments
Labels
enhancement New feature or request upgrade

Comments

@hohwille
Copy link
Member

hohwille commented Nov 21, 2024

As a IDEasy user, I want to be able to upgrade to the latest version of IDEasy so that I do not have to check for new versions, manually download and re-install IDEasy.
This should happen via ide upgrade (what will install the latest IDEasy product version if not already installed - unlike ide update what will update my current project to the latest state).
Therefore an UpgradeCommandlet shall be implemented.

The old mechanism in devonfw-ide for this feature was devon ide update scripts and the code can be found here:
https://github.com/devonfw/ide/blob/9efaf926f1daa4e1e37a22fc89081255fbf55dab/scripts/src/main/resources/scripts/command/ide#L47-L66
The key to find the latest version is https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
and for SNAPSHOTs https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml

  • As a preparation a first PR could create a MavenRepository implementing ToolRepository with a mapping from tool and edition to groupId and artifactId (as a starting point this can be hardcoded). It should support parsing maven-metadata.xml to implement resolveVersion.
    The download method can be implemented straight forward reusing existing download functionality we already have implemented after mapping and building the download URL. Theoretically findDependencies could be implemented via pom but we do not want or need this yet and simply return an empty List here.
    Then we can make the MavenRepository accessible via IdeContext.
  • Once all this is done (in another PR after merging the first or in the same PR), the run method of UpgradeCommandlet can use the MavenRepository to resolve the latest version, compare it with the current version (IdeVersion.get() converted to VersionIdentifier). If a newer version is available, then download it. Finally extract the download to $IDE_ROOT/_ide overwriting all files. The latter part may be tricky on Windows due to file locks.
  • As an advanced feature if the current version of IDEasy is a SNAPSHOT, then the MavenRepository should be created with https://s01.oss.sonatype.org/content/repositories/snapshots as base URL instead of https://repo1.maven.org/maven2.
    Further, we currently cannot distinguish different SNAPSHOT versions.
    Therefore I propose a new sub-task story:
  • unique SNAPSHOT versions #791
@hohwille hohwille added the enhancement New feature or request label Nov 21, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upgrade
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant