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

483: support multiple editions in update #555

Merged

Conversation

slskiba
Copy link
Contributor

@slskiba slskiba commented Aug 23, 2024

Closes #483

  • UrlUpdater base classes now support multiple editions
  • The default implementation behaves as before: a single edition named after the tool
  • Intellij therefore can be refactored, not having to implement its own update method anymore

@slskiba slskiba self-assigned this Aug 23, 2024
…date

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/tool/python/PythonUrlUpdater.java
#	cli/src/main/java/com/devonfw/tools/ide/url/updater/JsonUrlUpdater.java
@slskiba slskiba marked this pull request as ready for review August 28, 2024 07:13
@coveralls
Copy link
Collaborator

coveralls commented Aug 28, 2024

Pull Request Test Coverage Report for Build 10628491050

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 41 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 64.838%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/url/updater/JsonUrlUpdater.java 5 81.48%
com/devonfw/tools/ide/tool/intellij/IntellijUrlUpdater.java 7 75.61%
com/devonfw/tools/ide/url/updater/AbstractUrlUpdater.java 29 82.96%
Totals Coverage Status
Change from base Build 10610910357: 0.03%
Covered Lines: 5730
Relevant Lines: 8528

💛 - Coveralls

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.

@slskiba thanks for your PR. You nicely added the ability to pass the edition as parameter instead of internally retrieving it from the getter. The way you add multiple editions as List without the need to refactor all other UrlUpdaters is smart and well designed. 👍

The only little room for improvement that I can notice is that you are parsing the response as JSON for IntelliJ and Python multiple times only to get one item out of the JSON array. You could theoretically leave the getJsonObjectFromResponse without the edition and create a new parent container object for that and containing the editions. Then you could add a protected method getJsonEdition(J rootObject, String edition) to JsonUrlUpdater that gets the root JSON object and returns the actual edition JSON object from it for a given edition parameter. The you however, need 3 generic types: J, JE, JVI where JE is the JSON edition object. Other JSON UrlUpdaters would then declare J = JE. To avoid changes in other URL Updaters, you could extract AbstractJsonUrlUpdater that has these 3 generics while JsonUrlUpdater extends it and implement getJsonEdition to just return rootObject.
However, I do not see a problem with the current approach and we can also merge as is...

@hohwille hohwille added this to the release:2024.09.001 milestone Aug 29, 2024
@hohwille hohwille merged commit 1e62bd2 into devonfw:main Aug 30, 2024
4 checks passed
@hohwille hohwille added the reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented.
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Refactor IntellijUrlUpdater to support multiple editions
3 participants