From 5ed0d82061e04ad7a966879fcbd038c5f6c0521e Mon Sep 17 00:00:00 2001 From: Ben Evans Date: Thu, 9 Nov 2023 16:45:26 +0100 Subject: [PATCH 1/2] refactor!: move classpath Jar reports into API module Signed-off-by: Julien Ponge --- STYLE.md | 20 +++++++++++++++---- .../insights/InsightsReportController.java | 2 ++ .../http/InsightsFileWritingClient.java | 2 +- .../insights/http/InsightsHttpClient.java | 2 +- .../insights/http/InsightsMultiClient.java | 2 +- .../jars/ClasspathJarInfoSubreport.java | 16 ++++++++++++--- .../insights/jars/JarInfoSubreport.java | 2 +- .../jars/JarInfoSubreportSerializer.java | 2 +- .../AbstractTopLevelReportBase.java | 3 ++- .../reports}/AppInsightsReportSerializer.java | 3 +-- .../reports}/AppInsightsSubreport.java | 3 +-- .../{ => reports}/InsightsReport.java | 4 +++- .../InsightsReportSerializer.java | 2 +- .../{ => reports}/InsightsSubreport.java | 2 +- .../insights/{ => reports}/ObjectMappers.java | 2 +- .../{ => reports}/UpdateReportImpl.java | 3 ++- .../redhat/insights/AbstractReportTest.java | 2 ++ .../InsightsReportControllerTest.java | 1 + .../redhat/insights/TestTopLevelReport.java | 2 ++ .../com/redhat/insights/TestUpdateReport.java | 1 + .../doubles/DummyInsightsSubreport.java | 2 +- .../insights/doubles/DummyTopLevelReport.java | 4 ++-- .../doubles/NoopInsightsHttpClient.java | 2 +- .../doubles/StoringInsightsHttpClient.java | 2 +- .../http/InsightsFileWritingClientTest.java | 2 +- .../http/InsightsMultiClientTest.java | 2 +- .../it/InsightsReportControllerTest.java | 4 ++-- .../httpclient/InsightsJdkHttpClient.java | 2 +- .../{app => reports}/AppTopLevelReport.java | 6 +++--- .../{ => reports}/TopLevelReportBaseImpl.java | 6 +++--- ...InsightsReportControllerThreadingTest.java | 2 +- .../insights/TopLevelReportBaseImplTest.java | 4 ++-- .../httpclient/InsightsJdkHttpClientTest.java | 4 ++-- .../insights/it/EphemeralEnvironmentTest.java | 4 ++-- 34 files changed, 77 insertions(+), 45 deletions(-) rename api/src/main/java/com/redhat/insights/{ => reports}/AbstractTopLevelReportBase.java (99%) rename {runtime/src/main/java/com/redhat/insights/core/app => api/src/main/java/com/redhat/insights/reports}/AppInsightsReportSerializer.java (90%) rename {runtime/src/main/java/com/redhat/insights/core/app => api/src/main/java/com/redhat/insights/reports}/AppInsightsSubreport.java (85%) rename api/src/main/java/com/redhat/insights/{ => reports}/InsightsReport.java (96%) rename api/src/main/java/com/redhat/insights/{ => reports}/InsightsReportSerializer.java (96%) rename api/src/main/java/com/redhat/insights/{ => reports}/InsightsSubreport.java (90%) rename api/src/main/java/com/redhat/insights/{ => reports}/ObjectMappers.java (96%) rename api/src/main/java/com/redhat/insights/{ => reports}/UpdateReportImpl.java (96%) rename runtime/src/main/java/com/redhat/insights/core/{app => reports}/AppTopLevelReport.java (86%) rename runtime/src/main/java/com/redhat/insights/core/{ => reports}/TopLevelReportBaseImpl.java (85%) diff --git a/STYLE.md b/STYLE.md index 0dde915e..58c2caed 100644 --- a/STYLE.md +++ b/STYLE.md @@ -1,19 +1,31 @@ # Code style guide -Note: this is a set of recommendations, not requirements. +NOTE: The commit messages and need to run the formatter are requirements, whereas the code style points are a set of recommendations. ## Formatting Before you commit, make sure to run the Spotless formatter: - $ mvn spotless:apply + $ mvn spotless:apply + +We adhere to [Semantic Verisoning](https://semver.org/) and reinforce this practice with [Conventional Commits](https://www.conventionalcommits.org/) + +In its simplest form, a commit message should be structured as follows: + +``` +[optional scope]: +``` + +with the type being one of a number of types: `build`, `ci`, `chore`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`. + +If the change introduces a breaking change (which will necessitate a major version bump), then the commit message should be suffixed with `!`. ## Java constructors vs factory methods - Prefer plain constructors to _factory_ static methods (e.g., `new ABC()` over `ABC.create()` / `ABC.of()`). - Do use factory methods when: - - some initialization logic cannot be expressed from a constructor, or it becomes inelegant, - - hiding a concrete implementation behind an interface (e.g., `val vertx = Vertx.vertx();`). +- some initialization logic cannot be expressed from a constructor, or it becomes inelegant, +- hiding a concrete implementation behind an interface (e.g., `val vertx = Vertx.vertx();`). ## Getters and setters diff --git a/api/src/main/java/com/redhat/insights/InsightsReportController.java b/api/src/main/java/com/redhat/insights/InsightsReportController.java index 0a698daf..ba3a3865 100644 --- a/api/src/main/java/com/redhat/insights/InsightsReportController.java +++ b/api/src/main/java/com/redhat/insights/InsightsReportController.java @@ -10,6 +10,8 @@ import com.redhat.insights.http.InsightsHttpClient; import com.redhat.insights.jars.JarInfo; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; +import com.redhat.insights.reports.UpdateReportImpl; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.util.concurrent.*; diff --git a/api/src/main/java/com/redhat/insights/http/InsightsFileWritingClient.java b/api/src/main/java/com/redhat/insights/http/InsightsFileWritingClient.java index 7ea66583..df852f03 100644 --- a/api/src/main/java/com/redhat/insights/http/InsightsFileWritingClient.java +++ b/api/src/main/java/com/redhat/insights/http/InsightsFileWritingClient.java @@ -5,9 +5,9 @@ import static com.redhat.insights.InsightsErrorCode.ERROR_WRITING_FILE; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import java.io.File; import java.io.IOException; import java.nio.file.Files; diff --git a/api/src/main/java/com/redhat/insights/http/InsightsHttpClient.java b/api/src/main/java/com/redhat/insights/http/InsightsHttpClient.java index df696cdf..d42055c4 100644 --- a/api/src/main/java/com/redhat/insights/http/InsightsHttpClient.java +++ b/api/src/main/java/com/redhat/insights/http/InsightsHttpClient.java @@ -4,7 +4,7 @@ import static com.redhat.insights.InsightsErrorCode.ERROR_GZIP_FILE; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; +import com.redhat.insights.reports.InsightsReport; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/api/src/main/java/com/redhat/insights/http/InsightsMultiClient.java b/api/src/main/java/com/redhat/insights/http/InsightsMultiClient.java index 8e0b3411..aeff4522 100644 --- a/api/src/main/java/com/redhat/insights/http/InsightsMultiClient.java +++ b/api/src/main/java/com/redhat/insights/http/InsightsMultiClient.java @@ -4,8 +4,8 @@ import static com.redhat.insights.InsightsErrorCode.ERROR_CLIENT_FAILED; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import java.util.Arrays; import java.util.List; diff --git a/api/src/main/java/com/redhat/insights/jars/ClasspathJarInfoSubreport.java b/api/src/main/java/com/redhat/insights/jars/ClasspathJarInfoSubreport.java index b3676bee..ee1c9f83 100644 --- a/api/src/main/java/com/redhat/insights/jars/ClasspathJarInfoSubreport.java +++ b/api/src/main/java/com/redhat/insights/jars/ClasspathJarInfoSubreport.java @@ -23,12 +23,22 @@ public ClasspathJarInfoSubreport(InsightsLogger logger) { @Override public void generateReport() { - JarAnalyzer analyzer = new JarAnalyzer(logger, true); - String cwd = System.getProperty(USER_DIR); String cpRaw = System.getProperty(CLASSPATH_ENV); + String[] entries = splitClassPathElements(cpRaw, File.pathSeparator); jarInfos.clear(); - for (String entry : splitClassPathElements(cpRaw, File.pathSeparator)) { + if (entries.length == 0) { + logger.warning("No classpath entries found"); + } else { + addEntries(entries); + } + } + + private void addEntries(String[] entries) { + JarAnalyzer analyzer = new JarAnalyzer(logger, true); + String cwd = System.getProperty(USER_DIR); + + for (String entry : entries) { logger.debug(entry); try { if (!entry.startsWith(File.separator)) { diff --git a/api/src/main/java/com/redhat/insights/jars/JarInfoSubreport.java b/api/src/main/java/com/redhat/insights/jars/JarInfoSubreport.java index f5c0e5c2..2ad687ed 100644 --- a/api/src/main/java/com/redhat/insights/jars/JarInfoSubreport.java +++ b/api/src/main/java/com/redhat/insights/jars/JarInfoSubreport.java @@ -8,8 +8,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsSubreport; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsSubreport; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; diff --git a/api/src/main/java/com/redhat/insights/jars/JarInfoSubreportSerializer.java b/api/src/main/java/com/redhat/insights/jars/JarInfoSubreportSerializer.java index 9d7ca0f8..56baff19 100644 --- a/api/src/main/java/com/redhat/insights/jars/JarInfoSubreportSerializer.java +++ b/api/src/main/java/com/redhat/insights/jars/JarInfoSubreportSerializer.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; -import com.redhat.insights.InsightsSubreport; +import com.redhat.insights.reports.InsightsSubreport; import java.io.IOException; public class JarInfoSubreportSerializer extends JsonSerializer { diff --git a/api/src/main/java/com/redhat/insights/AbstractTopLevelReportBase.java b/api/src/main/java/com/redhat/insights/reports/AbstractTopLevelReportBase.java similarity index 99% rename from api/src/main/java/com/redhat/insights/AbstractTopLevelReportBase.java rename to api/src/main/java/com/redhat/insights/reports/AbstractTopLevelReportBase.java index de046c9e..b9b82554 100644 --- a/api/src/main/java/com/redhat/insights/AbstractTopLevelReportBase.java +++ b/api/src/main/java/com/redhat/insights/reports/AbstractTopLevelReportBase.java @@ -1,7 +1,8 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights; +package com.redhat.insights.reports; import com.fasterxml.jackson.databind.JsonSerializer; +import com.redhat.insights.Filtering; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.logging.InsightsLogger; import java.io.IOException; diff --git a/runtime/src/main/java/com/redhat/insights/core/app/AppInsightsReportSerializer.java b/api/src/main/java/com/redhat/insights/reports/AppInsightsReportSerializer.java similarity index 90% rename from runtime/src/main/java/com/redhat/insights/core/app/AppInsightsReportSerializer.java rename to api/src/main/java/com/redhat/insights/reports/AppInsightsReportSerializer.java index 3ad9d067..bb1c675c 100644 --- a/runtime/src/main/java/com/redhat/insights/core/app/AppInsightsReportSerializer.java +++ b/api/src/main/java/com/redhat/insights/reports/AppInsightsReportSerializer.java @@ -1,10 +1,9 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights.core.app; +package com.redhat.insights.reports; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; -import com.redhat.insights.InsightsSubreport; import java.io.IOException; /** A generic Java application {@link InsightsSubreport} JSON serializer implementation. */ diff --git a/runtime/src/main/java/com/redhat/insights/core/app/AppInsightsSubreport.java b/api/src/main/java/com/redhat/insights/reports/AppInsightsSubreport.java similarity index 85% rename from runtime/src/main/java/com/redhat/insights/core/app/AppInsightsSubreport.java rename to api/src/main/java/com/redhat/insights/reports/AppInsightsSubreport.java index b7f17c77..a7529f82 100644 --- a/runtime/src/main/java/com/redhat/insights/core/app/AppInsightsSubreport.java +++ b/api/src/main/java/com/redhat/insights/reports/AppInsightsSubreport.java @@ -1,8 +1,7 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights.core.app; +package com.redhat.insights.reports; import com.fasterxml.jackson.databind.JsonSerializer; -import com.redhat.insights.InsightsSubreport; /** A generic Java application {@link InsightsSubreport} implementation. */ public final class AppInsightsSubreport implements InsightsSubreport { diff --git a/api/src/main/java/com/redhat/insights/InsightsReport.java b/api/src/main/java/com/redhat/insights/reports/InsightsReport.java similarity index 96% rename from api/src/main/java/com/redhat/insights/InsightsReport.java rename to api/src/main/java/com/redhat/insights/reports/InsightsReport.java index 3124b47c..3bd8d91e 100644 --- a/api/src/main/java/com/redhat/insights/InsightsReport.java +++ b/api/src/main/java/com/redhat/insights/reports/InsightsReport.java @@ -1,11 +1,13 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights; +package com.redhat.insights.reports; import static com.redhat.insights.InsightsErrorCode.ERROR_SERIALIZING_TO_JSON; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.ObjectMapper; +import com.redhat.insights.Filtering; +import com.redhat.insights.InsightsException; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.IOException; diff --git a/api/src/main/java/com/redhat/insights/InsightsReportSerializer.java b/api/src/main/java/com/redhat/insights/reports/InsightsReportSerializer.java similarity index 96% rename from api/src/main/java/com/redhat/insights/InsightsReportSerializer.java rename to api/src/main/java/com/redhat/insights/reports/InsightsReportSerializer.java index b93049ab..a3ce7492 100644 --- a/api/src/main/java/com/redhat/insights/InsightsReportSerializer.java +++ b/api/src/main/java/com/redhat/insights/reports/InsightsReportSerializer.java @@ -1,5 +1,5 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights; +package com.redhat.insights.reports; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/api/src/main/java/com/redhat/insights/InsightsSubreport.java b/api/src/main/java/com/redhat/insights/reports/InsightsSubreport.java similarity index 90% rename from api/src/main/java/com/redhat/insights/InsightsSubreport.java rename to api/src/main/java/com/redhat/insights/reports/InsightsSubreport.java index 6f3dce22..2deadda0 100644 --- a/api/src/main/java/com/redhat/insights/InsightsSubreport.java +++ b/api/src/main/java/com/redhat/insights/reports/InsightsSubreport.java @@ -1,5 +1,5 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights; +package com.redhat.insights.reports; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/api/src/main/java/com/redhat/insights/ObjectMappers.java b/api/src/main/java/com/redhat/insights/reports/ObjectMappers.java similarity index 96% rename from api/src/main/java/com/redhat/insights/ObjectMappers.java rename to api/src/main/java/com/redhat/insights/reports/ObjectMappers.java index 0d2a8292..ca7c8f94 100644 --- a/api/src/main/java/com/redhat/insights/ObjectMappers.java +++ b/api/src/main/java/com/redhat/insights/reports/ObjectMappers.java @@ -1,5 +1,5 @@ /* Copyright (C) Red Hat 2023 */ -package com.redhat.insights; +package com.redhat.insights.reports; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/api/src/main/java/com/redhat/insights/UpdateReportImpl.java b/api/src/main/java/com/redhat/insights/reports/UpdateReportImpl.java similarity index 96% rename from api/src/main/java/com/redhat/insights/UpdateReportImpl.java rename to api/src/main/java/com/redhat/insights/reports/UpdateReportImpl.java index b542b7d0..370b1dda 100644 --- a/api/src/main/java/com/redhat/insights/UpdateReportImpl.java +++ b/api/src/main/java/com/redhat/insights/reports/UpdateReportImpl.java @@ -1,7 +1,8 @@ /* Copyright (C) Red Hat 2023 */ -package com.redhat.insights; +package com.redhat.insights.reports; import com.fasterxml.jackson.databind.JsonSerializer; +import com.redhat.insights.Filtering; import com.redhat.insights.jars.JarInfo; import com.redhat.insights.jars.JarInfoSubreport; import com.redhat.insights.logging.InsightsLogger; diff --git a/api/src/test/java/com/redhat/insights/AbstractReportTest.java b/api/src/test/java/com/redhat/insights/AbstractReportTest.java index be7e68c9..545d6701 100644 --- a/api/src/test/java/com/redhat/insights/AbstractReportTest.java +++ b/api/src/test/java/com/redhat/insights/AbstractReportTest.java @@ -11,6 +11,8 @@ import com.redhat.insights.jars.JarInfoSubreport; import com.redhat.insights.jars.JarInfoSubreportSerializer; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; +import com.redhat.insights.reports.InsightsReportSerializer; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; diff --git a/api/src/test/java/com/redhat/insights/InsightsReportControllerTest.java b/api/src/test/java/com/redhat/insights/InsightsReportControllerTest.java index 359dde4a..b2cde567 100644 --- a/api/src/test/java/com/redhat/insights/InsightsReportControllerTest.java +++ b/api/src/test/java/com/redhat/insights/InsightsReportControllerTest.java @@ -10,6 +10,7 @@ import com.redhat.insights.doubles.NoopInsightsLogger; import com.redhat.insights.http.InsightsHttpClient; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import java.util.Collections; import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/com/redhat/insights/TestTopLevelReport.java b/api/src/test/java/com/redhat/insights/TestTopLevelReport.java index 26d886c1..de5ec1d2 100644 --- a/api/src/test/java/com/redhat/insights/TestTopLevelReport.java +++ b/api/src/test/java/com/redhat/insights/TestTopLevelReport.java @@ -7,6 +7,8 @@ import com.redhat.insights.jars.ClasspathJarInfoSubreport; import com.redhat.insights.jars.JarInfo; import com.redhat.insights.jars.JarInfoSubreport; +import com.redhat.insights.reports.InsightsReport; +import com.redhat.insights.reports.InsightsSubreport; import java.io.IOException; import java.util.*; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/com/redhat/insights/TestUpdateReport.java b/api/src/test/java/com/redhat/insights/TestUpdateReport.java index 72a7c9fc..938ba756 100644 --- a/api/src/test/java/com/redhat/insights/TestUpdateReport.java +++ b/api/src/test/java/com/redhat/insights/TestUpdateReport.java @@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import com.redhat.insights.jars.JarInfo; +import com.redhat.insights.reports.UpdateReportImpl; import java.io.IOException; import java.util.*; import java.util.concurrent.ArrayBlockingQueue; diff --git a/api/src/test/java/com/redhat/insights/doubles/DummyInsightsSubreport.java b/api/src/test/java/com/redhat/insights/doubles/DummyInsightsSubreport.java index d1e56df5..05c42dee 100644 --- a/api/src/test/java/com/redhat/insights/doubles/DummyInsightsSubreport.java +++ b/api/src/test/java/com/redhat/insights/doubles/DummyInsightsSubreport.java @@ -2,7 +2,7 @@ package com.redhat.insights.doubles; import com.fasterxml.jackson.databind.JsonSerializer; -import com.redhat.insights.InsightsSubreport; +import com.redhat.insights.reports.InsightsSubreport; /** A generic Java application {@link InsightsSubreport} implementation. */ public final class DummyInsightsSubreport implements InsightsSubreport { diff --git a/api/src/test/java/com/redhat/insights/doubles/DummyTopLevelReport.java b/api/src/test/java/com/redhat/insights/doubles/DummyTopLevelReport.java index 090ce6ba..6445d1cd 100644 --- a/api/src/test/java/com/redhat/insights/doubles/DummyTopLevelReport.java +++ b/api/src/test/java/com/redhat/insights/doubles/DummyTopLevelReport.java @@ -1,9 +1,9 @@ /* Copyright (C) Red Hat 2022-2023 */ package com.redhat.insights.doubles; -import com.redhat.insights.AbstractTopLevelReportBase; -import com.redhat.insights.InsightsSubreport; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.AbstractTopLevelReportBase; +import com.redhat.insights.reports.InsightsSubreport; import java.util.Collections; import java.util.HashMap; import java.util.Map; diff --git a/api/src/test/java/com/redhat/insights/doubles/NoopInsightsHttpClient.java b/api/src/test/java/com/redhat/insights/doubles/NoopInsightsHttpClient.java index a56bd3b8..433e7cf0 100644 --- a/api/src/test/java/com/redhat/insights/doubles/NoopInsightsHttpClient.java +++ b/api/src/test/java/com/redhat/insights/doubles/NoopInsightsHttpClient.java @@ -1,8 +1,8 @@ /* Copyright (C) Red Hat 2023 */ package com.redhat.insights.doubles; -import com.redhat.insights.InsightsReport; import com.redhat.insights.http.InsightsHttpClient; +import com.redhat.insights.reports.InsightsReport; public final class NoopInsightsHttpClient implements InsightsHttpClient { diff --git a/api/src/test/java/com/redhat/insights/doubles/StoringInsightsHttpClient.java b/api/src/test/java/com/redhat/insights/doubles/StoringInsightsHttpClient.java index 13b7cd6b..3434ff92 100644 --- a/api/src/test/java/com/redhat/insights/doubles/StoringInsightsHttpClient.java +++ b/api/src/test/java/com/redhat/insights/doubles/StoringInsightsHttpClient.java @@ -1,8 +1,8 @@ /* Copyright (C) Red Hat 2023 */ package com.redhat.insights.doubles; -import com.redhat.insights.InsightsReport; import com.redhat.insights.http.InsightsHttpClient; +import com.redhat.insights.reports.InsightsReport; /** * Fake http client, which will store content of report sent. Designed to test @link diff --git a/api/src/test/java/com/redhat/insights/http/InsightsFileWritingClientTest.java b/api/src/test/java/com/redhat/insights/http/InsightsFileWritingClientTest.java index 92b34404..64a67b4b 100644 --- a/api/src/test/java/com/redhat/insights/http/InsightsFileWritingClientTest.java +++ b/api/src/test/java/com/redhat/insights/http/InsightsFileWritingClientTest.java @@ -6,10 +6,10 @@ import static org.mockito.Mockito.when; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.doubles.NoopInsightsLogger; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/api/src/test/java/com/redhat/insights/http/InsightsMultiClientTest.java b/api/src/test/java/com/redhat/insights/http/InsightsMultiClientTest.java index bacdd8e4..c629d598 100644 --- a/api/src/test/java/com/redhat/insights/http/InsightsMultiClientTest.java +++ b/api/src/test/java/com/redhat/insights/http/InsightsMultiClientTest.java @@ -5,12 +5,12 @@ import static org.mockito.Mockito.*; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.doubles.DummyTopLevelReport; import com.redhat.insights.doubles.NoopInsightsLogger; import com.redhat.insights.doubles.StoringInsightsHttpClient; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/api/src/test/java/com/redhat/insights/it/InsightsReportControllerTest.java b/api/src/test/java/com/redhat/insights/it/InsightsReportControllerTest.java index 9814302e..3a83fee6 100644 --- a/api/src/test/java/com/redhat/insights/it/InsightsReportControllerTest.java +++ b/api/src/test/java/com/redhat/insights/it/InsightsReportControllerTest.java @@ -9,15 +9,15 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.json.JsonMapper; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; import com.redhat.insights.InsightsReportController; -import com.redhat.insights.InsightsSubreport; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.doubles.*; import com.redhat.insights.jars.ClasspathJarInfoSubreport; import com.redhat.insights.jars.JarInfo; import com.redhat.insights.jars.JarInfoSubreport; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; +import com.redhat.insights.reports.InsightsSubreport; import java.io.IOException; import java.time.Duration; import java.util.*; diff --git a/runtime/src/main/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClient.java b/runtime/src/main/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClient.java index e7248204..e67bf463 100644 --- a/runtime/src/main/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClient.java +++ b/runtime/src/main/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClient.java @@ -4,10 +4,10 @@ import static com.redhat.insights.InsightsErrorCode.*; import com.redhat.insights.InsightsException; -import com.redhat.insights.InsightsReport; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.http.InsightsHttpClient; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import java.io.File; import java.net.InetSocketAddress; import java.net.ProxySelector; diff --git a/runtime/src/main/java/com/redhat/insights/core/app/AppTopLevelReport.java b/runtime/src/main/java/com/redhat/insights/core/reports/AppTopLevelReport.java similarity index 86% rename from runtime/src/main/java/com/redhat/insights/core/app/AppTopLevelReport.java rename to runtime/src/main/java/com/redhat/insights/core/reports/AppTopLevelReport.java index 571ae27f..9421a7fc 100644 --- a/runtime/src/main/java/com/redhat/insights/core/app/AppTopLevelReport.java +++ b/runtime/src/main/java/com/redhat/insights/core/reports/AppTopLevelReport.java @@ -1,11 +1,11 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights.core.app; +package com.redhat.insights.core.reports; -import com.redhat.insights.InsightsSubreport; import com.redhat.insights.config.InsightsConfiguration; -import com.redhat.insights.core.TopLevelReportBaseImpl; import com.redhat.insights.jars.ClasspathJarInfoSubreport; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.AppInsightsSubreport; +import com.redhat.insights.reports.InsightsSubreport; import java.util.Map; /** diff --git a/runtime/src/main/java/com/redhat/insights/core/TopLevelReportBaseImpl.java b/runtime/src/main/java/com/redhat/insights/core/reports/TopLevelReportBaseImpl.java similarity index 85% rename from runtime/src/main/java/com/redhat/insights/core/TopLevelReportBaseImpl.java rename to runtime/src/main/java/com/redhat/insights/core/reports/TopLevelReportBaseImpl.java index 9ef49f65..3b55d8e4 100644 --- a/runtime/src/main/java/com/redhat/insights/core/TopLevelReportBaseImpl.java +++ b/runtime/src/main/java/com/redhat/insights/core/reports/TopLevelReportBaseImpl.java @@ -1,10 +1,10 @@ /* Copyright (C) Red Hat 2022-2023 */ -package com.redhat.insights.core; +package com.redhat.insights.core.reports; -import com.redhat.insights.AbstractTopLevelReportBase; -import com.redhat.insights.InsightsSubreport; import com.redhat.insights.config.InsightsConfiguration; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.AbstractTopLevelReportBase; +import com.redhat.insights.reports.InsightsSubreport; import java.util.*; /** diff --git a/runtime/src/test/java/com/redhat/insights/InsightsReportControllerThreadingTest.java b/runtime/src/test/java/com/redhat/insights/InsightsReportControllerThreadingTest.java index 77399a85..3d324513 100644 --- a/runtime/src/test/java/com/redhat/insights/InsightsReportControllerThreadingTest.java +++ b/runtime/src/test/java/com/redhat/insights/InsightsReportControllerThreadingTest.java @@ -6,9 +6,9 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; -import com.redhat.insights.core.app.AppTopLevelReport; import com.redhat.insights.core.httpclient.HttpResponseBase; import com.redhat.insights.core.httpclient.MockInsightsJdkHttpClient; +import com.redhat.insights.core.reports.AppTopLevelReport; import com.redhat.insights.doubles.MockInsightsConfiguration; import com.redhat.insights.doubles.NoopInsightsLogger; import com.redhat.insights.tls.PEMSupport; diff --git a/runtime/src/test/java/com/redhat/insights/TopLevelReportBaseImplTest.java b/runtime/src/test/java/com/redhat/insights/TopLevelReportBaseImplTest.java index ec585345..d7ea296a 100644 --- a/runtime/src/test/java/com/redhat/insights/TopLevelReportBaseImplTest.java +++ b/runtime/src/test/java/com/redhat/insights/TopLevelReportBaseImplTest.java @@ -4,11 +4,11 @@ import static org.junit.jupiter.api.Assertions.*; import com.redhat.insights.config.EnvAndSysPropsInsightsConfiguration; -import com.redhat.insights.core.app.AppInsightsSubreport; -import com.redhat.insights.core.app.AppTopLevelReport; +import com.redhat.insights.core.reports.AppTopLevelReport; import com.redhat.insights.jars.ClasspathJarInfoSubreport; import com.redhat.insights.jars.JarInfo; import com.redhat.insights.logging.PrintLogger; +import com.redhat.insights.reports.AppInsightsSubreport; import java.util.Map; import org.junit.jupiter.api.Test; diff --git a/runtime/src/test/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClientTest.java b/runtime/src/test/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClientTest.java index 1b7d5136..ce618ff4 100644 --- a/runtime/src/test/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClientTest.java +++ b/runtime/src/test/java/com/redhat/insights/core/httpclient/InsightsJdkHttpClientTest.java @@ -4,13 +4,13 @@ import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; -import com.redhat.insights.InsightsReport; import com.redhat.insights.config.InsightsConfiguration; -import com.redhat.insights.core.app.AppTopLevelReport; +import com.redhat.insights.core.reports.AppTopLevelReport; import com.redhat.insights.doubles.DummyTopLevelReport; import com.redhat.insights.doubles.MockInsightsConfiguration; import com.redhat.insights.doubles.NoopInsightsLogger; import com.redhat.insights.logging.InsightsLogger; +import com.redhat.insights.reports.InsightsReport; import com.redhat.insights.tls.PEMSupport; import java.io.File; import java.io.IOException; diff --git a/runtime/src/test/java/com/redhat/insights/it/EphemeralEnvironmentTest.java b/runtime/src/test/java/com/redhat/insights/it/EphemeralEnvironmentTest.java index 9bddf5e3..71f2911e 100644 --- a/runtime/src/test/java/com/redhat/insights/it/EphemeralEnvironmentTest.java +++ b/runtime/src/test/java/com/redhat/insights/it/EphemeralEnvironmentTest.java @@ -7,12 +7,12 @@ import com.redhat.insights.InsightsReportController; import com.redhat.insights.config.EnvAndSysPropsInsightsConfiguration; -import com.redhat.insights.core.app.AppInsightsSubreport; -import com.redhat.insights.core.app.AppTopLevelReport; import com.redhat.insights.core.httpclient.InsightsJdkHttpClient; +import com.redhat.insights.core.reports.AppTopLevelReport; import com.redhat.insights.doubles.DefaultConfiguration; import com.redhat.insights.jars.ClasspathJarInfoSubreport; import com.redhat.insights.logging.TestLogger; +import com.redhat.insights.reports.AppInsightsSubreport; import com.redhat.insights.tls.PEMSupport; import java.nio.file.Path; import java.time.Duration; From f62808eb10fdbf33774ef1b8db887f4e7c38c609 Mon Sep 17 00:00:00 2001 From: Julien Ponge Date: Wed, 15 Nov 2023 13:52:34 +0100 Subject: [PATCH 2/2] docs: typo in STYLE.md --- STYLE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STYLE.md b/STYLE.md index 58c2caed..6f7fa507 100644 --- a/STYLE.md +++ b/STYLE.md @@ -8,7 +8,7 @@ Before you commit, make sure to run the Spotless formatter: $ mvn spotless:apply -We adhere to [Semantic Verisoning](https://semver.org/) and reinforce this practice with [Conventional Commits](https://www.conventionalcommits.org/) +We adhere to [Semantic Versioning](https://semver.org/) and reinforce this practice with [Conventional Commits](https://www.conventionalcommits.org/) In its simplest form, a commit message should be structured as follows: