Skip to content

#1695: Clone settings to temporary directory, analyse, and then move - #2335

Draft
laim2003 wants to merge 49 commits into
devonfw:mainfrom
laim2003:feature/#1695-settings-tempdir-verification
Draft

#1695: Clone settings to temporary directory, analyse, and then move#2335
laim2003 wants to merge 49 commits into
devonfw:mainfrom
laim2003:feature/#1695-settings-tempdir-verification

Conversation

@laim2003

@laim2003 laim2003 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #1695

Implemented changes:

  • When creating a new project (or updating a project with a broken settings directory), the settings or code-settings directory passed through ide create projectname <<git-url>> is pulled to a temporary directory. There, we check whether the repository is a valid settings or code-settings repository and if the check succeeds, we move it to the final location depending on the repo type (and symlink in case of a code-settings repo).
  • Removed the --code flag of ide create as we now automatically detect the type of the repository.

Testing instructions

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

  1. Checkout the state of this PR.

Create commandlet

  1. Run ide create using the configurable running executions in intellij, so you dont accidentally test the create commandlet from the latest release, but the state from this PR. For the parameters: Pick a random project name. For the git-url parameter see below:
  2. Try once using the default settings repo. In this case, check if a new project has been created, which has the settings repo contents correctly placed under IDE_HOME/settings. The creation should succeed!
  3. Try once using a code-settings-mixed repo. As a git url, you can use: https://github.com/laim2003/code-settings-repo. The creation should succeed. Important: in the IDE_HOME project folder, a symlink with the name "settings" should be created. It should correctly point to the folder: IDE_HOME/workspaces/main/[repository name, in our case "code-settings-repo"]/settings
  4. Try once using an invalid repository, for example, the default devonfw/IDEasy repository (this one is neither a settings or a code-settings repository). The project creation should now fail with an error message! Also, the creation process should not continue after the error!

Update commandlet

In order to test the update commandlet, you need to create your own settings repository.

  1. On GitHub, create a new repository and during the creation process, when GitHub prompts you (normally the first step), select the devonfw/ide-settings template.
  2. Run the ide create commandlet (again with the IntelliJ run configuration) and as the git-url use your newly created settings repo. It should succeed normally.
  3. After that succeeded, make an edit to the settings repo. You can do that directly on GitHub (do not make that edit in your settings repo locally, this is important to test the functionality!). For example, update the ide.properties and change the NODE_VERSION=v18* to v23*, and commit the changes.
  4. Now locally, in the newly created project, try running a commandlet, for example ide eclipse.
  5. It is important to now check that the console prints "Updates are available for the settings repo".
  6. Run ide update (again, using the run configuration in intellij), it should succeed.
  7. As a final test, now delete the contents of your settins folder in your newly created project.
  8. Now, run ide update again. It should detect the empty folder and prompt you to input a new Git Url. You can use the same URL you used before. This step should also succeed.

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 and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries 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 labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
…itory.

Signed-off-by: laim2003 <luk.faber@gmx.de>
…ir, verifies its health and then moves it to the IDE_HOME

Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 14, 2026
@laim2003 laim2003 self-assigned this Aug 14, 2026
@laim2003 laim2003 moved this from 🆕 New to 🏗 In progress in IDEasy board Aug 14, 2026
Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
Signed-off-by: laim2003 <luk.faber@gmx.de>
…mpdir-verification' into feature/devonfw#1695-settings-tempdir-verification
@laim2003 laim2003 added enhancement New feature or request update related to updating software or the entire ide settings ide-settings repo and replated processes and features git git version management tool integration create Create commandlet used to create new IDEasy projects with "ide create" labels Aug 17, 2026
@laim2003 laim2003 added this to the release:2026.08.002 milestone Aug 17, 2026
@coveralls

coveralls commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 32955274423

Coverage decreased (-0.08%) to 73.548%

Details

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

Uncovered Changes

No uncovered changes found.

Coverage Regressions

22 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/context/IdeContext.java 13 77.46%
com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java 7 92.06%
com/devonfw/tools/ide/commandlet/CreateCommandlet.java 1 92.31%
com/devonfw/tools/ide/version/VersionSegment.java 1 91.08%

Coverage Stats

Coverage Status
Relevant Lines: 18233
Covered Lines: 14023
Line Coverage: 76.91%
Relevant Branches: 8071
Covered Branches: 5323
Branch Coverage: 65.95%
Branches in Coverage %: Yes
Coverage Strength: 3.28 hits per line

💛 - Coveralls

@laim2003
laim2003 marked this pull request as ready for review August 17, 2026 13:15
…ss, added recursivity check to RepositoryUtil

Signed-off-by: laim2003 <luk.faber@gmx.de>
@laim2003
laim2003 marked this pull request as draft August 26, 2026 16:00
@laim2003

Copy link
Copy Markdown
Contributor Author

@hohwille there is still some cleanup necessary, i did a bit of refactoring...

@laim2003

laim2003 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Cases that have been explicitly tested:

  • Create with valid git url (code-settings)
  • Create with valid git url (settings repo)
  • Create with default url using "-" as a parameter
  • Create with invalid URL (yxz)
  • Create with non git url (www.google.com)

Update:

  • Update settings repo; was valid before, but new version is invalid (asks user, doenst automatically apply the newest settings)
  • Update settings repo; valid update
  • Update code-settings repo; was valid before, but new version is invalid (asks user, doenst automatically apply the newest settings)
  • Update code-settings repo; valid update

laim2003 and others added 9 commits August 28, 2026 13:34
… (--force-pull).

- SettingsUpdater now correctly saves the commit Id after cloning/pulling.
- Improved repositoryType with helper method
… for the case of `ide update`

- Changed error strategy in AbstractUpdateCommandlet to use CliException for non-fatal cases instead of step.error() with return
-
…mpdir-verification' into feature/devonfw#1695-settings-tempdir-verification
…Mode()

- Fixed "Update settings" step not failing if "Apply update" step fails
- RepositoryUtil now also checks for the presence of a .git folder
- Fixed some altered log messages in UpdateCommandletTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create Create commandlet used to create new IDEasy projects with "ide create" enhancement New feature or request git git version management tool integration settings ide-settings repo and replated processes and features update related to updating software or the entire ide

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Clone settings to temporary directory, analyse, and then move

3 participants