Skip to content

#1255: Enhance snapshot version recognition in IDEasy#1962

Merged
hohwille merged 14 commits into
devonfw:mainfrom
AdemZarrouki:feature/1255-fix-snapshot-version-recognition
May 29, 2026
Merged

#1255: Enhance snapshot version recognition in IDEasy#1962
hohwille merged 14 commits into
devonfw:mainfrom
AdemZarrouki:feature/1255-fix-snapshot-version-recognition

Conversation

@AdemZarrouki
Copy link
Copy Markdown
Contributor

@AdemZarrouki AdemZarrouki commented May 21, 2026

This PR fixes #1255

Implemented changes:

  • Added isSameSnapshotVersion to compare 2 snapshot versions
  • Refactored checkIfUpdateIsAvailable with explicit snapshot vs stable version comparison logic

Testing instructions

  1. For the test i added some two unit tests testCheckIfUpdateIsAvailableWithSameSnapshotVersions and testCheckIfUpdateIsAvailableWithDifferentSnapshotVersions.
  2. It should be tested after the merge as with GraalVM, when running "C:\Users\projects\IDEasy\workspaces\main\IDEasy\cli\target\ideasy.exe" status you get only 2026.05.001-SNAPSHOT so we can't really compare it with the latest version (here 2026.05.001-20260520.032326-18)

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented May 21, 2026

Coverage Report for CI Build 26654875090

Coverage decreased (-0.01%) to 71.09%

Details

  • Coverage decreased (-0.01%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 69 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

69 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/IdeasyCommandlet.java 68 73.15%
com/devonfw/tools/ide/version/VersionSegment.java 1 89.24%

Coverage Stats

Coverage Status
Relevant Lines: 15752
Covered Lines: 11684
Line Coverage: 74.17%
Relevant Branches: 7022
Covered Branches: 4506
Branch Coverage: 64.17%
Branches in Coverage %: Yes
Coverage Strength: 3.14 hits per line

💛 - Coveralls

@AdemZarrouki AdemZarrouki marked this pull request as ready for review May 21, 2026 14:30
@AdemZarrouki AdemZarrouki self-assigned this May 21, 2026
@AdemZarrouki AdemZarrouki added the status StatusCommandlet (ide status) label May 21, 2026
@AdemZarrouki AdemZarrouki moved this from 🆕 New to Team Review in IDEasy board May 21, 2026
Copy link
Copy Markdown
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdemZarrouki thanks for your PR and sorry for stepping in early. I just found some time to have a look already and want to give fast feedback...
Your approach looks good and your test with overriding the methods in anonymous class is very elegant to properly test the logic. 👍
For the regex stuff I left some suggestion to improve.

Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java Outdated
Comment thread cli/src/test/java/com/devonfw/tools/ide/tool/IdeasyCommandletTest.java Outdated
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java Outdated
@AdemZarrouki
Copy link
Copy Markdown
Contributor Author

@hohwille thanks for the early review and the improvements you mentioned. I updated the PR with the requested changes and also i think that using two REGEX constants is easier to understand.

@laert-ll
Copy link
Copy Markdown
Contributor

Local build testing:

$ ide status

Your version of IDEasy is SNAPSHOT.
You are using a SNAPSHOT version of IDEasy. For stability consider switching to a stable release via 'ide upgrade --mode=stable'
Your version of IDEasy is SNAPSHOT but version SNAPSHOT is available. Please run the following command to upgrade to the latest version:
ide upgrade

$ ide upgrade
You are using IDEasy version SNAPSHOT which indicates local development - skipping upgrade.
Version SNAPSHOT of tool ideasy is already installed

$ ide update

$ ide status
Your version of IDEasy is SNAPSHOT.
You are using a SNAPSHOT version of IDEasy. For stability consider switching to a stable release via 'ide upgrade --mode=stable'
Your version of IDEasy is SNAPSHOT but version SNAPSHOT is available. Please run the following command to upgrade to the latest version:
ide upgrade

GraalVM testing:

$ ide status

Your version of IDEasy is 2026.05.001-SNAPSHOT.
You are using a SNAPSHOT version of IDEasy. For stability consider switching to a stable release via 'ide upgrade --mode=stable'
Your version of IDEasy is 2026.05.001-SNAPSHOT but version 2026.05.001-20260527.032443-21 is available. Please run the following command to upgrade to the latest version:
ide upgrade

$ ide upgrade

Successfully installed ideasy in version 2026.05.001-20260527.032443-21 replacing previous version 2026.05.001-SNAPSHOT of ideasy at C:\Users\lllavesh\projects\_ide\installation

$ ide update

$ ide status
Your version of IDEasy is 2026.05.001-05_27_03-SNAPSHOT.
You are using a SNAPSHOT version of IDEasy. For stability consider switching to a stable release via 'ide upgrade --mode=stable'
Your version of IDEasy is 2026.05.001-05_27_03-SNAPSHOT but version 2026.05.001-20260527.032443-21 is available. Please run the following command to upgrade to the latest version:
ide upgrade

After some discussion with @AdemZarrouki, it seems like there's some difficulty in testing the actual behavior of this fix, given that both local as well as the GraalVM build do not use the same naming format as in real life testing.

@AdemZarrouki
Copy link
Copy Markdown
Contributor Author

@laert-ll Thanks for the review and test.
I discussed this with @hohwille in our daily today and he suggested that we can change the version of ide in .mvn/maven.config and then we can test it locally before merging.

So the steps are:

  • go to .mvn/maven.config and you will see something like this -Drevision=2026.05.002-SNAPSHOT. You can change it to -Drevision=2026.05.001-05_27_03-SNAPSHOT for example.
  • Then you can do the Local build or GraalVM testing.

@hohwille hohwille added this to the release:2026.06.001 milestone May 29, 2026
Copy link
Copy Markdown
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdemZarrouki thanks for the improvements. IMHO now better to read, understand, and maintain. I also like that you added the constants for the group numbers that improve readability while the group numbers are close to the REGEX declarations now and therefore also way easier to update in case the REGEX ever needs to be changed. Great job 👍
Ready for merge.

Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/IdeasyCommandlet.java
@github-project-automation github-project-automation Bot moved this from Team Review to 👀 In review in IDEasy board May 29, 2026
Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>
@hohwille hohwille merged commit 6324037 into devonfw:main May 29, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in IDEasy board May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status StatusCommandlet (ide status)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

ide status does not recognize snapshot version correctly

4 participants