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

#1024: Move urls into url-updater module #1025

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

Conversation

jan-vcapgemini
Copy link
Contributor

@jan-vcapgemini jan-vcapgemini commented Feb 7, 2025

Fixes: #1024

Implements:

  • adjusted github action workflow
  • updated wiremock from com.github.tomakehurst 2.35.2 to org.wiremock 3.11.0
  • added jackson-core dependency to ide-cli
  • added url to url tool test classes package name
  • added some tests to please coveralls
  • introduced maven dependencyManagement
  • removed unnecessary properties from url-updater module
  • moved dependency version variables to root pom.xml
  • moved getBaseUrl method to GithubUrlUpdater
  • added Override to sub classes using getBaseUrl
  • used getBasedUrl in each GithubUrlUpdater to construct download urls
  • changed java version from 17 to 21
  • changed java version in github action workflows from 17 to 21

adjusted github action workflow
updated wiremock from com.github.tomakehurst 2.35.2 to org.wiremock 3.11.0
added jackson-core dependency to ide-cli
added url to url tool test classes package name
@jan-vcapgemini jan-vcapgemini self-assigned this Feb 7, 2025
@coveralls
Copy link
Collaborator

coveralls commented Feb 7, 2025

Pull Request Test Coverage Report for Build 13699101357

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 170 unchanged lines in 20 files lost coverage.
  • Overall coverage decreased (-1.2%) to 67.096%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/npm/NpmJsonDist.java 1 0.0%
com/devonfw/tools/ide/npm/NpmJsonObject.java 1 0.0%
com/devonfw/tools/ide/npm/NpmJsonVersion.java 1 0.0%
com/devonfw/tools/ide/os/SystemArchitecture.java 1 50.0%
com/devonfw/tools/ide/tool/androidstudio/AndroidJsonContent.java 1 0.0%
com/devonfw/tools/ide/tool/intellij/IntellijJsonDownloads.java 1 0.0%
com/devonfw/tools/ide/url/model/AbstractUrlArtifactWithParent.java 2 66.67%
com/devonfw/tools/ide/url/model/UrlArtifactWithParent.java 2 0.0%
com/devonfw/tools/ide/url/updater/GithubUrlUpdater.java 2 60.0%
com/devonfw/tools/ide/url/model/file/json/UrlStatus.java 4 50.0%
Totals Coverage Status
Change from base Build 13696612753: -1.2%
Covered Lines: 7732
Relevant Lines: 11101

💛 - Coveralls

@hohwille hohwille self-assigned this Feb 10, 2025
@hohwille hohwille added this to the release:2025.02.001 milestone Feb 10, 2025
@jan-vcapgemini jan-vcapgemini added the urls ide-urls repo and related processes and features label Feb 10, 2025
@jan-vcapgemini jan-vcapgemini marked this pull request as draft February 11, 2025 08:07
@jan-vcapgemini jan-vcapgemini marked this pull request as ready for review February 17, 2025 10:39
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. You not only did a refactoring, you also added a lot of new tests and coverage doing homework of other developers that forgot these tests. Really great job 👍
Sorry, but I left quite a lot of review comments for further improvements.
It would be awesome if you could have a look and improve. Thanks in advance!

Comment on lines 18 to 19
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
Copy link
Member

Choose a reason for hiding this comment

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

See

IDEasy/pom.xml

Line 22 in ddb6d00

<java.version>17</java.version>

It is fine to upgrade our project from java 17 to java 21 but if we want to do that, we should do that centrally and not have some modules compile for Java17 and others for Java21 what IMHO does not make sense here.

Suggested change
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>

Copy link
Contributor Author

@jan-vcapgemini jan-vcapgemini Mar 5, 2025

Choose a reason for hiding this comment

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

Moved to root pom.xml now and adjusted to 21.
Also changed the java version of github actions workflows to java 21.

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Copy link
Member

Choose a reason for hiding this comment

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

Already defined in our root parent POM:
https://github.com/devonfw/maven-parent/blob/9d31509d5f25c96fa1ec8b4f8cd2c341349b4df2/pom.xml#L17-L18

Suggested change
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed now.

cli/pom.xml Outdated
Comment on lines 101 to 103
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.11.0</version>
Copy link
Member

Choose a reason for hiding this comment

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

very nice that you update here.
With our new module it is more than time that we also go for maven dependencyMamangement.
Could you also do that in this PR so we do not introduce dependency versions redundantly in cli and url-updater?
Simply add a dependencyMamangement to our IDEasy parent POM and add all dependencies there with their versions. Then remove all these versions from other POMs. If we have multiple artifacts from the same groupId that share the same version, use a variable (like jackson.version) in our parent POM.

Suggested change
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.11.0</version>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added dependencyManagement to root pom.xml now.

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.16</version>
Copy link
Member

Choose a reason for hiding this comment

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

See above

Suggested change
<version>1.5.16</version>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to root pom.xml now.

<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.11.0</version>
Copy link
Member

Choose a reason for hiding this comment

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

See above

Suggested change
<version>3.11.0</version>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to root pom.xml now.

Comment on lines 8 to 10
import com.devonfw.tools.ide.tool.androidstudio.AndroidJsonDownload;
import com.devonfw.tools.ide.tool.androidstudio.AndroidJsonItem;
import com.devonfw.tools.ide.tool.androidstudio.AndroidJsonObject;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also move these files here?
They are IMHO only used by the url-updaters and not by IDEasy and URL-Metadata.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to url-updater.

cli/pom.xml Outdated
Comment on lines 43 to 47
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

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

why did you have to add this dependency additionally?
It is already a transitive dependency of all other jackson-* dependencies.

Suggested change
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>

Copy link
Contributor Author

@jan-vcapgemini jan-vcapgemini Mar 6, 2025

Choose a reason for hiding this comment

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

I've removed it now, did this also for the root pom.xml.

Comment on lines 28 to 29
cd url-updater
mvn -B -ntp -Dstyle.color=always install
Copy link
Member

Choose a reason for hiding this comment

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

this is not going to work since url-updater depends on cli so if you only build url-updater without building cli it will fail.
This currently does not fail because the artifacts will be downloaded by maven from nexus.
But when someone (our release process) sets a new version in the POM and then this action is going to be executed, it will fail because cli artifact is missing.

Suggested change
cd url-updater
mvn -B -ntp -Dstyle.color=always install
mvn -B -ntp -Dstyle.color=always -pl url-updater -am install

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adjusted.

Comment on lines 329 to 331
public void setUserEnvironmentVariable(String userEnvironmentVariable) {

}
Copy link
Member

Choose a reason for hiding this comment

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

This does not seem to make sense to me. IMHO this is not used anywhere...

Suggested change
public void setUserEnvironmentVariable(String userEnvironmentVariable) {
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed now.

@hohwille
Copy link
Member

hohwille commented Mar 4, 2025

I am slightly confused. This PR was green. After updating with main it now failed with coverage decreased again.
In general this coveralls is a great tool but here it really is a big pain. You have done a great job and besides the refactoring added a lot of new tests but still coveralls is complaining. IMHO coveralls is buggy in aggregating coverage over modules.

jan-vcapgemini and others added 19 commits March 5, 2025 12:05
introduced maven dependencyManagement
removed unnecessary properties from url-updater module
moved dependency version variables to root pom.xml
moved getBaseUrl method to GithubUrlUpdater
added Override to sub classes using getBaseUrl
used getBasedUrl in each GithubUrlUpdater to construct download urls
moved url specific classes from cli module to url-updater module
replaced import with fully qualified reference
moved url specific classes from cli module to url-updater module
replaced import with fully qualified reference
changed java version from 17 to 21
removed jackson-core dependency from cli
removed jackson-core dependency from root pom
@jan-vcapgemini jan-vcapgemini requested a review from hohwille March 6, 2025 10:20
jan-vcapgemini and others added 2 commits March 6, 2025 11:37
removed / from aws base url
replaced graalvm base url with GITHUB_BASE_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
urls ide-urls repo and related processes and features
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

Move url-updater into new module
3 participants