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

#173: use force update mode for ide-urls #155

Merged
merged 57 commits into from
Feb 27, 2024

Conversation

jan-vcapgemini
Copy link
Contributor

@jan-vcapgemini jan-vcapgemini commented Dec 12, 2023

Implements: #173

  • add force parameter to gitPullOrClone
  • if force is true and online do git pull followed with get reset and git cleanup
  • minor cleanups
  • added extra checks for changed and untracked files
  • introduced new GitUtils class (handles git commands and error messages)
  • added capture and warnings to all git commands
  • added tests and mocks for all git commands

Does not implement:

replaced git pull with hard reset and cleanup
added force param to gitPullOrClone
@jan-vcapgemini jan-vcapgemini self-assigned this Dec 12, 2023
@jan-vcapgemini jan-vcapgemini added urls ide-urls repo and related processes and features CLI IDEasy command-line-interface (parsing args, etc.) bugfix labels Dec 12, 2023
@jan-vcapgemini jan-vcapgemini added this to the release:2024.01.001 milestone Dec 12, 2023
Copy link
Contributor

@salimbouch salimbouch left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

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.

@jan-vcapgemini thanks for your PR with analysis and fix. 👍
Great that you also addressed some code-cleanups.
I like your solution and also I think it is a very good idea that you added an explicit force flag instead of (mis)using our --force mode for this as this more depends on the Git use-case and for ide-urls this is exactly desired while for ide-settings this could end in a disaster as end-users may loose lots of valuable configuration work.

So in general I am happy with your PR and would like to merge it.
However, since you stumbled over some odd stuff in our code-base and started improving, I would love to take the opportunity to really fix that even though not related to the actual story.

@hohwille hohwille assigned jan-vcapgemini and unassigned hohwille Jan 4, 2024
jan-vcapgemini and others added 2 commits January 8, 2024 11:40
…text.java

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>
…text.java

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>
@coveralls
Copy link
Collaborator

coveralls commented Jan 8, 2024

Pull Request Test Coverage Report for Build 8002948607

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 99 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.9%) to 57.192%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/context/AbstractIdeContext.java 47 65.48%
com/devonfw/tools/ide/process/ProcessContextImpl.java 52 0.0%
Totals Coverage Status
Change from base Build 7974016838: 0.9%
Covered Lines: 3851
Relevant Lines: 6475

💛 - Coveralls

added target to warning messages
added a new warning if git failed to clean the local repository
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.

@jan-vcapgemini thanks for your rework. Now all looks good. 👍
I will however have to test this manually before I will merge.

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java
removed gitPullOrClone from IdeContext interface
moved gitPullOrCloneIfNeeded to GitUtils
added and implemented new GitContext interface
added getGitContext to IdeContext
removed GitUtilsProcessResultMock
renamed GitUtils to GitContext
# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java
removed remoteName and branchName
added remote and branch name retrieval
added retrieveRemoteAndBranchName method to GitContextImpl
removed behind message from branch
added new GitUrl record
added new pullOrFetchAndResetIfNeeded (for ide-urls only)
adjusted tests (added HEAD file)
passed GitUrl to clone method
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.

@jan-vcapgemini Thanks for completing this complex PR. Great job - you have reached a great state & result 👍
Ready for merge.

@hohwille hohwille linked an issue Feb 27, 2024 that may be closed by this pull request
@hohwille hohwille merged commit 137d923 into devonfw:main Feb 27, 2024
4 checks passed
@hohwille hohwille added the story-review marks PRs that will be presented in the sprint-review label May 3, 2024
@jan-vcapgemini jan-vcapgemini deleted the fix/6-git-pull-hangs branch May 7, 2024 08:05
@tobka777 tobka777 added reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented. and removed story-review marks PRs that will be presented in the sprint-review labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix CLI IDEasy command-line-interface (parsing args, etc.) reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented. urls ide-urls repo and related processes and features
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Force git update of ide-urls git pull hangs
5 participants