Skip to content

#1955: fix ide update#1969

Merged
hohwille merged 6 commits into
devonfw:mainfrom
hohwille:feature/1955-fix-ide-update
May 26, 2026
Merged

#1955: fix ide update#1969
hohwille merged 6 commits into
devonfw:mainfrom
hohwille:feature/1955-fix-ide-update

Conversation

@hohwille
Copy link
Copy Markdown
Member

@hohwille hohwille commented May 22, 2026

This PR fixes #1955

Implemented changes:

  • Avoid duplicate checks by passing codeRepository flag to updateSettingsInStep
  • Refactor isSettingsRepositorySymlinkOrJunction() to isSettingsCodeRepository in IdeContext*
  • Fix actual bug that only for code repo the update is skipped if not forced

Testing instructions

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

  1. create a regular project and ensure you have updates (e.g. cd settings && git reset head~1)
  2. call ide status
  3. call ide update
  4. call ide status - now the updates should be applied and via commit id it was detected that no more updates are available.

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"

@hohwille hohwille added this to the release:2026.05.001 milestone May 22, 2026
@hohwille hohwille self-assigned this May 22, 2026
@hohwille hohwille added update related to updating software or the entire ide settings ide-settings repo and replated processes and features labels May 22, 2026
@hohwille hohwille added the bugfix PR that fixes a bug issue label May 22, 2026
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board May 22, 2026
@Caylipp Caylipp moved this from 🆕 New to Team Review in IDEasy board May 26, 2026
Comment thread cli/src/main/java/com/devonfw/tools/ide/commandlet/AbstractUpdateCommandlet.java Outdated
@Caylipp
Copy link
Copy Markdown
Contributor

Caylipp commented May 26, 2026

I tested this locally on Windows using the review branch.

Test steps:

  • Reset the settings repository with git reset --hard HEAD~1
  • Verified via git status that the settings repository was behind origin/main
    -image
  • Ran ide update
  • Verified via git status that the settings repository was fast-forwarded and is now up to date with origin/main
    -image

The update behavior works as expected for me.

One note: In my local setup, ide status still reported "Your settings are up-to-date" even before running ide update, although git status showed that the settings repository was behind. Therefore I verified the actual fix via git status before and after `ide update

I also checked the code changes briefly and they look reasonable to me.

Looks good from my side.

@hohwille
Copy link
Copy Markdown
Member Author

One note: In my local setup, ide status still reported "Your settings are up-to-date" even before running ide update, although git status showed that the settings repository was behind. Therefore I verified the actual fix via git status before and after `ide update

Great finding. I assume that you have found an unrelated issue:
Via git reset you somehow tweaked the git repo to have some change but the missing commit hash might still present in git.
In IDEasy we do these things:

  • We determine the current commit hash from git
  • After every ide update (and ide create) we save that has to a file called .commit.id.
  • In order to figure out if ide update is required or not, we compare the latest commit hash. In order to know it, we more or less do a git pull and then ask git for the latest commit hash for that branch. Then we compare it to the .commit.id. If they are equal, we are already up-to-date otherwise we display the message that an update is required.

You already had the latest .commit.id synced by ide update and via git reset you "faked" the state.
So for a 100% valid test, you would also had to tweak your .commit.id file.
I would conclude that your test was successful and the feature is working.

@Caylipp
Copy link
Copy Markdown
Contributor

Caylipp commented May 26, 2026

One note: In my local setup, ide status still reported "Your settings are up-to-date" even before running ide update, although git status showed that the settings repository was behind. Therefore I verified the actual fix via git status before and after `ide update

Great finding. I assume that you have found an unrelated issue: Via git reset you somehow tweaked the git repo to have some change but the missing commit hash might still present in git. In IDEasy we do these things:

  • We determine the current commit hash from git
  • After every ide update (and ide create) we save that has to a file called .commit.id.
  • In order to figure out if ide update is required or not, we compare the latest commit hash. In order to know it, we more or less do a git pull and then ask git for the latest commit hash for that branch. Then we compare it to the .commit.id. If they are equal, we are already up-to-date otherwise we display the message that an update is required.

You already had the latest .commit.id synced by ide update and via git reset you "faked" the state. So for a 100% valid test, you would also had to tweak your .commit.id file. I would conclude that your test was successful and the feature is working.

Thanks for the explanation, that explains why ide status still reported the settings as up-to-date in my local setup.

@hohwille hohwille merged commit d0a33aa into devonfw:main May 26, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Team Review to ✅ Done in IDEasy board May 26, 2026
laert-ll pushed a commit to laert-ll/IDEasy that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR that fixes a bug issue settings ide-settings repo and replated processes and features update related to updating software or the entire ide

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

ide update broken

2 participants