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

A list of non Red Hat version artifacts for redhat-version-rate option #341

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions domino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ Total number of dependencies: 1075
Red Hat version rate: 82.3%
```

A list of non Red Hat version artifacts is provided when `--log-not-matched` option is added to the command.

##### Red Hat build of Apache Camel for Quarkus productization rate

The following command will inspect dependencies of all the Camel Quarkus extensions that are managed by `quarkus-camel-bom` and calculate the rate of artifacts containing `redhat` version qualifier:
Expand Down
14 changes: 14 additions & 0 deletions domino/app/src/main/java/io/quarkus/domino/cli/Quarkus.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -104,6 +105,10 @@ public class Quarkus implements Callable<Integer> {
"--redhat-version-rate" }, description = "Calculate the rate of redhat versions among the inspected dependencies")
public boolean redhatVersionRate;

@CommandLine.Option(names = {
"--log-not-matched" }, description = "Provide more details in combination with other options", defaultValue = "false")
public boolean logNotMatched;

@CommandLine.Option(names = {
"--info" }, description = "Log basic Quarkus platform release information")
public boolean info;
Expand Down Expand Up @@ -254,6 +259,15 @@ public Integer call() throws Exception {
if (!allNodes.isEmpty()) {
log.info(String.format("%-32s: %s (%.1f%%)", "Artifacts with Red Hat versions",
redhatVersions, ((double) redhatVersions.get() * 100) / allNodes.size()));

if (logNotMatched) {
log.info("");
log.info("Non Red Hat version artifacts:");
allNodes.keySet()
.stream().sorted(Comparator.comparing(Object::toString))
.filter(coords -> !RhVersionPattern.isRhVersion(coords.getVersion()))
.forEach(coords -> log.info(String.format(" * %s", coords)));
}
}
log.info("");
}
Expand Down
Loading