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

ide upgrade cannot find latest version at least for SNAPSHOTs #1159

Closed
hohwille opened this issue Mar 24, 2025 · 1 comment · Fixed by #1176
Closed

ide upgrade cannot find latest version at least for SNAPSHOTs #1159

hohwille opened this issue Mar 24, 2025 · 1 comment · Fixed by #1176
Assignees
Labels
bug Something isn't working upgrade

Comments

@hohwille
Copy link
Member

Expected behavior

As a IDEasy user, I want to use ide upgrade to get the latest release so that I can benefit from latest bugfixes and features.

Actual behavior

$ ide -fd upgrade --mode=snapshot
Running commandlet UpgradeCommandlet[upgrade]
Running command 'C:\Program Files\Git\cmd\git.exe' with arguments 'rev-parse' '@{u}' ...
Updates are available for the settings repository. If you want to apply the latest changes, call "ide update"
Start: Install ideasy
Resolved version pattern *-SNAPSHOT to version 2025.02.002-beta-SNAPSHOT
Tool ideasy has 0 other tool(s) as dependency
Version 2025.02.002-beta-20250227.023618-5 of tool ideasy is already installed at D:\projects\_ide\software\maven\ideasy\ideasy\2025.02.002-beta-20250227.023618-5
Deleting D:\projects\_ide\installation ...
Creating relative symbolic link D:\projects\_ide\installation pointing to software\maven\ideasy\ideasy\2025.02.002-beta-20250227.023618-5
Successfully installed ideasy in version 2025.02.002-beta-20250227.023618-5 replacing previous version 2025.02.002-beta-02_27_02-SNAPSHOT
Step 'Install ideasy' ended successfully.
It is recommended to run 'ide update' on your IDEasy projects now.
Step 'ide' ended successfully.
Successfully completed ide (upgrade,--mode=snapshot)

Whatever is going on here reveals that #786 is not properly implemented:

Resolved version pattern *-SNAPSHOT to version 2025.02.002-beta-SNAPSHOT

This is definetly incorrect since this is currently the latest version:
https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/2025.03.002-SNAPSHOT/

So it should print 2025.03.002-SNAPSHOT instead of 2025.02.002-beta-SNAPSHOT.
You can also verify that here:
https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
Check for <latest> element in the XML.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. ide -fd upgrade --mode=snapshot

Related/Dependent Issues

Comments/Hints:

if (file.getFileName().toString().equals(MvnArtifact.MAVEN_METADATA_XML)) {
Duration cacheDuration = METADATA_CACHE_DURATION_RELEASE;
if (file.getParent().getFileName().toString().endsWith("-SNAPSHOT")) {
cacheDuration = METADATA_CACHE_DURATION_SNAPSHOT;
}
return !this.context.getFileAccess().isFileAgeRecent(file, cacheDuration);
}

Force mode is not considered here what was actually discussed during implementation and review

Still after deleting the maven metadata from my local repo, the problem remains.

Further trace should start debugging here:

List<VersionIdentifier> versions = fetchVersions(artifact);

Affected version:

  • 2025.02.002-SNAPSHOT
@hohwille hohwille added the bug Something isn't working label Mar 24, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Mar 24, 2025
@julia-cap julia-cap self-assigned this Mar 24, 2025
@julia-cap
Copy link
Contributor

Steps taken so far:

  1. Installed latest Snapshot 2025.03.002 of IDEasy
  2. Pulled latest changes from upstream main
  3. Ran ide -v in IntelliJ
    Result: The IDEasy version is resolved to "SNAPSHOT". In IdeasyCommandlet::install a warning is emitted and the process ends because IdeVersion.isUndefined() = true.
    Question: What is VERSION_UNDEFINED used for at all or rather what is meant with "local development"?

I have overridden the IdeVersion during debugging to 2025.02.002-SNAPSHOT to proceed with the installation of the ideasy upgrade.

UpgradeMode.getVersion = "*-SNAPSHOT" because we're in Snapshot mode and no version was given.
MavenRepository.metadataUrl is correctly resolved.
MavenRepository.fetchVersions (line 218) retrieves all versions from metadata xml document and orders them correctly i.e. here latest was 2025.03.002-SNAPSHOT.

VersionIdentifier line 76: It compares the "*" (because we want to upgrade to latest Snapshot version) with latest Snapshot version e.g. "2025" from metadata and that resolves to false.

MavenRepository line 202 returns the 2025.02.002-beta-SNAPSHOT, but I could not yet figure out why.

@jan-vcapgemini jan-vcapgemini moved this from 🆕 New to 🏗 In progress in IDEasy board Mar 26, 2025
@jan-vcapgemini jan-vcapgemini self-assigned this Mar 26, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Mar 26, 2025
Fixes: devonfw#1159

**Implements**
* changed UpgradeMode SNAPSHOT to *!=SNAPSHOT
* added beta-snapshot to VersionPhase SNAPSHOT
* added tests for unstable version and snapshot detection
@hohwille hohwille added this to the release:2025.03.002 milestone Mar 26, 2025
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Mar 26, 2025
hohwille added a commit that referenced this issue Mar 26, 2025
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDEasy board Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upgrade
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants