Skip to content

Commit

Permalink
A list of non Red Hat version artifacts for redhat-version-rate option
Browse files Browse the repository at this point in the history
  • Loading branch information
rsvoboda committed Jul 25, 2024
1 parent a7ca166 commit b9a6295
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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 `--verbose` 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 = {
"--verbose" }, description = "Provide more details in combination with other options", defaultValue = "false")
public boolean verbose;

@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 (verbose) {
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

0 comments on commit b9a6295

Please sign in to comment.