From b69e8ff719692ffcc436b1ceb84c9bf7b71467c0 Mon Sep 17 00:00:00 2001 From: Ivan Vakhrushev Date: Tue, 16 Aug 2022 11:47:17 +0300 Subject: [PATCH 1/3] Added columnsWithJsonTypeCheckOnHost bean --- build.gradle | 2 +- .../spring/DatabaseStructureHealthAutoConfiguration.java | 9 +++++++++ .../mfvanek/pg/spring/AutoConfigurationTestBase.java | 1 + ...aseStructureHealthAutoConfigurationFilteringTest.java | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ceba33b..226ae6c 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ def junitVersion = '5.9.0' def springVersion = '2.5.14' dependencies { implementation "org.springframework.boot:spring-boot-starter:$springVersion" - api 'io.github.mfvanek:pg-index-health:0.6.0' + api 'io.github.mfvanek:pg-index-health:0.6.1-SNAPSHOT' annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor:$springVersion" annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springVersion" diff --git a/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfiguration.java b/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfiguration.java index 929a330..1ccc10f 100644 --- a/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfiguration.java +++ b/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfiguration.java @@ -9,6 +9,7 @@ package io.github.mfvanek.pg.spring; +import io.github.mfvanek.pg.checks.host.ColumnsWithJsonTypeCheckOnHost; import io.github.mfvanek.pg.checks.host.ColumnsWithoutDescriptionCheckOnHost; import io.github.mfvanek.pg.checks.host.DuplicatedIndexesCheckOnHost; import io.github.mfvanek.pg.checks.host.ForeignKeysNotCoveredWithIndexCheckOnHost; @@ -158,6 +159,14 @@ public ColumnsWithoutDescriptionCheckOnHost columnsWithoutDescriptionCheckOnHost return new ColumnsWithoutDescriptionCheckOnHost(pgConnection); } + @Bean + @ConditionalOnClass(ColumnsWithJsonTypeCheckOnHost.class) + @ConditionalOnBean(PgConnection.class) + @ConditionalOnMissingBean + public ColumnsWithJsonTypeCheckOnHost columnsWithJsonTypeCheckOnHost(final PgConnection pgConnection) { + return new ColumnsWithJsonTypeCheckOnHost(pgConnection); + } + @Bean @ConditionalOnClass(StatisticsMaintenanceOnHost.class) @ConditionalOnBean(PgConnection.class) diff --git a/src/test/java/io/github/mfvanek/pg/spring/AutoConfigurationTestBase.java b/src/test/java/io/github/mfvanek/pg/spring/AutoConfigurationTestBase.java index 3adce87..e64c118 100644 --- a/src/test/java/io/github/mfvanek/pg/spring/AutoConfigurationTestBase.java +++ b/src/test/java/io/github/mfvanek/pg/spring/AutoConfigurationTestBase.java @@ -44,6 +44,7 @@ abstract class AutoConfigurationTestBase { "unusedIndexesCheckOnHost", "tablesWithoutDescriptionCheckOnHost", "columnsWithoutDescriptionCheckOnHost", + "columnsWithJsonTypeCheckOnHost", "statisticsMaintenanceOnHost", "configurationMaintenanceOnHost" )); diff --git a/src/test/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfigurationFilteringTest.java b/src/test/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfigurationFilteringTest.java index 253bf4a..b6c62a9 100644 --- a/src/test/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfigurationFilteringTest.java +++ b/src/test/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthAutoConfigurationFilteringTest.java @@ -9,6 +9,7 @@ package io.github.mfvanek.pg.spring; +import io.github.mfvanek.pg.checks.host.ColumnsWithJsonTypeCheckOnHost; import io.github.mfvanek.pg.checks.host.ColumnsWithoutDescriptionCheckOnHost; import io.github.mfvanek.pg.checks.host.DuplicatedIndexesCheckOnHost; import io.github.mfvanek.pg.checks.host.ForeignKeysNotCoveredWithIndexCheckOnHost; @@ -65,6 +66,7 @@ void withoutPgConnectionClass() { UnusedIndexesCheckOnHost.class, TablesWithoutDescriptionCheckOnHost.class, ColumnsWithoutDescriptionCheckOnHost.class, + ColumnsWithJsonTypeCheckOnHost.class, StatisticsMaintenanceOnHost.class, ConfigurationMaintenanceOnHost.class}) void withoutClass(final Class type) { From a88f5aeaac1a90661c8c821e9e7ced43ee2a435a Mon Sep 17 00:00:00 2001 From: Ivan Vakhrushev Date: Thu, 18 Aug 2022 21:39:46 +0300 Subject: [PATCH 2/3] Release 0.6.1 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 226ae6c..dda084a 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { } group 'io.github.mfvanek' -version '0.6.1-SNAPSHOT' +version '0.6.1' java { sourceCompatibility = JavaVersion.VERSION_1_8 @@ -29,7 +29,7 @@ def junitVersion = '5.9.0' def springVersion = '2.5.14' dependencies { implementation "org.springframework.boot:spring-boot-starter:$springVersion" - api 'io.github.mfvanek:pg-index-health:0.6.1-SNAPSHOT' + api 'io.github.mfvanek:pg-index-health:0.6.1' annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor:$springVersion" annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springVersion" From 626daab1b924dc6383a24676792b6e1b9f114f6f Mon Sep 17 00:00:00 2001 From: Ivan Vakhrushev Date: Thu, 18 Aug 2022 21:45:34 +0300 Subject: [PATCH 3/3] Disabled Sonar and Codecov for non Linux builds --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b1452dc..abdbba6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,11 +39,16 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Build with Gradle and analyze + if: matrix.os == 'ubuntu-latest' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: ./gradlew build sonarqube --info + - name: Build with Gradle + if: matrix.os != 'ubuntu-latest' + run: ./gradlew build - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v2 with: fail_ci_if_error: true