diff --git a/airbyte-commons-server/build.gradle b/airbyte-commons-server/build.gradle new file mode 100644 index 000000000000..f0ea82dcb4e5 --- /dev/null +++ b/airbyte-commons-server/build.gradle @@ -0,0 +1,69 @@ +plugins { + id "java-library" +} + +dependencies { + annotationProcessor platform(libs.micronaut.bom) + annotationProcessor libs.bundles.micronaut.annotation.processor + annotationProcessor libs.micronaut.jaxrs.processor + + implementation platform(libs.micronaut.bom) + implementation libs.bundles.micronaut + implementation libs.micronaut.jaxrs.server + + // Ensure that the versions defined in deps.toml are used + // instead of versions from transitive dependencies + implementation(libs.flyway.core) { + force = true + } + implementation(libs.s3) { + // Force to avoid updated version brought in transitively from Micronaut 3.8+ + // that is incompatible with our current Helm setup + force = true + } + implementation(libs.aws.java.sdk.s3) { + // Force to avoid updated version brought in transitively from Micronaut 3.8+ + // that is incompatible with our current Helm setup + force = true + } + + implementation project(':airbyte-analytics') + implementation project(':airbyte-api') + implementation project(':airbyte-commons-docker') + implementation project(':airbyte-commons-temporal') + implementation project(':airbyte-commons-worker') + implementation project(':airbyte-config:init') + implementation project(':airbyte-config:config-models') + implementation project(':airbyte-config:config-persistence') + implementation project(':airbyte-config:specs') + implementation project(':airbyte-metrics:metrics-lib') + implementation project(':airbyte-db:db-lib') + implementation project(":airbyte-json-validation") + implementation project(':airbyte-notification') + implementation project(':airbyte-oauth') + implementation project(':airbyte-protocol:protocol-models') + implementation project(':airbyte-persistence:job-persistence') + + implementation 'com.github.slugify:slugify:2.4' + implementation 'commons-cli:commons-cli:1.4' + implementation libs.temporal.sdk + implementation 'org.apache.cxf:cxf-core:3.4.2' + implementation 'org.eclipse.jetty:jetty-server:9.4.31.v20200723' + implementation 'org.eclipse.jetty:jetty-servlet:9.4.31.v20200723' + implementation 'org.glassfish.jaxb:jaxb-runtime:3.0.2' + implementation 'org.glassfish.jersey.containers:jersey-container-servlet' + implementation 'org.glassfish.jersey.inject:jersey-hk2' + implementation 'org.glassfish.jersey.media:jersey-media-json-jackson' + implementation 'org.glassfish.jersey.ext:jersey-bean-validation' + implementation 'org.quartz-scheduler:quartz:2.3.2' + implementation 'io.sentry:sentry:6.3.1' + implementation 'io.swagger:swagger-annotations:1.6.2' + + testImplementation project(':airbyte-test-utils') + testImplementation libs.postgresql + testImplementation libs.platform.testcontainers.postgresql + testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1' + testImplementation 'org.mockito:mockito-inline:4.7.0' +} + +Task publishArtifactsTask = getPublishArtifactsTask("$rootProject.ext.version", project) \ No newline at end of file diff --git a/airbyte-server/src/main/java/io/airbyte/server/RequestLogger.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/RequestLogger.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/RequestLogger.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/RequestLogger.java index 6406d6b86026..2d43ff574a2c 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/RequestLogger.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/RequestLogger.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server; +package io.airbyte.commons.server; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/airbyte-server/src/main/java/io/airbyte/server/ServerConstants.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/ServerConstants.java similarity index 81% rename from airbyte-server/src/main/java/io/airbyte/server/ServerConstants.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/ServerConstants.java index 6c40fc37ba91..6c8a3ececc29 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/ServerConstants.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/ServerConstants.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server; +package io.airbyte.commons.server; public class ServerConstants { diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/ApiPojoConverters.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/ApiPojoConverters.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/converters/ApiPojoConverters.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/ApiPojoConverters.java index 9b85de35c34b..ea6309030676 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/ApiPojoConverters.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/ApiPojoConverters.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import io.airbyte.api.model.generated.ActorDefinitionResourceRequirements; import io.airbyte.api.model.generated.ConnectionRead; @@ -18,10 +18,10 @@ import io.airbyte.api.model.generated.NormalizationDestinationDefinitionConfig; import io.airbyte.api.model.generated.ResourceRequirements; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; import io.airbyte.config.BasicSchedule; import io.airbyte.config.Schedule; import io.airbyte.config.StandardSync; -import io.airbyte.server.handlers.helpers.CatalogConverter; import java.util.stream.Collectors; public class ApiPojoConverters { diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/CatalogDiffConverters.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/CatalogDiffConverters.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/converters/CatalogDiffConverters.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/CatalogDiffConverters.java index 181be5454880..7b14abe1f2be 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/CatalogDiffConverters.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/CatalogDiffConverters.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import io.airbyte.api.model.generated.FieldAdd; import io.airbyte.api.model.generated.FieldRemove; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/ConfigurationUpdate.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/ConfigurationUpdate.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/converters/ConfigurationUpdate.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/ConfigurationUpdate.java index 8eaf31178ac7..0b0fc05be5b4 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/ConfigurationUpdate.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/ConfigurationUpdate.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.commons.json.Jsons; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/JobConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/JobConverter.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/converters/JobConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/JobConverter.java index 9a3d479749e0..ad138b919c3d 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/JobConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/JobConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import io.airbyte.api.model.generated.AttemptFailureOrigin; import io.airbyte.api.model.generated.AttemptFailureReason; @@ -28,6 +28,8 @@ import io.airbyte.api.model.generated.SourceDefinitionRead; import io.airbyte.api.model.generated.SynchronousJobRead; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.scheduler.SynchronousJobMetadata; +import io.airbyte.commons.server.scheduler.SynchronousResponse; import io.airbyte.commons.version.AirbyteVersion; import io.airbyte.config.Configs.WorkerEnvironment; import io.airbyte.config.JobConfig.ConfigType; @@ -42,8 +44,6 @@ import io.airbyte.persistence.job.models.Attempt; import io.airbyte.persistence.job.models.AttemptNormalizationStatus; import io.airbyte.persistence.job.models.Job; -import io.airbyte.server.scheduler.SynchronousJobMetadata; -import io.airbyte.server.scheduler.SynchronousResponse; import io.airbyte.workers.helper.ProtocolConverters; import jakarta.inject.Singleton; import java.io.IOException; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/NotificationConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/NotificationConverter.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/converters/NotificationConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/NotificationConverter.java index c24346a123f5..50fc1a1f3601 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/NotificationConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/NotificationConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import io.airbyte.commons.enums.Enums; import java.util.Collections; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/OauthModelConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/OauthModelConverter.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/converters/OauthModelConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/OauthModelConverter.java index 78c44bcda3d1..86220d17a7bf 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/OauthModelConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/OauthModelConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import io.airbyte.api.model.generated.AdvancedAuth; import io.airbyte.api.model.generated.AdvancedAuth.AuthFlowTypeEnum; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/OperationsConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/OperationsConverter.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/converters/OperationsConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/OperationsConverter.java index 9862ba52b611..b390f51f486d 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/OperationsConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/OperationsConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import static io.airbyte.api.model.generated.OperatorWebhook.WebhookTypeEnum.DBTCLOUD; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/SpecFetcher.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/SpecFetcher.java similarity index 82% rename from airbyte-server/src/main/java/io/airbyte/server/converters/SpecFetcher.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/SpecFetcher.java index 5934e6fb7756..6c46d7649990 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/SpecFetcher.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/SpecFetcher.java @@ -2,11 +2,11 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import com.google.common.base.Preconditions; +import io.airbyte.commons.server.scheduler.SynchronousResponse; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.scheduler.SynchronousResponse; public class SpecFetcher { diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/WorkflowStateConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/WorkflowStateConverter.java similarity index 90% rename from airbyte-server/src/main/java/io/airbyte/server/converters/WorkflowStateConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/WorkflowStateConverter.java index 76bd67ab2067..4f0d8a526734 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/WorkflowStateConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/WorkflowStateConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import io.airbyte.api.model.generated.WorkflowStateRead; import io.airbyte.commons.temporal.scheduling.state.WorkflowState; diff --git a/airbyte-server/src/main/java/io/airbyte/server/converters/WorkspaceWebhookConfigsConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/WorkspaceWebhookConfigsConverter.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/converters/WorkspaceWebhookConfigsConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/WorkspaceWebhookConfigsConverter.java index a8a86b838d2b..68826e525fef 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/converters/WorkspaceWebhookConfigsConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/converters/WorkspaceWebhookConfigsConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.api.model.generated.WebhookConfigRead; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/ApplicationErrorKnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ApplicationErrorKnownException.java similarity index 90% rename from airbyte-server/src/main/java/io/airbyte/server/errors/ApplicationErrorKnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ApplicationErrorKnownException.java index 69f3c86c5858..371601e85d49 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/ApplicationErrorKnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ApplicationErrorKnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; public class ApplicationErrorKnownException extends KnownException { diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/BadObjectSchemaKnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/BadObjectSchemaKnownException.java similarity index 90% rename from airbyte-server/src/main/java/io/airbyte/server/errors/BadObjectSchemaKnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/BadObjectSchemaKnownException.java index 5e880ba3483f..34b455a6e4a5 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/BadObjectSchemaKnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/BadObjectSchemaKnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; public class BadObjectSchemaKnownException extends KnownException { diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/ConnectFailureKnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ConnectFailureKnownException.java similarity index 90% rename from airbyte-server/src/main/java/io/airbyte/server/errors/ConnectFailureKnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ConnectFailureKnownException.java index 1b3c462d90e4..5997ce894a8d 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/ConnectFailureKnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ConnectFailureKnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; public class ConnectFailureKnownException extends KnownException { diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/IdNotFoundExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/IdNotFoundExceptionMapper.java similarity index 96% rename from airbyte-server/src/main/java/io/airbyte/server/errors/IdNotFoundExceptionMapper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/IdNotFoundExceptionMapper.java index 4cd9b709cf04..0dfc234bee28 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/IdNotFoundExceptionMapper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/IdNotFoundExceptionMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/IdNotFoundKnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/IdNotFoundKnownException.java similarity index 96% rename from airbyte-server/src/main/java/io/airbyte/server/errors/IdNotFoundKnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/IdNotFoundKnownException.java index 460e48dc1339..76699cceb8d8 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/IdNotFoundKnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/IdNotFoundKnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.airbyte.api.model.generated.NotFoundKnownExceptionInfo; import org.apache.logging.log4j.core.util.Throwables; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InternalServerKnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InternalServerKnownException.java similarity index 90% rename from airbyte-server/src/main/java/io/airbyte/server/errors/InternalServerKnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InternalServerKnownException.java index 7900e02f2451..4b9fd4b28419 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InternalServerKnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InternalServerKnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; public class InternalServerKnownException extends KnownException { diff --git a/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidInputExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidInputExceptionMapper.java new file mode 100644 index 000000000000..fd8b0b368a69 --- /dev/null +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidInputExceptionMapper.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022 Airbyte, Inc., all rights reserved. + */ + +package io.airbyte.commons.server.errors; + +import io.airbyte.api.model.generated.InvalidInputExceptionInfo; +import io.airbyte.api.model.generated.InvalidInputProperty; +import io.airbyte.commons.json.Jsons; +import java.util.ArrayList; +import java.util.List; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import javax.ws.rs.core.Response; +import javax.ws.rs.ext.ExceptionMapper; +import javax.ws.rs.ext.Provider; +import org.apache.logging.log4j.core.util.Throwables; + +@Provider +public class InvalidInputExceptionMapper implements ExceptionMapper { + + public static InvalidInputExceptionInfo infoFromConstraints(final ConstraintViolationException cve) { + final InvalidInputExceptionInfo exceptionInfo = new InvalidInputExceptionInfo() + .exceptionClassName(cve.getClass().getName()) + .message("Some properties contained invalid input.") + .exceptionStack(Throwables.toStringList(cve)); + + final List props = new ArrayList(); + for (final ConstraintViolation cv : cve.getConstraintViolations()) { + props.add(new InvalidInputProperty() + .propertyPath(cv.getPropertyPath().toString()) + .message(cv.getMessage()) + .invalidValue(cv.getInvalidValue() != null ? cv.getInvalidValue().toString() : "null")); + } + exceptionInfo.validationErrors(props); + return exceptionInfo; + } + + @Override + public Response toResponse(final ConstraintViolationException e) { + return Response.status(Response.Status.BAD_REQUEST) + .entity(Jsons.serialize(InvalidInputExceptionMapper.infoFromConstraints(e))) + .type("application/json") + .build(); + } + +} diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidJsonExceptionMapper.java similarity index 93% rename from airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionMapper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidJsonExceptionMapper.java index c126f1299325..a073c369aca5 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionMapper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidJsonExceptionMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import com.fasterxml.jackson.core.JsonParseException; import javax.ws.rs.core.Response; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidJsonInputExceptionMapper.java similarity index 94% rename from airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionMapper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidJsonInputExceptionMapper.java index 90700f771782..d504333c4f0e 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionMapper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/InvalidJsonInputExceptionMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import com.fasterxml.jackson.databind.JsonMappingException; import io.airbyte.commons.json.Jsons; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/KnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/KnownException.java similarity index 96% rename from airbyte-server/src/main/java/io/airbyte/server/errors/KnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/KnownException.java index d9b5716a8c6c..2067e3d87299 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/KnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/KnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.airbyte.api.model.generated.KnownExceptionInfo; import org.apache.logging.log4j.core.util.Throwables; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/KnownExceptionMapper.java similarity index 95% rename from airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionMapper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/KnownExceptionMapper.java index 9d81a3fc7174..5ead770ad91c 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionMapper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/KnownExceptionMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.airbyte.commons.json.Jsons; import io.micronaut.context.annotation.Requires; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/NotFoundExceptionMapper.java similarity index 96% rename from airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionMapper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/NotFoundExceptionMapper.java index 0317cdf952cb..93a430472a6b 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionMapper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/NotFoundExceptionMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.airbyte.commons.json.Jsons; import javax.ws.rs.NotFoundException; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionMapper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/UncaughtExceptionMapper.java similarity index 95% rename from airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionMapper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/UncaughtExceptionMapper.java index 3aac5522570e..8057734d660a 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionMapper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/UncaughtExceptionMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.airbyte.api.model.generated.KnownExceptionInfo; import io.airbyte.commons.json.Jsons; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/UnsupportedProtocolVersionException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/UnsupportedProtocolVersionException.java similarity index 94% rename from airbyte-server/src/main/java/io/airbyte/server/errors/UnsupportedProtocolVersionException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/UnsupportedProtocolVersionException.java index 5b83844a54c1..661e7e40a485 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/UnsupportedProtocolVersionException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/UnsupportedProtocolVersionException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; import io.airbyte.commons.version.Version; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/ValueConflictKnownException.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ValueConflictKnownException.java similarity index 90% rename from airbyte-server/src/main/java/io/airbyte/server/errors/ValueConflictKnownException.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ValueConflictKnownException.java index b84ed0da6472..c6ac8dbe92ef 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/ValueConflictKnownException.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/errors/ValueConflictKnownException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.errors; +package io.airbyte.commons.server.errors; public class ValueConflictKnownException extends KnownException { diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/AttemptHandler.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/AttemptHandler.java index 6a07ff304408..c7132665fe92 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/AttemptHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/AttemptHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.InternalOperationResult; import io.airbyte.api.model.generated.SaveStatsRequestBody; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/ConnectionsHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/ConnectionsHandler.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/ConnectionsHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/ConnectionsHandler.java index 12aff047d12a..698d66716c7d 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/ConnectionsHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/ConnectionsHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -26,6 +26,14 @@ import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.enums.Enums; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.ApiPojoConverters; +import io.airbyte.commons.server.converters.CatalogDiffConverters; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.handlers.helpers.ConnectionMatcher; +import io.airbyte.commons.server.handlers.helpers.ConnectionScheduleHelper; +import io.airbyte.commons.server.handlers.helpers.DestinationMatcher; +import io.airbyte.commons.server.handlers.helpers.SourceMatcher; +import io.airbyte.commons.server.scheduler.EventRunner; import io.airbyte.config.ActorCatalog; import io.airbyte.config.BasicSchedule; import io.airbyte.config.DestinationConnection; @@ -46,14 +54,6 @@ import io.airbyte.persistence.job.WorkspaceHelper; import io.airbyte.protocol.models.CatalogHelpers; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.server.converters.ApiPojoConverters; -import io.airbyte.server.converters.CatalogDiffConverters; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.handlers.helpers.ConnectionMatcher; -import io.airbyte.server.handlers.helpers.ConnectionScheduleHelper; -import io.airbyte.server.handlers.helpers.DestinationMatcher; -import io.airbyte.server.handlers.helpers.SourceMatcher; -import io.airbyte.server.scheduler.EventRunner; import io.airbyte.validation.json.JsonValidationException; import io.airbyte.workers.helper.ConnectionHelper; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/DestinationDefinitionsHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/DestinationDefinitionsHandler.java similarity index 96% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/DestinationDefinitionsHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/DestinationDefinitionsHandler.java index 8dbd84014459..813cda084b55 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/DestinationDefinitionsHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/DestinationDefinitionsHandler.java @@ -2,9 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; - -import static io.airbyte.server.ServerConstants.DEV_IMAGE_TAG; +package io.airbyte.commons.server.handlers; import com.google.common.annotations.VisibleForTesting; import io.airbyte.api.model.generated.CustomDestinationDefinitionCreate; @@ -21,6 +19,15 @@ import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.docker.DockerUtils; import io.airbyte.commons.resources.MoreResources; +import io.airbyte.commons.server.ServerConstants; +import io.airbyte.commons.server.converters.ApiPojoConverters; +import io.airbyte.commons.server.converters.SpecFetcher; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; +import io.airbyte.commons.server.errors.InternalServerKnownException; +import io.airbyte.commons.server.errors.UnsupportedProtocolVersionException; +import io.airbyte.commons.server.scheduler.SynchronousResponse; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.commons.util.MoreLists; import io.airbyte.commons.version.AirbyteProtocolVersion; import io.airbyte.commons.version.AirbyteProtocolVersionRange; @@ -29,14 +36,6 @@ import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.converters.ApiPojoConverters; -import io.airbyte.server.converters.SpecFetcher; -import io.airbyte.server.errors.IdNotFoundKnownException; -import io.airbyte.server.errors.InternalServerKnownException; -import io.airbyte.server.errors.UnsupportedProtocolVersionException; -import io.airbyte.server.scheduler.SynchronousResponse; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; -import io.airbyte.server.services.AirbyteGithubStore; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Singleton; import java.io.IOException; @@ -240,7 +239,7 @@ public DestinationDefinitionRead updateDestinationDefinition(final DestinationDe // specs are re-fetched from the container if the image tag has changed, or if the tag is "dev", // to allow for easier iteration of dev images final boolean specNeedsUpdate = !currentDestination.getDockerImageTag().equals(destinationDefinitionUpdate.getDockerImageTag()) - || destinationDefinitionUpdate.getDockerImageTag().equals(DEV_IMAGE_TAG); + || ServerConstants.DEV_IMAGE_TAG.equals(destinationDefinitionUpdate.getDockerImageTag()); final ConnectorSpecification spec = specNeedsUpdate ? getSpecForImage(currentDestination.getDockerRepository(), destinationDefinitionUpdate.getDockerImageTag(), currentDestination.getCustom()) : currentDestination.getSpec(); diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/DestinationHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/DestinationHandler.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/DestinationHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/DestinationHandler.java index d105a514e0ec..4a5fa21e5257 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/DestinationHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/DestinationHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.annotations.VisibleForTesting; @@ -20,6 +20,7 @@ import io.airbyte.api.model.generated.DestinationUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.ConfigurationUpdate; import io.airbyte.config.DestinationConnection; import io.airbyte.config.StandardDestinationDefinition; import io.airbyte.config.persistence.ConfigNotFoundException; @@ -29,7 +30,6 @@ import io.airbyte.config.persistence.split_secrets.JsonSecretsProcessor; import io.airbyte.persistence.job.factory.OAuthConfigSupplier; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.converters.ConfigurationUpdate; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Inject; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/HealthCheckHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/HealthCheckHandler.java similarity index 92% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/HealthCheckHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/HealthCheckHandler.java index 2843fbc2c09d..bd96e2df625f 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/HealthCheckHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/HealthCheckHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.HealthCheckRead; import io.airbyte.config.persistence.ConfigRepository; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/JobHistoryHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/JobHistoryHandler.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/JobHistoryHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/JobHistoryHandler.java index 579e0b4672a4..65fddab32957 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/JobHistoryHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/JobHistoryHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.google.common.base.Preconditions; import io.airbyte.api.model.generated.AttemptInfoRead; @@ -31,6 +31,8 @@ import io.airbyte.api.model.generated.SourceIdRequestBody; import io.airbyte.api.model.generated.SourceRead; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.converters.JobConverter; +import io.airbyte.commons.server.converters.WorkflowStateConverter; import io.airbyte.commons.temporal.TemporalClient; import io.airbyte.commons.version.AirbyteVersion; import io.airbyte.config.Configs.WorkerEnvironment; @@ -42,8 +44,6 @@ import io.airbyte.persistence.job.JobPersistence.JobAttemptPair; import io.airbyte.persistence.job.models.Job; import io.airbyte.persistence.job.models.JobStatus; -import io.airbyte.server.converters.JobConverter; -import io.airbyte.server.converters.WorkflowStateConverter; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Singleton; import java.io.IOException; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/LogsHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/LogsHandler.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/LogsHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/LogsHandler.java index b9ac2378aca4..4fb5ce2f8d66 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/LogsHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/LogsHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.LogsRequestBody; import io.airbyte.config.Configs; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/OAuthHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OAuthHandler.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/OAuthHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OAuthHandler.java index 6823d6d5a8f6..8a4cb5089d50 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/OAuthHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OAuthHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.DESTINATION_DEFINITION_ID_KEY; import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.SOURCE_DEFINITION_ID_KEY; @@ -22,6 +22,7 @@ import io.airbyte.commons.constants.AirbyteSecretConstants; import io.airbyte.commons.json.JsonPaths; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.handlers.helpers.OAuthPathExtractor; import io.airbyte.config.DestinationConnection; import io.airbyte.config.DestinationOAuthParameter; import io.airbyte.config.SourceConnection; @@ -37,7 +38,6 @@ import io.airbyte.persistence.job.factory.OAuthConfigSupplier; import io.airbyte.persistence.job.tracker.TrackingMetadata; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.handlers.helpers.OAuthPathExtractor; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Singleton; import java.io.IOException; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/OpenApiConfigHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OpenApiConfigHandler.java similarity index 93% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/OpenApiConfigHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OpenApiConfigHandler.java index e9d4b3614ec8..4192ff00dbb5 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/OpenApiConfigHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OpenApiConfigHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.commons.resources.MoreResources; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/OperationsHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OperationsHandler.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/OperationsHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OperationsHandler.java index 7e6c45140508..7510b26cc846 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/OperationsHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/OperationsHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -17,13 +17,13 @@ import io.airbyte.api.model.generated.OperationUpdate; import io.airbyte.api.model.generated.OperatorConfiguration; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.converters.OperationsConverter; import io.airbyte.config.ConfigSchema; import io.airbyte.config.StandardSync; import io.airbyte.config.StandardSyncOperation; import io.airbyte.config.StandardSyncOperation.OperatorType; import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.config.persistence.ConfigRepository; -import io.airbyte.server.converters.OperationsConverter; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Inject; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/SchedulerHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SchedulerHandler.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/SchedulerHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SchedulerHandler.java index 97e8bfb5cc00..51c38b824b28 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/SchedulerHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SchedulerHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; @@ -45,6 +45,15 @@ import io.airbyte.commons.enums.Enums; import io.airbyte.commons.features.FeatureFlags; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.ConfigurationUpdate; +import io.airbyte.commons.server.converters.JobConverter; +import io.airbyte.commons.server.converters.OauthModelConverter; +import io.airbyte.commons.server.errors.ValueConflictKnownException; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.scheduler.EventRunner; +import io.airbyte.commons.server.scheduler.SynchronousJobMetadata; +import io.airbyte.commons.server.scheduler.SynchronousResponse; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; import io.airbyte.commons.temporal.ErrorCode; import io.airbyte.commons.temporal.TemporalClient.ManualOperationResult; import io.airbyte.commons.version.Version; @@ -65,15 +74,6 @@ import io.airbyte.persistence.job.models.Job; import io.airbyte.protocol.models.AirbyteCatalog; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.converters.ConfigurationUpdate; -import io.airbyte.server.converters.JobConverter; -import io.airbyte.server.converters.OauthModelConverter; -import io.airbyte.server.errors.ValueConflictKnownException; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.scheduler.EventRunner; -import io.airbyte.server.scheduler.SynchronousJobMetadata; -import io.airbyte.server.scheduler.SynchronousResponse; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/SourceDefinitionsHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SourceDefinitionsHandler.java similarity index 95% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/SourceDefinitionsHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SourceDefinitionsHandler.java index 578d8398153a..9ee876cba701 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/SourceDefinitionsHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SourceDefinitionsHandler.java @@ -2,9 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; - -import static io.airbyte.server.ServerConstants.DEV_IMAGE_TAG; +package io.airbyte.commons.server.handlers; import com.google.common.annotations.VisibleForTesting; import io.airbyte.api.model.generated.CustomSourceDefinitionCreate; @@ -22,6 +20,15 @@ import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.docker.DockerUtils; import io.airbyte.commons.resources.MoreResources; +import io.airbyte.commons.server.ServerConstants; +import io.airbyte.commons.server.converters.ApiPojoConverters; +import io.airbyte.commons.server.converters.SpecFetcher; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; +import io.airbyte.commons.server.errors.InternalServerKnownException; +import io.airbyte.commons.server.errors.UnsupportedProtocolVersionException; +import io.airbyte.commons.server.scheduler.SynchronousResponse; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.commons.util.MoreLists; import io.airbyte.commons.version.AirbyteProtocolVersion; import io.airbyte.commons.version.AirbyteProtocolVersionRange; @@ -30,14 +37,6 @@ import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.converters.ApiPojoConverters; -import io.airbyte.server.converters.SpecFetcher; -import io.airbyte.server.errors.IdNotFoundKnownException; -import io.airbyte.server.errors.InternalServerKnownException; -import io.airbyte.server.errors.UnsupportedProtocolVersionException; -import io.airbyte.server.scheduler.SynchronousResponse; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; -import io.airbyte.server.services.AirbyteGithubStore; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Inject; import jakarta.inject.Singleton; @@ -242,7 +241,7 @@ public SourceDefinitionRead updateSourceDefinition(final SourceDefinitionUpdate // specs are re-fetched from the container if the image tag has changed, or if the tag is "dev", // to allow for easier iteration of dev images final boolean specNeedsUpdate = !currentSourceDefinition.getDockerImageTag().equals(sourceDefinitionUpdate.getDockerImageTag()) - || sourceDefinitionUpdate.getDockerImageTag().equals(DEV_IMAGE_TAG); + || ServerConstants.DEV_IMAGE_TAG.equals(sourceDefinitionUpdate.getDockerImageTag()); final ConnectorSpecification spec = specNeedsUpdate ? getSpecForImage(currentSourceDefinition.getDockerRepository(), sourceDefinitionUpdate.getDockerImageTag(), currentSourceDefinition.getCustom()) diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/SourceHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SourceHandler.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/SourceHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SourceHandler.java index c8c366bab4a8..fe95cf6ec1c3 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/SourceHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/SourceHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.Lists; @@ -21,6 +21,8 @@ import io.airbyte.api.model.generated.SourceSnippetRead; import io.airbyte.api.model.generated.SourceUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; +import io.airbyte.commons.server.converters.ConfigurationUpdate; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; import io.airbyte.config.SourceConnection; import io.airbyte.config.StandardSourceDefinition; import io.airbyte.config.persistence.ConfigNotFoundException; @@ -31,8 +33,6 @@ import io.airbyte.persistence.job.factory.OAuthConfigSupplier; import io.airbyte.protocol.models.AirbyteCatalog; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.converters.ConfigurationUpdate; -import io.airbyte.server.handlers.helpers.CatalogConverter; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Inject; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/StateHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/StateHandler.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/StateHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/StateHandler.java index 977f95813aad..8bc2a8f68e12 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/StateHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/StateHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.ConnectionIdRequestBody; import io.airbyte.api.model.generated.ConnectionState; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendCheckUpdatesHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendCheckUpdatesHandler.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendCheckUpdatesHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendCheckUpdatesHandler.java index 7c51e26c5494..13a2c0d3cd2a 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendCheckUpdatesHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendCheckUpdatesHandler.java @@ -2,13 +2,13 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.WebBackendCheckUpdatesRead; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.config.StandardDestinationDefinition; import io.airbyte.config.StandardSourceDefinition; import io.airbyte.config.persistence.ConfigRepository; -import io.airbyte.server.services.AirbyteGithubStore; import jakarta.inject.Singleton; import java.io.IOException; import java.util.List; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendConnectionsHandler.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendConnectionsHandler.java index e45c35686704..3e7120737057 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendConnectionsHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendConnectionsHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static java.util.stream.Collectors.toMap; @@ -49,6 +49,9 @@ import io.airbyte.commons.enums.Enums; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.lang.MoreBooleans; +import io.airbyte.commons.server.converters.ApiPojoConverters; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.scheduler.EventRunner; import io.airbyte.config.ActorCatalog; import io.airbyte.config.ActorCatalogFetchEvent; import io.airbyte.config.StandardSync; @@ -56,9 +59,6 @@ import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.config.persistence.ConfigRepository.StandardSyncQuery; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.server.converters.ApiPojoConverters; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.scheduler.EventRunner; import io.airbyte.validation.json.JsonValidationException; import io.airbyte.workers.helper.ProtocolConverters; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendGeographiesHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendGeographiesHandler.java similarity index 95% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendGeographiesHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendGeographiesHandler.java index 3d39209098f1..7e33d5374e7e 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendGeographiesHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WebBackendGeographiesHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.Geography; import io.airbyte.api.model.generated.WebBackendGeographiesListResult; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/WorkspacesHandler.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WorkspacesHandler.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/WorkspacesHandler.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WorkspacesHandler.java index 6829747a3014..29b739ffe8d3 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/WorkspacesHandler.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/WorkspacesHandler.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import com.github.slugify.Slugify; import com.google.common.annotations.VisibleForTesting; @@ -26,17 +26,17 @@ import io.airbyte.api.model.generated.WorkspaceUpdate; import io.airbyte.api.model.generated.WorkspaceUpdateName; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.converters.ApiPojoConverters; +import io.airbyte.commons.server.converters.NotificationConverter; +import io.airbyte.commons.server.converters.WorkspaceWebhookConfigsConverter; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; +import io.airbyte.commons.server.errors.InternalServerKnownException; +import io.airbyte.commons.server.errors.ValueConflictKnownException; import io.airbyte.config.StandardWorkspace; import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.config.persistence.SecretsRepositoryWriter; import io.airbyte.notification.NotificationClient; -import io.airbyte.server.converters.ApiPojoConverters; -import io.airbyte.server.converters.NotificationConverter; -import io.airbyte.server.converters.WorkspaceWebhookConfigsConverter; -import io.airbyte.server.errors.IdNotFoundKnownException; -import io.airbyte.server.errors.InternalServerKnownException; -import io.airbyte.server.errors.ValueConflictKnownException; import io.airbyte.validation.json.JsonValidationException; import jakarta.inject.Inject; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/CatalogConverter.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/CatalogConverter.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/CatalogConverter.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/CatalogConverter.java index 6cf626f381b4..48ae8630b205 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/CatalogConverter.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/CatalogConverter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionMatcher.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/ConnectionMatcher.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionMatcher.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/ConnectionMatcher.java index 2afaf63aec8b..d9b0387fca17 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionMatcher.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/ConnectionMatcher.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; import io.airbyte.api.model.generated.ConnectionRead; import io.airbyte.api.model.generated.ConnectionSearch; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionScheduleHelper.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/ConnectionScheduleHelper.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionScheduleHelper.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/ConnectionScheduleHelper.java index 807072626cb3..e49d31a6449e 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionScheduleHelper.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/ConnectionScheduleHelper.java @@ -2,17 +2,17 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; import io.airbyte.api.model.generated.ConnectionScheduleData; import io.airbyte.api.model.generated.ConnectionScheduleType; +import io.airbyte.commons.server.converters.ApiPojoConverters; import io.airbyte.config.BasicSchedule; import io.airbyte.config.Cron; import io.airbyte.config.Schedule; import io.airbyte.config.ScheduleData; import io.airbyte.config.StandardSync; import io.airbyte.config.StandardSync.ScheduleType; -import io.airbyte.server.converters.ApiPojoConverters; import io.airbyte.validation.json.JsonValidationException; import java.text.ParseException; import java.util.TimeZone; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/DestinationMatcher.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/DestinationMatcher.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/DestinationMatcher.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/DestinationMatcher.java index b9c374c31e00..05f2752d1df2 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/DestinationMatcher.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/DestinationMatcher.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/Matchable.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/Matchable.java similarity index 71% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/Matchable.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/Matchable.java index b1de20b95fdc..2e87767d3a76 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/Matchable.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/Matchable.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; @FunctionalInterface interface Matchable { diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/OAuthPathExtractor.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/OAuthPathExtractor.java similarity index 96% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/OAuthPathExtractor.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/OAuthPathExtractor.java index 4a6ed4580020..60da416a5108 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/OAuthPathExtractor.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/OAuthPathExtractor.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; import com.fasterxml.jackson.databind.JsonNode; import java.util.ArrayList; diff --git a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/SourceMatcher.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/SourceMatcher.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/SourceMatcher.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/SourceMatcher.java index ee4e35d7d2c7..78c13fc4e992 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/SourceMatcher.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/handlers/helpers/SourceMatcher.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helpers; +package io.airbyte.commons.server.handlers.helpers; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/airbyte-server/src/main/java/io/airbyte/server/scheduler/DefaultSynchronousSchedulerClient.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/DefaultSynchronousSchedulerClient.java similarity index 99% rename from airbyte-server/src/main/java/io/airbyte/server/scheduler/DefaultSynchronousSchedulerClient.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/DefaultSynchronousSchedulerClient.java index 28036302a9be..f01806f08958 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/scheduler/DefaultSynchronousSchedulerClient.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/DefaultSynchronousSchedulerClient.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.annotations.VisibleForTesting; diff --git a/airbyte-server/src/main/java/io/airbyte/server/scheduler/EventRunner.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/EventRunner.java similarity index 95% rename from airbyte-server/src/main/java/io/airbyte/server/scheduler/EventRunner.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/EventRunner.java index bc4a83a07042..627df14556b3 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/scheduler/EventRunner.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/EventRunner.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import io.airbyte.commons.temporal.TemporalClient.ManualOperationResult; import io.airbyte.protocol.models.StreamDescriptor; diff --git a/airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousJobMetadata.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousJobMetadata.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousJobMetadata.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousJobMetadata.java index b4689b9fa6bf..a3731db99e52 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousJobMetadata.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousJobMetadata.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import io.airbyte.commons.temporal.JobMetadata; import io.airbyte.config.JobConfig.ConfigType; diff --git a/airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousResponse.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousResponse.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousResponse.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousResponse.java index 463564e8fe98..1c135ce85aaf 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousResponse.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousResponse.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import io.airbyte.commons.temporal.TemporalResponse; import io.airbyte.config.ConnectorJobOutput; diff --git a/airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousSchedulerClient.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousSchedulerClient.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousSchedulerClient.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousSchedulerClient.java index 7ff4257e1f2b..a9bceabccc64 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/scheduler/SynchronousSchedulerClient.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/SynchronousSchedulerClient.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import io.airbyte.commons.version.Version; import io.airbyte.config.DestinationConnection; diff --git a/airbyte-server/src/main/java/io/airbyte/server/scheduler/TemporalEventRunner.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/TemporalEventRunner.java similarity index 97% rename from airbyte-server/src/main/java/io/airbyte/server/scheduler/TemporalEventRunner.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/TemporalEventRunner.java index 5aa469a1a9d5..e6976a7f9de1 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/scheduler/TemporalEventRunner.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/scheduler/TemporalEventRunner.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import io.airbyte.commons.temporal.TemporalClient; import io.airbyte.commons.temporal.TemporalClient.ManualOperationResult; diff --git a/airbyte-server/src/main/java/io/airbyte/server/services/AirbyteGithubStore.java b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/services/AirbyteGithubStore.java similarity index 98% rename from airbyte-server/src/main/java/io/airbyte/server/services/AirbyteGithubStore.java rename to airbyte-commons-server/src/main/java/io/airbyte/commons/server/services/AirbyteGithubStore.java index 8500d6e8dc55..06113d752d48 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/services/AirbyteGithubStore.java +++ b/airbyte-commons-server/src/main/java/io/airbyte/commons/server/services/AirbyteGithubStore.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.services; +package io.airbyte.commons.server.services; import com.google.common.annotations.VisibleForTesting; import io.airbyte.config.EnvConfigs; diff --git a/airbyte-server/src/test/java/io/airbyte/server/RequestLoggerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/RequestLoggerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/RequestLoggerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/RequestLoggerTest.java index 46498b4e0b60..042baedd324e 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/RequestLoggerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/RequestLoggerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server; +package io.airbyte.commons.server; import io.airbyte.commons.io.IOs; import io.airbyte.config.Configs.WorkerEnvironment; diff --git a/airbyte-server/src/test/java/io/airbyte/server/converters/CatalogConverterTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/CatalogConverterTest.java similarity index 95% rename from airbyte-server/src/test/java/io/airbyte/server/converters/CatalogConverterTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/CatalogConverterTest.java index d9d41bda7ec4..5747a8d91066 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/converters/CatalogConverterTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/CatalogConverterTest.java @@ -2,10 +2,10 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; -import static io.airbyte.server.helpers.ConnectionHelpers.FIELD_NAME; -import static io.airbyte.server.helpers.ConnectionHelpers.SECOND_FIELD_NAME; +import static io.airbyte.commons.server.helpers.ConnectionHelpers.FIELD_NAME; +import static io.airbyte.commons.server.helpers.ConnectionHelpers.SECOND_FIELD_NAME; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -16,10 +16,10 @@ import io.airbyte.api.model.generated.SelectedFieldInfo; import io.airbyte.api.model.generated.SyncMode; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.helpers.ConnectionHelpers; import io.airbyte.config.DataType; import io.airbyte.config.FieldSelectionData; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.helpers.ConnectionHelpers; import io.airbyte.validation.json.JsonValidationException; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/airbyte-server/src/test/java/io/airbyte/server/converters/CatalogDiffConvertersTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/CatalogDiffConvertersTest.java similarity index 94% rename from airbyte-server/src/test/java/io/airbyte/server/converters/CatalogDiffConvertersTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/CatalogDiffConvertersTest.java index d9108cd6f577..e18c89ef10ba 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/converters/CatalogDiffConvertersTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/CatalogDiffConvertersTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/airbyte-server/src/test/java/io/airbyte/server/converters/ConfigurationUpdateTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/ConfigurationUpdateTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/converters/ConfigurationUpdateTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/ConfigurationUpdateTest.java index 654c7af8c44b..831bbc58ff24 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/converters/ConfigurationUpdateTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/ConfigurationUpdateTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/airbyte-server/src/test/java/io/airbyte/server/converters/JobConverterTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/JobConverterTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/converters/JobConverterTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/JobConverterTest.java index f73ec6e62aad..eb2595333f85 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/converters/JobConverterTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/JobConverterTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/airbyte-server/src/test/java/io/airbyte/server/converters/OauthModelConverterTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/OauthModelConverterTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/converters/OauthModelConverterTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/OauthModelConverterTest.java index c96a23d1bab1..494e9c3a2b7f 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/converters/OauthModelConverterTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/converters/OauthModelConverterTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.converters; +package io.airbyte.commons.server.converters; import static org.junit.jupiter.api.Assertions.*; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/AttemptHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/AttemptHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/AttemptHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/AttemptHandlerTest.java index 4698ed5c6387..eeb2c0ff48c7 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/AttemptHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/AttemptHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/ConnectionSchedulerHelperTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/ConnectionSchedulerHelperTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/ConnectionSchedulerHelperTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/ConnectionSchedulerHelperTest.java index 7c8f2bc0bc82..83c68ec03c45 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/ConnectionSchedulerHelperTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/ConnectionSchedulerHelperTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -15,11 +15,11 @@ import io.airbyte.api.model.generated.ConnectionScheduleDataBasicSchedule.TimeUnitEnum; import io.airbyte.api.model.generated.ConnectionScheduleDataCron; import io.airbyte.api.model.generated.ConnectionScheduleType; +import io.airbyte.commons.server.handlers.helpers.ConnectionScheduleHelper; import io.airbyte.config.BasicSchedule.TimeUnit; import io.airbyte.config.Schedule; import io.airbyte.config.StandardSync; import io.airbyte.config.StandardSync.ScheduleType; -import io.airbyte.server.handlers.helpers.ConnectionScheduleHelper; import io.airbyte.validation.json.JsonValidationException; import org.junit.jupiter.api.Test; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/ConnectionsHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/ConnectionsHandlerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/ConnectionsHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/ConnectionsHandlerTest.java index 9a2364a8cf45..b2445c5d43b0 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/ConnectionsHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/ConnectionsHandlerTest.java @@ -2,10 +2,10 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; -import static io.airbyte.server.helpers.ConnectionHelpers.FIELD_NAME; -import static io.airbyte.server.helpers.ConnectionHelpers.SECOND_FIELD_NAME; +import static io.airbyte.commons.server.helpers.ConnectionHelpers.FIELD_NAME; +import static io.airbyte.commons.server.helpers.ConnectionHelpers.SECOND_FIELD_NAME; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -43,6 +43,10 @@ import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.enums.Enums; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.ApiPojoConverters; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.helpers.ConnectionHelpers; +import io.airbyte.commons.server.scheduler.EventRunner; import io.airbyte.config.BasicSchedule; import io.airbyte.config.ConfigSchema; import io.airbyte.config.Cron; @@ -65,10 +69,6 @@ import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.persistence.job.WorkspaceHelper; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.server.converters.ApiPojoConverters; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.helpers.ConnectionHelpers; -import io.airbyte.server.scheduler.EventRunner; import io.airbyte.validation.json.JsonValidationException; import io.airbyte.workers.helper.ConnectionHelper; import java.io.IOException; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/DestinationDefinitionsHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/DestinationDefinitionsHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/DestinationDefinitionsHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/DestinationDefinitionsHandlerTest.java index 8eadc7abf46a..4a65cc85aa93 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/DestinationDefinitionsHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/DestinationDefinitionsHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -31,6 +31,12 @@ import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.docker.DockerUtils; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; +import io.airbyte.commons.server.errors.UnsupportedProtocolVersionException; +import io.airbyte.commons.server.scheduler.SynchronousJobMetadata; +import io.airbyte.commons.server.scheduler.SynchronousResponse; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.commons.version.AirbyteProtocolVersionRange; import io.airbyte.commons.version.Version; import io.airbyte.config.ActorDefinitionResourceRequirements; @@ -44,12 +50,6 @@ import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.errors.IdNotFoundKnownException; -import io.airbyte.server.errors.UnsupportedProtocolVersionException; -import io.airbyte.server.scheduler.SynchronousJobMetadata; -import io.airbyte.server.scheduler.SynchronousResponse; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; -import io.airbyte.server.services.AirbyteGithubStore; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; import java.net.URI; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/DestinationHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/DestinationHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/DestinationHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/DestinationHandlerTest.java index 728d60bbee48..9448aa5a3609 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/DestinationHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/DestinationHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -24,6 +24,9 @@ import io.airbyte.api.model.generated.DestinationUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.ConfigurationUpdate; +import io.airbyte.commons.server.helpers.ConnectorSpecificationHelpers; +import io.airbyte.commons.server.helpers.DestinationHelpers; import io.airbyte.config.DestinationConnection; import io.airbyte.config.StandardDestinationDefinition; import io.airbyte.config.persistence.ConfigNotFoundException; @@ -33,9 +36,6 @@ import io.airbyte.config.persistence.split_secrets.JsonSecretsProcessor; import io.airbyte.persistence.job.factory.OAuthConfigSupplier; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.converters.ConfigurationUpdate; -import io.airbyte.server.helpers.ConnectorSpecificationHelpers; -import io.airbyte.server.helpers.DestinationHelpers; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/HealthCheckHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/HealthCheckHandlerTest.java similarity index 95% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/HealthCheckHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/HealthCheckHandlerTest.java index 2d83a4bd02c9..7dedbe3142d2 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/HealthCheckHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/HealthCheckHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/JobHistoryHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/JobHistoryHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/JobHistoryHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/JobHistoryHandlerTest.java index 02bd7034f6f5..3ab2582afdb4 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/JobHistoryHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/JobHistoryHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -35,6 +35,12 @@ import io.airbyte.api.model.generated.SourceIdRequestBody; import io.airbyte.api.model.generated.SourceRead; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.converters.JobConverter; +import io.airbyte.commons.server.helpers.ConnectionHelpers; +import io.airbyte.commons.server.helpers.DestinationDefinitionHelpers; +import io.airbyte.commons.server.helpers.DestinationHelpers; +import io.airbyte.commons.server.helpers.SourceDefinitionHelpers; +import io.airbyte.commons.server.helpers.SourceHelpers; import io.airbyte.commons.version.AirbyteVersion; import io.airbyte.config.Configs.WorkerEnvironment; import io.airbyte.config.DestinationConnection; @@ -57,12 +63,6 @@ import io.airbyte.persistence.job.models.AttemptStatus; import io.airbyte.persistence.job.models.Job; import io.airbyte.persistence.job.models.JobStatus; -import io.airbyte.server.converters.JobConverter; -import io.airbyte.server.helpers.ConnectionHelpers; -import io.airbyte.server.helpers.DestinationDefinitionHelpers; -import io.airbyte.server.helpers.DestinationHelpers; -import io.airbyte.server.helpers.SourceDefinitionHelpers; -import io.airbyte.server.helpers.SourceHelpers; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; import java.net.URISyntaxException; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/LogsHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/LogsHandlerTest.java similarity index 97% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/LogsHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/LogsHandlerTest.java index 098f05f1a4a3..3b730f199771 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/LogsHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/LogsHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/OAuthHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OAuthHandlerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/OAuthHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OAuthHandlerTest.java index 08d9d2f95e53..57daf559363d 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/OAuthHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OAuthHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/OpenApiConfigHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OpenApiConfigHandlerTest.java similarity index 92% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/OpenApiConfigHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OpenApiConfigHandlerTest.java index 5b7311433e9b..99dd0ccb4b4b 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/OpenApiConfigHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OpenApiConfigHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.*; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/OperationsHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OperationsHandlerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/OperationsHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OperationsHandlerTest.java index e3e2d49542f1..97082336b16d 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/OperationsHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/OperationsHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/SchedulerHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SchedulerHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/SchedulerHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SchedulerHandlerTest.java index dc8721c4cf55..b495ab19e1a1 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/SchedulerHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SchedulerHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -52,6 +52,16 @@ import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.lang.Exceptions; +import io.airbyte.commons.server.converters.ConfigurationUpdate; +import io.airbyte.commons.server.converters.JobConverter; +import io.airbyte.commons.server.errors.ValueConflictKnownException; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.helpers.DestinationHelpers; +import io.airbyte.commons.server.helpers.SourceHelpers; +import io.airbyte.commons.server.scheduler.EventRunner; +import io.airbyte.commons.server.scheduler.SynchronousJobMetadata; +import io.airbyte.commons.server.scheduler.SynchronousResponse; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; import io.airbyte.commons.temporal.ErrorCode; import io.airbyte.commons.temporal.TemporalClient.ManualOperationResult; import io.airbyte.commons.version.Version; @@ -76,16 +86,6 @@ import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; import io.airbyte.protocol.models.StreamDescriptor; -import io.airbyte.server.converters.ConfigurationUpdate; -import io.airbyte.server.converters.JobConverter; -import io.airbyte.server.errors.ValueConflictKnownException; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.helpers.DestinationHelpers; -import io.airbyte.server.helpers.SourceHelpers; -import io.airbyte.server.scheduler.EventRunner; -import io.airbyte.server.scheduler.SynchronousJobMetadata; -import io.airbyte.server.scheduler.SynchronousResponse; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/SourceDefinitionsHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SourceDefinitionsHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/SourceDefinitionsHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SourceDefinitionsHandlerTest.java index 424ae0d49e3d..76c2c70dd036 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/SourceDefinitionsHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SourceDefinitionsHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -33,6 +33,12 @@ import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.docker.DockerUtils; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; +import io.airbyte.commons.server.errors.UnsupportedProtocolVersionException; +import io.airbyte.commons.server.scheduler.SynchronousJobMetadata; +import io.airbyte.commons.server.scheduler.SynchronousResponse; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.commons.version.AirbyteProtocolVersionRange; import io.airbyte.commons.version.Version; import io.airbyte.config.ActorDefinitionResourceRequirements; @@ -45,12 +51,6 @@ import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.server.errors.IdNotFoundKnownException; -import io.airbyte.server.errors.UnsupportedProtocolVersionException; -import io.airbyte.server.scheduler.SynchronousJobMetadata; -import io.airbyte.server.scheduler.SynchronousResponse; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; -import io.airbyte.server.services.AirbyteGithubStore; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; import java.net.URI; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/SourceHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SourceHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/SourceHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SourceHandlerTest.java index 61a27553bea3..d36423baeb53 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/SourceHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/SourceHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -29,6 +29,11 @@ import io.airbyte.api.model.generated.SourceUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.ConfigurationUpdate; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.helpers.ConnectionHelpers; +import io.airbyte.commons.server.helpers.ConnectorSpecificationHelpers; +import io.airbyte.commons.server.helpers.SourceHelpers; import io.airbyte.config.SourceConnection; import io.airbyte.config.StandardSourceDefinition; import io.airbyte.config.StandardSync; @@ -43,11 +48,6 @@ import io.airbyte.protocol.models.ConnectorSpecification; import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; -import io.airbyte.server.converters.ConfigurationUpdate; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.helpers.ConnectionHelpers; -import io.airbyte.server.helpers.ConnectorSpecificationHelpers; -import io.airbyte.server.helpers.SourceHelpers; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/StateHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/StateHandlerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/StateHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/StateHandlerTest.java index 53cc95fc9027..f43633cc98af 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/StateHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/StateHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendCheckUpdatesHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendCheckUpdatesHandlerTest.java similarity index 98% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendCheckUpdatesHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendCheckUpdatesHandlerTest.java index 78ac5ee79b56..4c9e51f910cc 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendCheckUpdatesHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendCheckUpdatesHandlerTest.java @@ -2,17 +2,17 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import io.airbyte.api.model.generated.WebBackendCheckUpdatesRead; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.config.StandardDestinationDefinition; import io.airbyte.config.StandardSourceDefinition; import io.airbyte.config.persistence.ConfigRepository; -import io.airbyte.server.services.AirbyteGithubStore; import java.io.IOException; import java.util.List; import java.util.Map; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendConnectionsHandlerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendConnectionsHandlerTest.java index abf564dee15a..fb7542947130 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendConnectionsHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendConnectionsHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -75,6 +75,13 @@ import io.airbyte.api.model.generated.WebBackendWorkspaceState; import io.airbyte.commons.enums.Enums; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.handlers.helpers.CatalogConverter; +import io.airbyte.commons.server.helpers.ConnectionHelpers; +import io.airbyte.commons.server.helpers.DestinationDefinitionHelpers; +import io.airbyte.commons.server.helpers.DestinationHelpers; +import io.airbyte.commons.server.helpers.SourceDefinitionHelpers; +import io.airbyte.commons.server.helpers.SourceHelpers; +import io.airbyte.commons.server.scheduler.EventRunner; import io.airbyte.commons.temporal.TemporalClient.ManualOperationResult; import io.airbyte.config.ActorCatalog; import io.airbyte.config.ActorCatalogFetchEvent; @@ -93,13 +100,6 @@ import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; -import io.airbyte.server.handlers.helpers.CatalogConverter; -import io.airbyte.server.helpers.ConnectionHelpers; -import io.airbyte.server.helpers.DestinationDefinitionHelpers; -import io.airbyte.server.helpers.DestinationHelpers; -import io.airbyte.server.helpers.SourceDefinitionHelpers; -import io.airbyte.server.helpers.SourceHelpers; -import io.airbyte.server.scheduler.EventRunner; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; import java.lang.reflect.Method; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendGeographiesHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendGeographiesHandlerTest.java similarity index 96% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendGeographiesHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendGeographiesHandlerTest.java index e4f014aa3c1d..f0c14e2e69ff 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/WebBackendGeographiesHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WebBackendGeographiesHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import io.airbyte.api.model.generated.Geography; import io.airbyte.api.model.generated.WebBackendGeographiesListResult; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/WorkspacesHandlerTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WorkspacesHandlerTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/WorkspacesHandlerTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WorkspacesHandlerTest.java index 4e604e12855d..c3c6a9441938 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/WorkspacesHandlerTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/WorkspacesHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers; +package io.airbyte.commons.server.handlers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -34,6 +34,7 @@ import io.airbyte.api.model.generated.WorkspaceUpdate; import io.airbyte.api.model.generated.WorkspaceUpdateName; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.converters.NotificationConverter; import io.airbyte.config.Geography; import io.airbyte.config.Notification; import io.airbyte.config.Notification.NotificationType; @@ -43,7 +44,6 @@ import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.config.persistence.SecretsRepositoryWriter; import io.airbyte.config.persistence.split_secrets.SecretPersistence; -import io.airbyte.server.converters.NotificationConverter; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; import java.util.Collections; diff --git a/airbyte-server/src/test/java/io/airbyte/server/handlers/helper/OAuthPathExtractorTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/helper/OAuthPathExtractorTest.java similarity index 93% rename from airbyte-server/src/test/java/io/airbyte/server/handlers/helper/OAuthPathExtractorTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/helper/OAuthPathExtractorTest.java index e7c7d95f8308..5a45c37b2af5 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/handlers/helper/OAuthPathExtractorTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/handlers/helper/OAuthPathExtractorTest.java @@ -2,11 +2,11 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.handlers.helper; +package io.airbyte.commons.server.handlers.helper; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.commons.json.Jsons; -import io.airbyte.server.handlers.helpers.OAuthPathExtractor; +import io.airbyte.commons.server.handlers.helpers.OAuthPathExtractor; import java.util.List; import java.util.Map; import org.assertj.core.api.Assertions; diff --git a/airbyte-server/src/test/java/io/airbyte/server/helpers/ConnectionHelpers.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/ConnectionHelpers.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/helpers/ConnectionHelpers.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/ConnectionHelpers.java index 00afd4ff6a80..300079b72964 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/helpers/ConnectionHelpers.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/ConnectionHelpers.java @@ -2,9 +2,9 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.helpers; +package io.airbyte.commons.server.helpers; -import static io.airbyte.server.handlers.helpers.CatalogConverter.toApi; +import static io.airbyte.commons.server.handlers.helpers.CatalogConverter.toApi; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.Lists; @@ -30,6 +30,7 @@ import io.airbyte.api.model.generated.SyncMode; import io.airbyte.api.model.generated.WebBackendConnectionListItem; import io.airbyte.commons.enums.Enums; +import io.airbyte.commons.server.converters.ApiPojoConverters; import io.airbyte.commons.text.Names; import io.airbyte.config.BasicSchedule; import io.airbyte.config.JobSyncConfig.NamespaceDefinitionType; @@ -45,7 +46,6 @@ import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; import io.airbyte.protocol.models.StreamDescriptor; -import io.airbyte.server.converters.ApiPojoConverters; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/airbyte-server/src/test/java/io/airbyte/server/helpers/ConnectorSpecificationHelpers.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/ConnectorSpecificationHelpers.java similarity index 82% rename from airbyte-server/src/test/java/io/airbyte/server/helpers/ConnectorSpecificationHelpers.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/ConnectorSpecificationHelpers.java index dd843b96cbdb..50ac208ba8dd 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/helpers/ConnectorSpecificationHelpers.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/ConnectorSpecificationHelpers.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.helpers; +package io.airbyte.commons.server.helpers; import io.airbyte.commons.json.Jsons; import io.airbyte.protocol.models.ConnectorSpecification; @@ -17,7 +17,7 @@ public class ConnectorSpecificationHelpers { public static ConnectorSpecification generateConnectorSpecification() throws IOException { - final Path path = Paths.get("../airbyte-server/src/test/resources/json/TestSpecification.json"); + final Path path = Paths.get(ConnectorSpecificationHelpers.class.getClassLoader().getResource("json/TestSpecification.json").getPath()); try { return new ConnectorSpecification() diff --git a/airbyte-server/src/test/java/io/airbyte/server/helpers/DestinationDefinitionHelpers.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/DestinationDefinitionHelpers.java similarity index 92% rename from airbyte-server/src/test/java/io/airbyte/server/helpers/DestinationDefinitionHelpers.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/DestinationDefinitionHelpers.java index 24ee7a0d452c..b1c776a17d7e 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/helpers/DestinationDefinitionHelpers.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/DestinationDefinitionHelpers.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.helpers; +package io.airbyte.commons.server.helpers; import io.airbyte.config.StandardDestinationDefinition; import java.util.UUID; diff --git a/airbyte-server/src/test/java/io/airbyte/server/helpers/DestinationHelpers.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/DestinationHelpers.java similarity index 92% rename from airbyte-server/src/test/java/io/airbyte/server/helpers/DestinationHelpers.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/DestinationHelpers.java index a3eb07edee60..74bb05dca4f2 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/helpers/DestinationHelpers.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/DestinationHelpers.java @@ -2,14 +2,14 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.helpers; +package io.airbyte.commons.server.helpers; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.api.model.generated.DestinationRead; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.handlers.DestinationDefinitionsHandler; import io.airbyte.config.DestinationConnection; import io.airbyte.config.StandardDestinationDefinition; -import io.airbyte.server.handlers.DestinationDefinitionsHandler; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -20,7 +20,7 @@ public class DestinationHelpers { public static JsonNode getTestDestinationJson() throws IOException { final Path path = - Paths.get("../airbyte-server/src/test/resources/json/TestImplementation.json"); + Paths.get(DestinationHelpers.class.getClassLoader().getResource("json/TestImplementation.json").getPath()); return Jsons.deserialize(Files.readString(path)); } diff --git a/airbyte-server/src/test/java/io/airbyte/server/helpers/SourceDefinitionHelpers.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/SourceDefinitionHelpers.java similarity index 92% rename from airbyte-server/src/test/java/io/airbyte/server/helpers/SourceDefinitionHelpers.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/SourceDefinitionHelpers.java index 1c592baa4295..fd5a0bb8d26c 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/helpers/SourceDefinitionHelpers.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/SourceDefinitionHelpers.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.helpers; +package io.airbyte.commons.server.helpers; import io.airbyte.config.StandardSourceDefinition; import java.util.UUID; diff --git a/airbyte-server/src/test/java/io/airbyte/server/helpers/SourceHelpers.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/SourceHelpers.java similarity index 90% rename from airbyte-server/src/test/java/io/airbyte/server/helpers/SourceHelpers.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/SourceHelpers.java index 975256c751a7..1b1604973bdb 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/helpers/SourceHelpers.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/helpers/SourceHelpers.java @@ -2,14 +2,14 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.helpers; +package io.airbyte.commons.server.helpers; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.api.model.generated.SourceRead; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.handlers.SourceDefinitionsHandler; import io.airbyte.config.SourceConnection; import io.airbyte.config.StandardSourceDefinition; -import io.airbyte.server.handlers.SourceDefinitionsHandler; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -46,7 +46,7 @@ public static SourceConnection generateSource(final UUID sourceDefinitionId, fin } public static JsonNode getTestImplementationJson() throws IOException { - final Path path = Paths.get("../airbyte-server/src/test/resources/json/TestImplementation.json"); + final Path path = Paths.get(SourceHelpers.class.getClassLoader().getResource("json/TestImplementation.json").getPath()); return Jsons.deserialize(Files.readString(path)); } diff --git a/airbyte-server/src/test/java/io/airbyte/server/scheduler/DefaultSynchronousSchedulerClientTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/scheduler/DefaultSynchronousSchedulerClientTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/scheduler/DefaultSynchronousSchedulerClientTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/scheduler/DefaultSynchronousSchedulerClientTest.java index 9cc3761c224c..bd9bbdc92764 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/scheduler/DefaultSynchronousSchedulerClientTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/scheduler/DefaultSynchronousSchedulerClientTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.scheduler; +package io.airbyte.commons.server.scheduler; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/airbyte-server/src/test/java/io/airbyte/server/services/AirbyteGithubStoreTest.java b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/services/AirbyteGithubStoreTest.java similarity index 99% rename from airbyte-server/src/test/java/io/airbyte/server/services/AirbyteGithubStoreTest.java rename to airbyte-commons-server/src/test/java/io/airbyte/commons/server/services/AirbyteGithubStoreTest.java index 6f483ffdbdfe..80dfff70b701 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/services/AirbyteGithubStoreTest.java +++ b/airbyte-commons-server/src/test/java/io/airbyte/commons/server/services/AirbyteGithubStoreTest.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.server.services; +package io.airbyte.commons.server.services; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/airbyte-server/src/test/resources/icons/test-destination.svg b/airbyte-commons-server/src/test/resources/icons/test-destination.svg similarity index 100% rename from airbyte-server/src/test/resources/icons/test-destination.svg rename to airbyte-commons-server/src/test/resources/icons/test-destination.svg diff --git a/airbyte-server/src/test/resources/icons/test-source.svg b/airbyte-commons-server/src/test/resources/icons/test-source.svg similarity index 100% rename from airbyte-server/src/test/resources/icons/test-source.svg rename to airbyte-commons-server/src/test/resources/icons/test-source.svg diff --git a/airbyte-server/src/test/resources/json/TestImplementation.json b/airbyte-commons-server/src/test/resources/json/TestImplementation.json similarity index 100% rename from airbyte-server/src/test/resources/json/TestImplementation.json rename to airbyte-commons-server/src/test/resources/json/TestImplementation.json diff --git a/airbyte-server/src/test/resources/json/TestSpecification.json b/airbyte-commons-server/src/test/resources/json/TestSpecification.json similarity index 100% rename from airbyte-server/src/test/resources/json/TestSpecification.json rename to airbyte-commons-server/src/test/resources/json/TestSpecification.json diff --git a/airbyte-server/src/test/resources/migration/03a4c904-c91d-447f-ab59-27a43b52c2fd.gz b/airbyte-commons-server/src/test/resources/migration/03a4c904-c91d-447f-ab59-27a43b52c2fd.gz similarity index 100% rename from airbyte-server/src/test/resources/migration/03a4c904-c91d-447f-ab59-27a43b52c2fd.gz rename to airbyte-commons-server/src/test/resources/migration/03a4c904-c91d-447f-ab59-27a43b52c2fd.gz diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/4e00862d-5484-4f50-9860-f3bbb4317397.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/4e00862d-5484-4f50-9860-f3bbb4317397.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/4e00862d-5484-4f50-9860-f3bbb4317397.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/4e00862d-5484-4f50-9860-f3bbb4317397.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/5434615d-a3b7-4351-bc6b-a9a695555a30.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/5434615d-a3b7-4351-bc6b-a9a695555a30.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/5434615d-a3b7-4351-bc6b-a9a695555a30.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/DESTINATION_CONNECTION/5434615d-a3b7-4351-bc6b-a9a695555a30.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/28ffee2b-372a-4f72-9b95-8ed56a8b99c5.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/28ffee2b-372a-4f72-9b95-8ed56a8b99c5.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/28ffee2b-372a-4f72-9b95-8ed56a8b99c5.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/28ffee2b-372a-4f72-9b95-8ed56a8b99c5.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/e48cae1a-1f5c-42cc-9ec1-a44ff7fb4969.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/e48cae1a-1f5c-42cc-9ec1-a44ff7fb4969.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/e48cae1a-1f5c-42cc-9ec1-a44ff7fb4969.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/SOURCE_CONNECTION/e48cae1a-1f5c-42cc-9ec1-a44ff7fb4969.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/22f6c74f-5699-40ff-833c-4a879ea40133.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/22f6c74f-5699-40ff-833c-4a879ea40133.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/22f6c74f-5699-40ff-833c-4a879ea40133.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/22f6c74f-5699-40ff-833c-4a879ea40133.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/25c5221d-dce2-4163-ade9-739ef790f503.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/25c5221d-dce2-4163-ade9-739ef790f503.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/25c5221d-dce2-4163-ade9-739ef790f503.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/25c5221d-dce2-4163-ade9-739ef790f503.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/424892c4-daac-4491-b35d-c6688ba547ba.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/424892c4-daac-4491-b35d-c6688ba547ba.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/424892c4-daac-4491-b35d-c6688ba547ba.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/424892c4-daac-4491-b35d-c6688ba547ba.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/8be1cf83-fde1-477f-a4ad-318d23c9f3c6.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/8be1cf83-fde1-477f-a4ad-318d23c9f3c6.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/8be1cf83-fde1-477f-a4ad-318d23c9f3c6.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/8be1cf83-fde1-477f-a4ad-318d23c9f3c6.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/a625d593-bba5-4a1c-a53d-2d246268a816.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/a625d593-bba5-4a1c-a53d-2d246268a816.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/a625d593-bba5-4a1c-a53d-2d246268a816.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/a625d593-bba5-4a1c-a53d-2d246268a816.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/af7c921e-5892-4ff2-b6c1-4a5ab258fb7e.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/af7c921e-5892-4ff2-b6c1-4a5ab258fb7e.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/af7c921e-5892-4ff2-b6c1-4a5ab258fb7e.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/af7c921e-5892-4ff2-b6c1-4a5ab258fb7e.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/f7a7d195-377f-cf5b-70a5-be6b819019dc.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/f7a7d195-377f-cf5b-70a5-be6b819019dc.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/f7a7d195-377f-cf5b-70a5-be6b819019dc.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_DESTINATION_DEFINITION/f7a7d195-377f-cf5b-70a5-be6b819019dc.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/00405b19-9768-4e0c-b1ae-9fc2ee2b2a8c.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/00405b19-9768-4e0c-b1ae-9fc2ee2b2a8c.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/00405b19-9768-4e0c-b1ae-9fc2ee2b2a8c.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/00405b19-9768-4e0c-b1ae-9fc2ee2b2a8c.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2470e835-feaf-4db6-96f3-70fd645acc77.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2470e835-feaf-4db6-96f3-70fd645acc77.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2470e835-feaf-4db6-96f3-70fd645acc77.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2470e835-feaf-4db6-96f3-70fd645acc77.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2af123bf-0aaf-4e0d-9784-cb497f23741a.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2af123bf-0aaf-4e0d-9784-cb497f23741a.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2af123bf-0aaf-4e0d-9784-cb497f23741a.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/2af123bf-0aaf-4e0d-9784-cb497f23741a.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/396e4ca3-8a97-4b85-aa4e-c9d8c2d5f992.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/396e4ca3-8a97-4b85-aa4e-c9d8c2d5f992.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/396e4ca3-8a97-4b85-aa4e-c9d8c2d5f992.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/396e4ca3-8a97-4b85-aa4e-c9d8c2d5f992.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/435bb9a5-7887-4809-aa58-28c27df0d7ad.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/435bb9a5-7887-4809-aa58-28c27df0d7ad.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/435bb9a5-7887-4809-aa58-28c27df0d7ad.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/435bb9a5-7887-4809-aa58-28c27df0d7ad.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/445831eb-78db-4b1f-8f1f-0d96ad8739e2.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/445831eb-78db-4b1f-8f1f-0d96ad8739e2.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/445831eb-78db-4b1f-8f1f-0d96ad8739e2.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/445831eb-78db-4b1f-8f1f-0d96ad8739e2.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/4eb22946-2a79-4d20-a3e6-effd234613c3.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/4eb22946-2a79-4d20-a3e6-effd234613c3.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/4eb22946-2a79-4d20-a3e6-effd234613c3.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/4eb22946-2a79-4d20-a3e6-effd234613c3.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/57eb1576-8f52-463d-beb6-2e107cdf571d.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/57eb1576-8f52-463d-beb6-2e107cdf571d.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/57eb1576-8f52-463d-beb6-2e107cdf571d.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/57eb1576-8f52-463d-beb6-2e107cdf571d.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/68e63de2-bb83-4c7e-93fa-a8a9051e3993.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/68e63de2-bb83-4c7e-93fa-a8a9051e3993.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/68e63de2-bb83-4c7e-93fa-a8a9051e3993.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/68e63de2-bb83-4c7e-93fa-a8a9051e3993.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/71607ba1-c0ac-4799-8049-7f4b90dd50f7.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/71607ba1-c0ac-4799-8049-7f4b90dd50f7.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/71607ba1-c0ac-4799-8049-7f4b90dd50f7.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/71607ba1-c0ac-4799-8049-7f4b90dd50f7.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/778daa7c-feaf-4db6-96f3-70fd645acc77.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/778daa7c-feaf-4db6-96f3-70fd645acc77.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/778daa7c-feaf-4db6-96f3-70fd645acc77.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/778daa7c-feaf-4db6-96f3-70fd645acc77.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/859e501d-2b67-471f-91bb-1c801414d28f.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/859e501d-2b67-471f-91bb-1c801414d28f.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/859e501d-2b67-471f-91bb-1c801414d28f.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/859e501d-2b67-471f-91bb-1c801414d28f.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9e0556f4-69df-4522-a3fb-03264d36b348.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9e0556f4-69df-4522-a3fb-03264d36b348.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9e0556f4-69df-4522-a3fb-03264d36b348.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9e0556f4-69df-4522-a3fb-03264d36b348.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9fed261d-d107-47fd-8c8b-323023db6e20.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9fed261d-d107-47fd-8c8b-323023db6e20.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9fed261d-d107-47fd-8c8b-323023db6e20.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/9fed261d-d107-47fd-8c8b-323023db6e20.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/aea2fd0d-377d-465e-86c0-4fdc4f688e51.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/aea2fd0d-377d-465e-86c0-4fdc4f688e51.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/aea2fd0d-377d-465e-86c0-4fdc4f688e51.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/aea2fd0d-377d-465e-86c0-4fdc4f688e51.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b1892b11-788d-44bd-b9ec-3a436f7b54ce.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b1892b11-788d-44bd-b9ec-3a436f7b54ce.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b1892b11-788d-44bd-b9ec-3a436f7b54ce.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b1892b11-788d-44bd-b9ec-3a436f7b54ce.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b5ea17b1-f170-46dc-bc31-cc744ca984c1.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b5ea17b1-f170-46dc-bc31-cc744ca984c1.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b5ea17b1-f170-46dc-bc31-cc744ca984c1.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/b5ea17b1-f170-46dc-bc31-cc744ca984c1.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/cd42861b-01fc-4658-a8ab-5d11d0510f01.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/cd42861b-01fc-4658-a8ab-5d11d0510f01.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/cd42861b-01fc-4658-a8ab-5d11d0510f01.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/cd42861b-01fc-4658-a8ab-5d11d0510f01.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d2147be5-fa36-4936-977e-f031affa5895.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d2147be5-fa36-4936-977e-f031affa5895.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d2147be5-fa36-4936-977e-f031affa5895.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d2147be5-fa36-4936-977e-f031affa5895.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d29764f8-80d7-4dd7-acbe-1a42005ee5aa.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d29764f8-80d7-4dd7-acbe-1a42005ee5aa.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d29764f8-80d7-4dd7-acbe-1a42005ee5aa.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d29764f8-80d7-4dd7-acbe-1a42005ee5aa.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d8313939-3782-41b0-be29-b3ca20d8dd3a.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d8313939-3782-41b0-be29-b3ca20d8dd3a.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d8313939-3782-41b0-be29-b3ca20d8dd3a.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/d8313939-3782-41b0-be29-b3ca20d8dd3a.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e094cb9a-26de-4645-8761-65c0c425d1de.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e094cb9a-26de-4645-8761-65c0c425d1de.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e094cb9a-26de-4645-8761-65c0c425d1de.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e094cb9a-26de-4645-8761-65c0c425d1de.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e7778cfc-e97c-4458-9ecb-b4f2bba8946c.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e7778cfc-e97c-4458-9ecb-b4f2bba8946c.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e7778cfc-e97c-4458-9ecb-b4f2bba8946c.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e7778cfc-e97c-4458-9ecb-b4f2bba8946c.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e87ffa8e-a3b5-f69c-9076-6011339de1f6.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e87ffa8e-a3b5-f69c-9076-6011339de1f6.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e87ffa8e-a3b5-f69c-9076-6011339de1f6.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/e87ffa8e-a3b5-f69c-9076-6011339de1f6.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/eaf50f04-21dd-4620-913b-2a83f5635227.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/eaf50f04-21dd-4620-913b-2a83f5635227.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/eaf50f04-21dd-4620-913b-2a83f5635227.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/eaf50f04-21dd-4620-913b-2a83f5635227.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ec4b9503-13cb-48ab-a4ab-6ade4be46567.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ec4b9503-13cb-48ab-a4ab-6ade4be46567.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ec4b9503-13cb-48ab-a4ab-6ade4be46567.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ec4b9503-13cb-48ab-a4ab-6ade4be46567.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ed799e2b-2158-4c66-8da4-b40fe63bc72a.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ed799e2b-2158-4c66-8da4-b40fe63bc72a.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ed799e2b-2158-4c66-8da4-b40fe63bc72a.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ed799e2b-2158-4c66-8da4-b40fe63bc72a.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ef69ef6e-aa7f-4af1-a01d-ef775033524e.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ef69ef6e-aa7f-4af1-a01d-ef775033524e.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ef69ef6e-aa7f-4af1-a01d-ef775033524e.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/ef69ef6e-aa7f-4af1-a01d-ef775033524e.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SOURCE_DEFINITION/fbb5fbe2-16ad-4cf4-af7d-ff9d9c316c87.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/a294256f-1abe-4837-925f-91602c7207b4.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/a294256f-1abe-4837-925f-91602c7207b4.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/a294256f-1abe-4837-925f-91602c7207b4.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC/a294256f-1abe-4837-925f-91602c7207b4.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/49dae3f0-158b-4737-b6e4-0eed77d4b74e.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/a294256f-1abe-4837-925f-91602c7207b4.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/a294256f-1abe-4837-925f-91602c7207b4.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/a294256f-1abe-4837-925f-91602c7207b4.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_SYNC_SCHEDULE/a294256f-1abe-4837-925f-91602c7207b4.json diff --git a/airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_WORKSPACE/5ae6b09b-fdec-41af-aaf7-7d94cfc33ef6.json b/airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_WORKSPACE/5ae6b09b-fdec-41af-aaf7-7d94cfc33ef6.json similarity index 100% rename from airbyte-server/src/test/resources/migration/dummy_data/config/STANDARD_WORKSPACE/5ae6b09b-fdec-41af-aaf7-7d94cfc33ef6.json rename to airbyte-commons-server/src/test/resources/migration/dummy_data/config/STANDARD_WORKSPACE/5ae6b09b-fdec-41af-aaf7-7d94cfc33ef6.json diff --git a/airbyte-server/src/test/resources/migration/schema.sql b/airbyte-commons-server/src/test/resources/migration/schema.sql similarity index 100% rename from airbyte-server/src/test/resources/migration/schema.sql rename to airbyte-commons-server/src/test/resources/migration/schema.sql diff --git a/airbyte-server/build.gradle b/airbyte-server/build.gradle index 19d391456bcd..c75ccaf1add0 100644 --- a/airbyte-server/build.gradle +++ b/airbyte-server/build.gradle @@ -35,6 +35,7 @@ dependencies { implementation project(':airbyte-api') implementation project(':airbyte-commons-docker') implementation project(':airbyte-commons-temporal') + implementation project(':airbyte-commons-server') implementation project(':airbyte-commons-worker') implementation project(':airbyte-config:init') implementation project(':airbyte-config:config-models') diff --git a/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java b/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java index 16f3405d07e5..30e11d97c09c 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java +++ b/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java @@ -10,6 +10,13 @@ import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.features.FeatureFlags; import io.airbyte.commons.resources.MoreResources; +import io.airbyte.commons.server.RequestLogger; +import io.airbyte.commons.server.errors.*; +import io.airbyte.commons.server.handlers.*; +import io.airbyte.commons.server.scheduler.DefaultSynchronousSchedulerClient; +import io.airbyte.commons.server.scheduler.EventRunner; +import io.airbyte.commons.server.scheduler.TemporalEventRunner; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.commons.temporal.ConnectionManagerUtils; import io.airbyte.commons.temporal.StreamResetRecordsHelper; import io.airbyte.commons.temporal.TemporalClient; @@ -38,12 +45,6 @@ import io.airbyte.persistence.job.errorreporter.JobErrorReportingClientFactory; import io.airbyte.persistence.job.factory.OAuthConfigSupplier; import io.airbyte.persistence.job.tracker.JobTracker; -import io.airbyte.server.errors.*; -import io.airbyte.server.handlers.*; -import io.airbyte.server.scheduler.DefaultSynchronousSchedulerClient; -import io.airbyte.server.scheduler.EventRunner; -import io.airbyte.server.scheduler.TemporalEventRunner; -import io.airbyte.server.services.AirbyteGithubStore; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.workers.helper.ConnectionHelper; import io.temporal.serviceclient.WorkflowServiceStubs; diff --git a/airbyte-server/src/main/java/io/airbyte/server/ServerFactory.java b/airbyte-server/src/main/java/io/airbyte/server/ServerFactory.java index 4fb830771906..2ceb52bd9e4d 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/ServerFactory.java +++ b/airbyte-server/src/main/java/io/airbyte/server/ServerFactory.java @@ -5,6 +5,9 @@ package io.airbyte.server; import io.airbyte.analytics.TrackingClient; +import io.airbyte.commons.server.handlers.*; +import io.airbyte.commons.server.scheduler.EventRunner; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; import io.airbyte.commons.version.AirbyteVersion; import io.airbyte.config.Configs.WorkerEnvironment; import io.airbyte.config.helpers.LogConfigs; @@ -13,9 +16,6 @@ import io.airbyte.config.persistence.SecretsRepositoryWriter; import io.airbyte.db.Database; import io.airbyte.persistence.job.JobPersistence; -import io.airbyte.server.handlers.*; -import io.airbyte.server.scheduler.EventRunner; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; import java.net.http.HttpClient; import java.nio.file.Path; import java.util.HashSet; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/ApiHelper.java b/airbyte-server/src/main/java/io/airbyte/server/apis/ApiHelper.java index b24eda21e754..63541a77b34c 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/ApiHelper.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/ApiHelper.java @@ -4,9 +4,9 @@ package io.airbyte.server.apis; +import io.airbyte.commons.server.errors.BadObjectSchemaKnownException; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; import io.airbyte.config.persistence.ConfigNotFoundException; -import io.airbyte.server.errors.BadObjectSchemaKnownException; -import io.airbyte.server.errors.IdNotFoundKnownException; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; import org.slf4j.LoggerFactory; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/AttemptApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/AttemptApiController.java index c7c112405b44..64e8c4730d8f 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/AttemptApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/AttemptApiController.java @@ -10,7 +10,7 @@ import io.airbyte.api.model.generated.InternalOperationResult; import io.airbyte.api.model.generated.SaveStatsRequestBody; import io.airbyte.api.model.generated.SetWorkflowInAttemptRequestBody; -import io.airbyte.server.handlers.AttemptHandler; +import io.airbyte.commons.server.handlers.AttemptHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.MediaType; import io.micronaut.http.annotation.Body; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/ConnectionApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/ConnectionApiController.java index aca38ca5ccec..094acc9416e3 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/ConnectionApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/ConnectionApiController.java @@ -16,9 +16,9 @@ import io.airbyte.api.model.generated.ConnectionUpdate; import io.airbyte.api.model.generated.JobInfoRead; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; -import io.airbyte.server.handlers.ConnectionsHandler; -import io.airbyte.server.handlers.OperationsHandler; -import io.airbyte.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.ConnectionsHandler; +import io.airbyte.commons.server.handlers.OperationsHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; import io.micronaut.context.annotation.Context; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationApiController.java index 0c1d5f074faa..0b3c16ea8424 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationApiController.java @@ -17,8 +17,8 @@ import io.airbyte.api.model.generated.DestinationSearch; import io.airbyte.api.model.generated.DestinationUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; -import io.airbyte.server.handlers.DestinationHandler; -import io.airbyte.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.DestinationHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; import io.micronaut.http.annotation.Body; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionApiController.java index e3796c033c32..6fe120b689f6 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionApiController.java @@ -19,7 +19,7 @@ import io.airbyte.api.model.generated.PrivateDestinationDefinitionRead; import io.airbyte.api.model.generated.PrivateDestinationDefinitionReadList; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; -import io.airbyte.server.handlers.DestinationDefinitionsHandler; +import io.airbyte.commons.server.handlers.DestinationDefinitionsHandler; import io.micronaut.context.annotation.Context; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionSpecificationApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionSpecificationApiController.java index d93bc6dcbe99..a6c013df9542 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionSpecificationApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationDefinitionSpecificationApiController.java @@ -9,7 +9,7 @@ import io.airbyte.api.generated.DestinationDefinitionSpecificationApi; import io.airbyte.api.model.generated.DestinationDefinitionIdWithWorkspaceId; import io.airbyte.api.model.generated.DestinationDefinitionSpecificationRead; -import io.airbyte.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Post; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationOauthApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationOauthApiController.java index 58286dfacd48..3d508935a4bd 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationOauthApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/DestinationOauthApiController.java @@ -12,7 +12,7 @@ import io.airbyte.api.model.generated.DestinationOauthConsentRequest; import io.airbyte.api.model.generated.OAuthConsentRead; import io.airbyte.api.model.generated.SetInstancewideDestinationOauthParamsRequestBody; -import io.airbyte.server.handlers.OAuthHandler; +import io.airbyte.commons.server.handlers.OAuthHandler; import io.micronaut.context.annotation.Context; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/HealthApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/HealthApiController.java index 3ffb6851cbc5..de386a536775 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/HealthApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/HealthApiController.java @@ -6,7 +6,7 @@ import io.airbyte.api.generated.HealthApi; import io.airbyte.api.model.generated.HealthCheckRead; -import io.airbyte.server.handlers.HealthCheckHandler; +import io.airbyte.commons.server.handlers.HealthCheckHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.MediaType; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/JobsApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/JobsApiController.java index b930472e5d23..8ca1195c92f4 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/JobsApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/JobsApiController.java @@ -18,8 +18,8 @@ import io.airbyte.api.model.generated.JobListRequestBody; import io.airbyte.api.model.generated.JobOptionalRead; import io.airbyte.api.model.generated.JobReadList; -import io.airbyte.server.handlers.JobHistoryHandler; -import io.airbyte.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.JobHistoryHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; import io.micronaut.context.annotation.Context; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/LogsApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/LogsApiController.java index 13257412cf04..e98749577545 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/LogsApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/LogsApiController.java @@ -8,7 +8,7 @@ import io.airbyte.api.generated.LogsApi; import io.airbyte.api.model.generated.LogsRequestBody; -import io.airbyte.server.handlers.LogsHandler; +import io.airbyte.commons.server.handlers.LogsHandler; import io.micronaut.context.annotation.Context; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/NotificationsApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/NotificationsApiController.java index c81799b9ac92..e2cf648e3398 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/NotificationsApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/NotificationsApiController.java @@ -9,7 +9,7 @@ import io.airbyte.api.generated.NotificationsApi; import io.airbyte.api.model.generated.Notification; import io.airbyte.api.model.generated.NotificationRead; -import io.airbyte.server.handlers.WorkspacesHandler; +import io.airbyte.commons.server.handlers.WorkspacesHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Body; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/OpenapiApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/OpenapiApiController.java index 5e574a23deb9..0f1754d01492 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/OpenapiApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/OpenapiApiController.java @@ -7,7 +7,7 @@ import static io.airbyte.commons.auth.AuthRoleConstants.AUTHENTICATED_USER; import io.airbyte.api.generated.OpenapiApi; -import io.airbyte.server.handlers.OpenApiConfigHandler; +import io.airbyte.commons.server.handlers.OpenApiConfigHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/OperationApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/OperationApiController.java index 64ac3c337f51..73e19c184805 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/OperationApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/OperationApiController.java @@ -17,7 +17,7 @@ import io.airbyte.api.model.generated.OperationReadList; import io.airbyte.api.model.generated.OperationUpdate; import io.airbyte.api.model.generated.OperatorConfiguration; -import io.airbyte.server.handlers.OperationsHandler; +import io.airbyte.commons.server.handlers.OperationsHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; import io.micronaut.http.annotation.Body; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/SchedulerApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/SchedulerApiController.java index 365dc04afc46..4799406c8a42 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/SchedulerApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/SchedulerApiController.java @@ -12,7 +12,7 @@ import io.airbyte.api.model.generated.DestinationCoreConfig; import io.airbyte.api.model.generated.SourceCoreConfig; import io.airbyte.api.model.generated.SourceDiscoverSchemaRead; -import io.airbyte.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Post; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceApiController.java index d7946484d8ee..12efa7702316 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceApiController.java @@ -22,8 +22,8 @@ import io.airbyte.api.model.generated.SourceSearch; import io.airbyte.api.model.generated.SourceUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; -import io.airbyte.server.handlers.SchedulerHandler; -import io.airbyte.server.handlers.SourceHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.SourceHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionApiController.java index 1dac7ca5b708..ef7004105e5b 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionApiController.java @@ -19,7 +19,7 @@ import io.airbyte.api.model.generated.SourceDefinitionReadList; import io.airbyte.api.model.generated.SourceDefinitionUpdate; import io.airbyte.api.model.generated.WorkspaceIdRequestBody; -import io.airbyte.server.handlers.SourceDefinitionsHandler; +import io.airbyte.commons.server.handlers.SourceDefinitionsHandler; import io.micronaut.context.annotation.Context; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionSpecificationApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionSpecificationApiController.java index e87b5c28bddc..2e094bc3f705 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionSpecificationApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceDefinitionSpecificationApiController.java @@ -9,7 +9,7 @@ import io.airbyte.api.generated.SourceDefinitionSpecificationApi; import io.airbyte.api.model.generated.SourceDefinitionIdWithWorkspaceId; import io.airbyte.api.model.generated.SourceDefinitionSpecificationRead; -import io.airbyte.server.handlers.SchedulerHandler; +import io.airbyte.commons.server.handlers.SchedulerHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Post; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceOauthApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceOauthApiController.java index 52cbc82beb97..785c41519bf5 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/SourceOauthApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/SourceOauthApiController.java @@ -12,7 +12,7 @@ import io.airbyte.api.model.generated.OAuthConsentRead; import io.airbyte.api.model.generated.SetInstancewideSourceOauthParamsRequestBody; import io.airbyte.api.model.generated.SourceOauthConsentRequest; -import io.airbyte.server.handlers.OAuthHandler; +import io.airbyte.commons.server.handlers.OAuthHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Body; import io.micronaut.http.annotation.Controller; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/StateApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/StateApiController.java index 870a499d5999..02b1941e5bd8 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/StateApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/StateApiController.java @@ -11,7 +11,7 @@ import io.airbyte.api.model.generated.ConnectionIdRequestBody; import io.airbyte.api.model.generated.ConnectionState; import io.airbyte.api.model.generated.ConnectionStateCreateOrUpdate; -import io.airbyte.server.handlers.StateHandler; +import io.airbyte.commons.server.handlers.StateHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Post; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/WebBackendApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/WebBackendApiController.java index af8c5a3ad316..b5c515e37f93 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/WebBackendApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/WebBackendApiController.java @@ -21,9 +21,9 @@ import io.airbyte.api.model.generated.WebBackendGeographiesListResult; import io.airbyte.api.model.generated.WebBackendWorkspaceState; import io.airbyte.api.model.generated.WebBackendWorkspaceStateResult; -import io.airbyte.server.handlers.WebBackendCheckUpdatesHandler; -import io.airbyte.server.handlers.WebBackendConnectionsHandler; -import io.airbyte.server.handlers.WebBackendGeographiesHandler; +import io.airbyte.commons.server.handlers.WebBackendCheckUpdatesHandler; +import io.airbyte.commons.server.handlers.WebBackendConnectionsHandler; +import io.airbyte.commons.server.handlers.WebBackendGeographiesHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Post; diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/WorkspaceApiController.java b/airbyte-server/src/main/java/io/airbyte/server/apis/WorkspaceApiController.java index c270ce286ccf..5bc66adb7ffd 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/WorkspaceApiController.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/WorkspaceApiController.java @@ -17,7 +17,7 @@ import io.airbyte.api.model.generated.WorkspaceReadList; import io.airbyte.api.model.generated.WorkspaceUpdate; import io.airbyte.api.model.generated.WorkspaceUpdateName; -import io.airbyte.server.handlers.WorkspacesHandler; +import io.airbyte.commons.server.handlers.WorkspacesHandler; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpStatus; import io.micronaut.http.annotation.Body; diff --git a/airbyte-server/src/main/java/io/airbyte/server/config/ApplicationBeanFactory.java b/airbyte-server/src/main/java/io/airbyte/server/config/ApplicationBeanFactory.java index 13111f657156..e21046c46c68 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/config/ApplicationBeanFactory.java +++ b/airbyte-server/src/main/java/io/airbyte/server/config/ApplicationBeanFactory.java @@ -7,6 +7,9 @@ import io.airbyte.analytics.TrackingClient; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.features.FeatureFlags; +import io.airbyte.commons.server.scheduler.EventRunner; +import io.airbyte.commons.server.scheduler.TemporalEventRunner; +import io.airbyte.commons.server.services.AirbyteGithubStore; import io.airbyte.commons.temporal.TemporalClient; import io.airbyte.commons.version.AirbyteProtocolVersionRange; import io.airbyte.commons.version.AirbyteVersion; @@ -18,9 +21,6 @@ import io.airbyte.persistence.job.JobPersistence; import io.airbyte.persistence.job.WebUrlHelper; import io.airbyte.persistence.job.tracker.JobTracker; -import io.airbyte.server.scheduler.EventRunner; -import io.airbyte.server.scheduler.TemporalEventRunner; -import io.airbyte.server.services.AirbyteGithubStore; import io.airbyte.validation.json.JsonSchemaValidator; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Value; diff --git a/airbyte-server/src/main/java/io/airbyte/server/config/TemporalBeanFactory.java b/airbyte-server/src/main/java/io/airbyte/server/config/TemporalBeanFactory.java index 069a3853193f..f3dd40c530af 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/config/TemporalBeanFactory.java +++ b/airbyte-server/src/main/java/io/airbyte/server/config/TemporalBeanFactory.java @@ -7,6 +7,8 @@ import io.airbyte.analytics.Deployment; import io.airbyte.analytics.TrackingClient; import io.airbyte.analytics.TrackingClientSingleton; +import io.airbyte.commons.server.scheduler.DefaultSynchronousSchedulerClient; +import io.airbyte.commons.server.scheduler.SynchronousSchedulerClient; import io.airbyte.commons.temporal.TemporalClient; import io.airbyte.commons.version.AirbyteVersion; import io.airbyte.config.Configs.DeploymentMode; @@ -17,8 +19,6 @@ import io.airbyte.persistence.job.errorreporter.JobErrorReporter; import io.airbyte.persistence.job.factory.OAuthConfigSupplier; import io.airbyte.persistence.job.tracker.JobTracker; -import io.airbyte.server.scheduler.DefaultSynchronousSchedulerClient; -import io.airbyte.server.scheduler.SynchronousSchedulerClient; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Value; import jakarta.inject.Singleton; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionHandler.java b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionHandler.java index 6cdc923e3ebf..77d11239d1d5 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionHandler.java @@ -4,9 +4,8 @@ package io.airbyte.server.errors; -import io.airbyte.api.model.generated.InvalidInputExceptionInfo; -import io.airbyte.api.model.generated.InvalidInputProperty; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.errors.InvalidInputExceptionMapper; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; @@ -15,11 +14,7 @@ import io.micronaut.http.annotation.Produces; import io.micronaut.http.server.exceptions.ExceptionHandler; import jakarta.inject.Singleton; -import java.util.ArrayList; -import java.util.List; -import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; -import org.apache.logging.log4j.core.util.Throwables; // https://www.baeldung.com/jersey-bean-validation#custom-exception-handler // handles exceptions related to the request body not matching the openapi config. @@ -28,27 +23,10 @@ @Requires(classes = ConstraintViolationException.class) public class InvalidInputExceptionHandler implements ExceptionHandler { - public static InvalidInputExceptionInfo infoFromConstraints(final ConstraintViolationException cve) { - final InvalidInputExceptionInfo exceptionInfo = new InvalidInputExceptionInfo() - .exceptionClassName(cve.getClass().getName()) - .message("Some properties contained invalid input.") - .exceptionStack(Throwables.toStringList(cve)); - - final List props = new ArrayList(); - for (final ConstraintViolation cv : cve.getConstraintViolations()) { - props.add(new InvalidInputProperty() - .propertyPath(cv.getPropertyPath().toString()) - .message(cv.getMessage()) - .invalidValue(cv.getInvalidValue() != null ? cv.getInvalidValue().toString() : "null")); - } - exceptionInfo.validationErrors(props); - return exceptionInfo; - } - @Override public HttpResponse handle(final HttpRequest request, final ConstraintViolationException exception) { return HttpResponse.status(HttpStatus.BAD_REQUEST) - .body(Jsons.serialize(InvalidInputExceptionHandler.infoFromConstraints(exception))) + .body(Jsons.serialize(InvalidInputExceptionMapper.infoFromConstraints(exception))) .contentType(MediaType.APPLICATION_JSON_TYPE); } diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionMapper.java b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionMapper.java deleted file mode 100644 index 4fe9b202265c..000000000000 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidInputExceptionMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Airbyte, Inc., all rights reserved. - */ - -package io.airbyte.server.errors; - -import io.airbyte.commons.json.Jsons; -import javax.validation.ConstraintViolationException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - -@Provider -public class InvalidInputExceptionMapper implements ExceptionMapper { - - @Override - public Response toResponse(final ConstraintViolationException e) { - return Response.status(Response.Status.BAD_REQUEST) - .entity(Jsons.serialize(InvalidInputExceptionHandler.infoFromConstraints(e))) - .type("application/json") - .build(); - } - -} diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionHandler.java b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionHandler.java index ee7a3e57a2e9..e8aa3ceefb98 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonExceptionHandler.java @@ -5,6 +5,7 @@ package io.airbyte.server.errors; import com.fasterxml.jackson.core.JsonParseException; +import io.airbyte.commons.server.errors.KnownException; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionHandler.java b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionHandler.java index fe5f7abaa4b8..ebb9a5158667 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/errors/InvalidJsonInputExceptionHandler.java @@ -5,6 +5,7 @@ package io.airbyte.server.errors; import com.fasterxml.jackson.databind.JsonMappingException; +import io.airbyte.commons.server.errors.KnownException; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionHandler.java b/airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionHandler.java index 4b928ded5926..1d4b932fe00a 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/errors/KnownExceptionHandler.java @@ -5,6 +5,7 @@ package io.airbyte.server.errors; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.server.errors.KnownException; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionHandler.java b/airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionHandler.java index 86d83a33bdb1..e522fea2c78b 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/errors/NotFoundExceptionHandler.java @@ -4,6 +4,8 @@ package io.airbyte.server.errors; +import io.airbyte.commons.server.errors.IdNotFoundKnownException; +import io.airbyte.commons.server.errors.KnownException; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; diff --git a/airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionHandler.java b/airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionHandler.java index afaf26bd4842..00b032d524ec 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionHandler.java +++ b/airbyte-server/src/main/java/io/airbyte/server/errors/UncaughtExceptionHandler.java @@ -4,6 +4,7 @@ package io.airbyte.server.errors; +import io.airbyte.commons.server.errors.KnownException; import io.micronaut.context.annotation.Requires; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; diff --git a/airbyte-server/src/test/java/io/airbyte/server/apis/HealthCheckApiTest.java b/airbyte-server/src/test/java/io/airbyte/server/apis/HealthCheckApiTest.java index cc4f5d814e35..eb9f258eb178 100644 --- a/airbyte-server/src/test/java/io/airbyte/server/apis/HealthCheckApiTest.java +++ b/airbyte-server/src/test/java/io/airbyte/server/apis/HealthCheckApiTest.java @@ -9,7 +9,7 @@ import static org.mockito.Mockito.when; import io.airbyte.api.model.generated.HealthCheckRead; -import io.airbyte.server.handlers.HealthCheckHandler; +import io.airbyte.commons.server.handlers.HealthCheckHandler; import org.junit.jupiter.api.Test; class HealthCheckApiTest { diff --git a/gradle.properties b/gradle.properties index f688779de905..bd7bbf32d0a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.parallel=true -org.gradle.jvmargs=-Xmx4g -Xss4m +org.gradle.jvmargs=-Xmx8g -Xss4m org.gradle.caching=true # Note, this might have issues on the normal Github runner. diff --git a/settings.gradle b/settings.gradle index 4b698a1bafef..4b79182b6b81 100644 --- a/settings.gradle +++ b/settings.gradle @@ -106,6 +106,7 @@ include ':airbyte-worker-models' // platform if (!System.getenv().containsKey("SUB_BUILD") || System.getenv().get("SUB_BUILD") == "PLATFORM") { include ':airbyte-bootloader' + include ':airbyte-commons-server' include ':airbyte-config:specs' include ':airbyte-connector-builder-server' include ':airbyte-container-orchestrator' @@ -172,3 +173,5 @@ if (!System.getenv().containsKey("SUB_BUILD") || System.getenv().get("SUB_BUILD" } } } + +