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

#757: Settings in code repository #850

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

salimbouch
Copy link
Contributor

@salimbouch salimbouch commented Dec 5, 2024

fixes #757
fixes #826

@salimbouch salimbouch self-assigned this Dec 5, 2024
@hohwille hohwille marked this pull request as draft December 6, 2024 09:37
@coveralls
Copy link
Collaborator

coveralls commented Dec 12, 2024

Pull Request Test Coverage Report for Build 12434409418

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 212 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.3%) to 67.219%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/commandlet/AbstractUpdateCommandlet.java 1 84.13%
com/devonfw/tools/ide/git/GitContext.java 4 0.0%
com/devonfw/tools/ide/git/GitUrl.java 6 75.0%
com/devonfw/tools/ide/context/IdeContext.java 16 59.74%
com/devonfw/tools/ide/commandlet/CreateCommandlet.java 17 55.93%
com/devonfw/tools/ide/git/GitContextImpl.java 52 55.87%
com/devonfw/tools/ide/context/AbstractIdeContext.java 116 63.17%
Totals Coverage Status
Change from base Build 12430022855: -0.3%
Covered Lines: 6671
Relevant Lines: 9577

💛 - Coveralls

@salimbouch salimbouch marked this pull request as ready for review December 12, 2024 00:47
Copy link
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.

@salimbouch thanks for all your reworks already. And nice that you also found the documentation in settings.adoc und updated it accordingly. 👍

@salimbouch salimbouch requested a review from hohwille December 17, 2024 14:09
@hohwille hohwille added this to the release:2025.01.001 milestone Dec 20, 2024
@hohwille
Copy link
Member

@salimbouch thanks for your improvements. PR looks great 👍
Please add the issues to our CHANGELOG

I tested your PR and it works good:

ide create code-demo --code https://github.com/hohwille/ide-settings.git#code-settings

The project was created successfully:

$ ide status
Missing .git folder in D:\projects\code-demo\settings.
Updates are available for the settings repository. If you want to pull the latest changes, call ide update.
IDE_ROOT is set to D:\projects
IDE_HOME is set to D:\projects\code-demo
You are online.
Your settings are not up-to-date, please run 'ide update'.
Your settings are on a custom branch: code-settings

The warning about the missing .git folder may be confusing but changes were detected and updates can be applied via symlink/junction.

I tested a simulated git conflict in the code project due to git pull:

$ ide update
Updates are available for the settings repository. If you want to pull the latest changes, call ide update.
Start: Pull settings repository
error: Your local changes to the following files would be overwritten by merge:
        pom.xml
Please commit your changes or stash them before you merge.
Aborting
Running command 'C:\Program Files\Git\cmd\git.exe' with arguments '--no-pager' 'pull' '--quiet'
failed with exit code 1!
Git pull on branch code-settings failed for repository D:\projects\code-demo\settings.
Failed to update git repository at D:\projects\code-demo\settings
See above error for details. If you have local changes, please stash or revert and retry.
Typically you should abort and fix the problem. Do you want to continue anyways?
Option 1: yes
Option 2: no
yes
Successfully updated settings repository.
Start: Copy configuration templates
Successfully ended step 'Copy configuration templates'.
Start: Install or update software
Start: Install mvn
Version 3.9.9 of tool mvn is already installed
Successfully ended step 'Install mvn'.
Start: Install node
Version v18.20.5 of tool node is already installed
Successfully ended step 'Install node'.
Start: Install npm
Version 11.0.0 of tool npm is already installed
Successfully ended step 'Install npm'.
Start: Install java
Version 21.0.5_11 of tool java is already installed
Successfully ended step 'Install java'.
Successfully ended step 'Install or update software'.
Successfully completed ide (update)

The updates were not pulled and therefore not applied.
This can be a little confusing.
I need to manually resolve the conflict in this situation.
IMHO we need either a feature like

ide update --skip-pull

or we should simply not pull if we have a code repo.
However, the feature is functionally complete and works as planned.
Great work 👍

Copy link
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.

👍

@hohwille hohwille added create Create commandlet used to create new IDEasy projects with "ide create" enhancement New feature or request settings ide-settings repo and replated processes and features repository Commandlet to clone, build or import git repositories labels Dec 20, 2024
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 repository Commandlet to clone, build or import git repositories settings ide-settings repo and replated processes and features
Projects
Status: Team Review
Development

Successfully merging this pull request may close these issues.

git settings check can break every commandlet Support to allow settings in code repository
3 participants