diff --git a/airbyte-commons-server/build.gradle b/airbyte-commons-server/build.gradle new file mode 100644 index 0000000000000..f0ea82dcb4e5f --- /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 6406d6b860262..2d43ff574a2c4 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 6c40fc37ba917..6c8a3ececc294 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 9b85de35c34b0..ea63090306765 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 181be5454880e..7b14abe1f2be4 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 8eaf31178ac71..0b0fc05be5b49 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 9a3d479749e0f..ad138b919c3d3 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 c24346a123f58..50fc1a1f36013 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 78c44bcda3d18..86220d17a7bff 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 9862ba52b6111..b390f51f486d9 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 5934e6fb7756f..6c46d76499905 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 76bd67ab20675..4f0d8a526734d 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 a8a86b838d2b8..68826e525fef1 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 69f3c86c58581..371601e85d49e 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 5e880ba3483fe..34b455a6e4a55 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 1b3c462d90e47..5997ce894a8d9 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 4cd9b709cf040..0dfc234bee286 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 460e48dc13390..76699cceb8d82 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 7900e02f24513..4b9fd4b28419b 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 0000000000000..fd8b0b368a698 --- /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 c126f12993254..a073c369aca57 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 90700f7717821..d504333c4f0eb 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 d9b5716a8c6c4..2067e3d872996 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 9d81a3fc7174c..5ead770ad91c3 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 0317cdf952cb4..93a430472a6b0 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 3aac5522570e7..8057734d660af 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 5b83844a54c1b..661e7e40a4855 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 b84ed0da6472c..c6ac8dbe92ef3 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 6a07ff3044083..c7132665fe927 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 12aff047d12a0..698d66716c7dd 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 8dbd84014459c..813cda084b555 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 d105a514e0ec5..4a5fa21e52572 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 2843fbc2c09d6..bd96e2df625fa 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 579e0b4672a4e..65fddab329572 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 b9ac2378aca4d..4fb5ce2f8d66d 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 6823d6d5a8f60..8a4cb5089d504 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 e9d4b3614ec89..4192ff00dbb58 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 7e6c45140508b..7510b26cc846d 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 97e8bfb5cc006..51c38b824b283 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 578d8398153ad..9ee876cba701e 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 c8c366bab4a8b..fe95cf6ec1c36 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 977f95813aadf..8bc2a8f68e125 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 7c51e26c5494f..13a2c0d3cd2a8 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 e45c356867041..3e71207370573 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 3d39209098f15..7e33d5374e7ec 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 6829747a30140..29b739ffe8d3f 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 6cf626f381b47..48ae8630b2059 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 2afaf63aec8bf..d9b0387fca177 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 807072626cb37..e49d31a6449e4 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 b9c374c31e003..05f2752d1df28 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 b1de20b95fdcd..2e87767d3a765 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 4a6ed4580020d..60da416a51089 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 ee4e35d7d2c7c..78c13fc4e9921 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 28036302a9bea..f01806f089583 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 bc4a83a07042a..627df14556b37 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 b4689b9fa6bf0..a3731db99e524 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 463564e8fe981..1c135ce85aaf8 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 7ff4257e1f2bf..a9bceabccc645 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 5aa469a1a9d5a..e6976a7f9de1c 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 8500d6e8dc558..06113d752d482 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 46498b4e0b60f..042baedd324eb 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 d9d41bda7ec4a..5747a8d910662 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 d9108cd6f577f..e18c89ef10ba6 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 654c7af8c44b9..831bbc58ff241 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 f73ec6e62aad5..eb2595333f857 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 c96a23d1bab1b..494e9c3a2b7f6 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 4698ed5c63876..eeb2c0ff48c71 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 7c8f2bc0bc826..83c68ec03c452 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 9a2364a8cf454..b2445c5d43b03 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 8eadc7abf46a0..4a65cc85aa936 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 728d60bbee48e..9448aa5a36094 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 2d83a4bd02c98..7dedbe3142d2a 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 02bd7034f6f5c..3ab2582afdb45 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 098f05f1a4a36..3b730f1997714 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 08d9d2f95e530..57daf559363d9 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 5b7311433e9bb..99dd0ccb4b4b6 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 e3e2d49542f19..97082336b16dc 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 dc8721c4cf550..b495ab19e1a19 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 424ae0d49e3dd..76c2c70dd036a 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 61a27553bea37..d36423baeb531 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 53cc95fc90276..f43633cc98afe 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 78ac5ee79b565..4c9e51f910cc3 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 abf564dee15aa..fb75429471309 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 e4f014aa3c1db..f0c14e2e69ff3 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 4e604e12855da..c3c6a94419381 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 e7c7d95f83080..5a45c37b2af5a 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 00afd4ff6a803..300079b72964c 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 dd843b96cbdb2..50ac208ba8dd9 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 24ee7a0d452c1..b1c776a17d7e1 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 a3eb07edee60d..74bb05dca4f23 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 1c592baa42950..fd5a0bb8d26c1 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 975256c751a7f..1b1604973bdb7 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 9cc3761c224cf..bd9bbdc927649 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 6f483ffdbdfe0..80dfff70b7014 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 19d391456bcd3..c75ccaf1add05 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 16f3405d07e53..30e11d97c09c5 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 4fb8307719065..2ceb52bd9e4d2 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 b24eda21e7541..63541a77b34ce 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 c7c112405b44c..64e8c4730d8fa 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 aca38ca5ccec7..094acc9416e30 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 0c1d5f074faa1..0b3c16ea84246 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 e3796c033c320..6fe120b689f63 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 d93bc6dcbe999..a6c013df95421 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 58286dfacd483..3d508935a4bd0 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 3ffb6851cbc55..de386a5367754 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 b930472e5d230..8ca1195c92f49 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 13257412cf043..e98749577545b 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 c81799b9ac924..e2cf648e33985 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 5e574a23deb9d..0f1754d014921 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 64ac3c337f51a..73e19c1848052 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 365dc04afc465..4799406c8a42a 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 d7946484d8ee4..12efa77023167 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 1dac7ca5b7089..ef7004105e5b0 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 e87b5c28bddc2..2e094bc3f7058 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 52cbc82beb97f..785c41519bf50 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 870a499d5999d..02b1941e5bd8e 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 af8c5a3ad3167..b5c515e37f93d 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 c270ce286ccf9..5bc66adb7ffd0 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 13111f657156b..e21046c46c687 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 069a3853193f7..f3dd40c530af8 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 6cdc923e3ebfc..77d11239d1d58 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 4fe9b202265cb..0000000000000 --- 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 ee7a3e57a2e97..e8aa3ceefb984 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 fe5f7abaa4b89..ebb9a5158667b 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 4b928ded59266..1d4b932fe00ab 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 86d83a33bdb18..e522fea2c78bf 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 afaf26bd4842b..00b032d524ec0 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 cc4f5d814e35e..eb9f258eb1782 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 f688779de9056..bd7bbf32d0a87 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 4b698a1bafef0..4b79182b6b812 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" } } } + +