From fac1dd7b903a804ce89db74450fcaed2d4184143 Mon Sep 17 00:00:00 2001 From: Stephane Geneix Date: Tue, 19 Dec 2023 10:09:20 -0800 Subject: [PATCH] move mssql to latest CDK, remove LEGACY state. --- airbyte-integrations/connectors/source-mssql/build.gradle | 5 +++-- .../io/airbyte/integrations/source/mssql/MssqlSource.java | 4 ---- .../mssql/AbstractSshMssqlSourceAcceptanceTest.java | 7 ------- .../source/mssql/CdcMssqlSourceAcceptanceTest.java | 7 ------- .../source/mssql/CdcMssqlSourceDatatypeTest.java | 7 ------- .../source/mssql/MssqlSourceAcceptanceTest.java | 7 ------- .../source/mssql/MssqlSourceDatatypeTest.java | 7 ------- .../source/mssql/SslEnabledMssqlSourceAcceptanceTest.java | 7 ------- .../integrations/source/mssql/CdcMssqlSourceTest.java | 3 --- .../source/mssql/CdcStateCompressionTest.java | 3 --- .../source/mssql/MssqlJdbcSourceAcceptanceTest.java | 8 -------- .../integrations/source/mssql/MssqlSourceTest.java | 3 --- .../integrations/source/mssql/MssqlStressTest.java | 3 --- 13 files changed, 3 insertions(+), 68 deletions(-) diff --git a/airbyte-integrations/connectors/source-mssql/build.gradle b/airbyte-integrations/connectors/source-mssql/build.gradle index fed3f6ebe664..dde9b39307f6 100644 --- a/airbyte-integrations/connectors/source-mssql/build.gradle +++ b/airbyte-integrations/connectors/source-mssql/build.gradle @@ -4,8 +4,8 @@ plugins { } airbyteJavaConnector { - cdkVersionRequired = '0.7.5' - features = ['db-sources'] + cdkVersionRequired = '0.8.0' + features = ['core', 'db-sources'] useLocalCdk = false } @@ -35,5 +35,6 @@ dependencies { testImplementation 'org.awaitility:awaitility:4.2.0' testImplementation libs.testcontainers.mssqlserver + testImplementation project(path: ':airbyte-cdk:java:airbyte-cdk:core') testFixturesImplementation libs.testcontainers.mssqlserver } diff --git a/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlSource.java b/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlSource.java index 00163f6b7ecd..4726338daaed 100644 --- a/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlSource.java +++ b/airbyte-integrations/connectors/source-mssql/src/main/java/io/airbyte/integrations/source/mssql/MssqlSource.java @@ -106,10 +106,6 @@ public MssqlSource() { @Override protected AirbyteStateType getSupportedStateType(final JsonNode config) { - if (!featureFlags.useStreamCapableState()) { - return AirbyteStateType.LEGACY; - } - return MssqlCdcHelper.isCdc(config) ? AirbyteStateType.GLOBAL : AirbyteStateType.STREAM; } diff --git a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/AbstractSshMssqlSourceAcceptanceTest.java b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/AbstractSshMssqlSourceAcceptanceTest.java index 8f612d0327bb..ee301aacd964 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/AbstractSshMssqlSourceAcceptanceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/AbstractSshMssqlSourceAcceptanceTest.java @@ -11,8 +11,6 @@ import io.airbyte.cdk.integrations.base.ssh.SshTunnel; import io.airbyte.cdk.integrations.standardtest.source.SourceAcceptanceTest; import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv; -import io.airbyte.commons.features.FeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.json.Jsons; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.ContainerModifier; @@ -33,11 +31,6 @@ public abstract class AbstractSshMssqlSourceAcceptanceTest extends SourceAccepta private static final String STREAM_NAME = "dbo.id_and_name"; private static final String STREAM_NAME2 = "dbo.starships"; - @Override - protected FeatureFlags featureFlags() { - return FeatureFlagsWrapper.overridingUseStreamCapableState(super.featureFlags(), true); - } - public abstract SshTunnel.TunnelMethod getTunnelMethod(); protected MsSQLTestDatabase testdb; diff --git a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceAcceptanceTest.java b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceAcceptanceTest.java index cd5f995b9461..acaf4597a77b 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceAcceptanceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceAcceptanceTest.java @@ -12,8 +12,6 @@ import io.airbyte.cdk.integrations.base.ssh.SshHelpers; import io.airbyte.cdk.integrations.standardtest.source.SourceAcceptanceTest; import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv; -import io.airbyte.commons.features.FeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.json.Jsons; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.ContainerModifier; @@ -47,11 +45,6 @@ protected String getImageName() { return "airbyte/source-mssql:dev"; } - @Override - protected FeatureFlags featureFlags() { - return FeatureFlagsWrapper.overridingUseStreamCapableState(super.featureFlags(), true); - } - @Override protected ConnectorSpecification getSpec() throws Exception { return SshHelpers.getSpecAndInjectSsh(); diff --git a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceDatatypeTest.java b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceDatatypeTest.java index 14ed5321a0c4..44057dc38d08 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceDatatypeTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceDatatypeTest.java @@ -7,8 +7,6 @@ import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.cdk.db.Database; import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv; -import io.airbyte.commons.features.FeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.ContainerModifier; @@ -22,11 +20,6 @@ protected JsonNode getConfig() { .build(); } - @Override - protected FeatureFlags featureFlags() { - return FeatureFlagsWrapper.overridingUseStreamCapableState(super.featureFlags(), true); - } - @Override protected Database setupDatabase() { testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022, ContainerModifier.AGENT) diff --git a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceAcceptanceTest.java b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceAcceptanceTest.java index bcb433852253..4bdc5cecf61a 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceAcceptanceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceAcceptanceTest.java @@ -12,8 +12,6 @@ import io.airbyte.cdk.integrations.base.ssh.SshHelpers; import io.airbyte.cdk.integrations.standardtest.source.SourceAcceptanceTest; import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv; -import io.airbyte.commons.features.FeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.json.Jsons; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; import io.airbyte.protocol.models.Field; @@ -42,11 +40,6 @@ public class MssqlSourceAcceptanceTest extends SourceAcceptanceTest { protected MsSQLTestDatabase testdb; - @Override - protected FeatureFlags featureFlags() { - return FeatureFlagsWrapper.overridingUseStreamCapableState(super.featureFlags(), true); - } - @Override protected void setupEnvironment(final TestDestinationEnv environment) throws SQLException { testdb = MsSQLTestDatabase.in(BaseImage.MSSQL_2022) diff --git a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceDatatypeTest.java b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceDatatypeTest.java index 58fb23ab3023..8b11db5c3e77 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceDatatypeTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/MssqlSourceDatatypeTest.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.cdk.db.Database; -import io.airbyte.commons.features.FeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; public class MssqlSourceDatatypeTest extends AbstractMssqlSourceDatatypeTest { @@ -18,11 +16,6 @@ protected Database setupDatabase() { return testdb.getDatabase(); } - @Override - protected FeatureFlags featureFlags() { - return FeatureFlagsWrapper.overridingUseStreamCapableState(super.featureFlags(), true); - } - @Override protected JsonNode getConfig() { return testdb.integrationTestConfigBuilder() diff --git a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/SslEnabledMssqlSourceAcceptanceTest.java b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/SslEnabledMssqlSourceAcceptanceTest.java index 92b0858bf1ac..cd6a6e209146 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/SslEnabledMssqlSourceAcceptanceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test-integration/java/io/airbyte/integrations/source/mssql/SslEnabledMssqlSourceAcceptanceTest.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv; -import io.airbyte.commons.features.FeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import java.util.Map; public class SslEnabledMssqlSourceAcceptanceTest extends MssqlSourceAcceptanceTest { @@ -19,11 +17,6 @@ protected JsonNode getConfig() { .build(); } - @Override - protected FeatureFlags featureFlags() { - return FeatureFlagsWrapper.overridingUseStreamCapableState(super.featureFlags(), true); - } - @Override protected void setupEnvironment(final TestDestinationEnv environment) { final var container = new MsSQLContainerFactory().shared("mcr.microsoft.com/mssql/server:2022-latest"); diff --git a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceTest.java b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceTest.java index 815e0c88de38..53d69c8a8e65 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcMssqlSourceTest.java @@ -31,8 +31,6 @@ import io.airbyte.cdk.db.jdbc.StreamingJdbcDatabase; import io.airbyte.cdk.db.jdbc.streaming.AdaptiveStreamingQueryConfig; import io.airbyte.cdk.integrations.debezium.CdcSourceTest; -import io.airbyte.commons.features.EnvVariableFeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.json.Jsons; import io.airbyte.protocol.models.v0.AirbyteConnectionStatus; import io.airbyte.protocol.models.v0.AirbyteStateMessage; @@ -95,7 +93,6 @@ protected MsSQLTestDatabase createTestDatabase() { @Override protected MssqlSource source() { final var source = new MssqlSource(); - source.setFeatureFlags(FeatureFlagsWrapper.overridingUseStreamCapableState(new EnvVariableFeatureFlags(), true)); return source; } diff --git a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcStateCompressionTest.java b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcStateCompressionTest.java index 99bf15c74f92..900d634a48f1 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcStateCompressionTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/CdcStateCompressionTest.java @@ -16,8 +16,6 @@ import com.google.common.collect.Lists; import io.airbyte.cdk.db.jdbc.JdbcUtils; import io.airbyte.cdk.integrations.source.relationaldb.state.StateGeneratorUtils; -import io.airbyte.commons.features.EnvVariableFeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.util.AutoCloseableIterators; import io.airbyte.protocol.models.Field; @@ -149,7 +147,6 @@ private ConfiguredAirbyteCatalog getConfiguredCatalog() { private MssqlSource source() { final var source = new MssqlSource(); - source.setFeatureFlags(FeatureFlagsWrapper.overridingUseStreamCapableState(new EnvVariableFeatureFlags(), true)); return source; } diff --git a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlJdbcSourceAcceptanceTest.java b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlJdbcSourceAcceptanceTest.java index 167843841fef..865145382fc9 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlJdbcSourceAcceptanceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlJdbcSourceAcceptanceTest.java @@ -11,8 +11,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import io.airbyte.cdk.db.jdbc.JdbcUtils; import io.airbyte.cdk.integrations.source.jdbc.test.JdbcSourceAcceptanceTest; -import io.airbyte.commons.features.EnvVariableFeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; @@ -46,7 +44,6 @@ protected JsonNode config() { @Override protected MssqlSource source() { final MssqlSource source = new MssqlSource(); - source.setFeatureFlags(FeatureFlagsWrapper.overridingUseStreamCapableState(new EnvVariableFeatureFlags(), true)); return source; } @@ -157,9 +154,4 @@ protected AirbyteCatalog getCatalog(final String defaultNamespace) { List.of(List.of(COL_FIRST_NAME), List.of(COL_LAST_NAME))))); } - @Override - protected boolean supportsPerStream() { - return true; - } - } diff --git a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlSourceTest.java b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlSourceTest.java index 1819109ee2a4..8113fb08e0a8 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlSourceTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlSourceTest.java @@ -11,8 +11,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.Lists; import io.airbyte.commons.exceptions.ConfigErrorException; -import io.airbyte.commons.features.EnvVariableFeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.util.MoreIterators; import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage; import io.airbyte.protocol.models.Field; @@ -43,7 +41,6 @@ class MssqlSourceTest { private MssqlSource source() { final MssqlSource source = new MssqlSource(); - source.setFeatureFlags(FeatureFlagsWrapper.overridingUseStreamCapableState(new EnvVariableFeatureFlags(), true)); return source; } diff --git a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlStressTest.java b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlStressTest.java index 83e6662bcf92..12a589d5da53 100644 --- a/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlStressTest.java +++ b/airbyte-integrations/connectors/source-mssql/src/test/java/io/airbyte/integrations/source/mssql/MssqlStressTest.java @@ -14,8 +14,6 @@ import io.airbyte.cdk.db.jdbc.JdbcUtils; import io.airbyte.cdk.integrations.source.jdbc.AbstractJdbcSource; import io.airbyte.cdk.integrations.source.jdbc.test.JdbcStressTest; -import io.airbyte.commons.features.EnvVariableFeatureFlags; -import io.airbyte.commons.features.FeatureFlagsWrapper; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.string.Strings; import java.sql.JDBCType; @@ -93,7 +91,6 @@ public JsonNode getConfig() { @Override public AbstractJdbcSource getSource() { final MssqlSource source = new MssqlSource(); - source.setFeatureFlags(FeatureFlagsWrapper.overridingUseStreamCapableState(new EnvVariableFeatureFlags(), true)); return source; }