Skip to content

Commit

Permalink
Merge branch 'master' into ryermilov/source-facebook-marketing-fix-ac…
Browse files Browse the repository at this point in the history
…ceptance-tests
  • Loading branch information
roman-yermilov-gl committed Mar 29, 2024
2 parents 37c6777 + b8b6886 commit e43614f
Show file tree
Hide file tree
Showing 317 changed files with 6,628 additions and 18,524 deletions.
1 change: 0 additions & 1 deletion .github/workflows/airbyte-ci-tests.yml
Expand Up @@ -32,7 +32,6 @@ jobs:
filters: |
# This list is duplicated in `pipelines/airbyte_ci/test/__init__.py`
internal_poetry_packages:
- airbyte-lib/**
- airbyte-ci/connectors/pipelines/**
- airbyte-ci/connectors/base_images/**
- airbyte-ci/connectors/common_utils/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/connector_code_freeze.yml
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Get changed files
if: steps.check-code-freeze-in-effect.outputs.is_in_code_freeze == 'true'
id: changed-files
uses: tj-actions/changed-files@v40
uses: tj-actions/changed-files@v44
with:
files_yaml: |
connectors:
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/publish-airbyte-lib-command-manually.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/upload-metadata-files.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v44
with:
files: "airbyte-integrations/connectors/**/metadata.yaml"
- name: Setup Python 3.10
Expand Down
3 changes: 3 additions & 0 deletions airbyte-cdk/java/airbyte-cdk/build.gradle
Expand Up @@ -50,6 +50,9 @@ allprojects {
testFixturesImplementation.extendsFrom implementation
testFixturesRuntimeOnly.extendsFrom runtimeOnly
}

// This is necessary because the mockit.kotlin any() generates a bunch of bad casts
spotbugsTest.omitVisitors = ['FindBadCast2']
}

description = "Airbyte Connector Development Kit (CDK) for Java."
Expand Down
4 changes: 4 additions & 0 deletions airbyte-cdk/java/airbyte-cdk/core/build.gradle
Expand Up @@ -50,6 +50,10 @@ compileKotlin {
}
}

spotbugsTest.enabled = false
spotbugsTestFixtures.enabled = false


dependencies {

api 'com.datadoghq:dd-trace-api:1.28.0'
Expand Down
2 changes: 2 additions & 0 deletions airbyte-cdk/java/airbyte-cdk/datastore-postgres/build.gradle
Expand Up @@ -11,6 +11,8 @@ compileKotlin {
}
}

spotbugsTest.enabled = false

dependencies {
implementation project(':airbyte-cdk:java:airbyte-cdk:dependencies')
implementation project(':airbyte-cdk:java:airbyte-cdk:core')
Expand Down
3 changes: 3 additions & 0 deletions airbyte-cdk/java/airbyte-cdk/db-destinations/build.gradle
Expand Up @@ -12,6 +12,9 @@ compileKotlin.compilerOptions.allWarningsAsErrors = false
compileTestFixturesKotlin.compilerOptions.allWarningsAsErrors = false
compileTestKotlin.compilerOptions.allWarningsAsErrors = false

spotbugsTest.enabled = false
spotbugsTestFixtures.enabled = false

dependencies {
api 'org.apache.commons:commons-csv:1.10.0'

Expand Down
4 changes: 4 additions & 0 deletions airbyte-cdk/java/airbyte-cdk/db-sources/build.gradle
Expand Up @@ -15,6 +15,9 @@ compileKotlin.compilerOptions.allWarningsAsErrors = false
compileTestFixturesKotlin.compilerOptions.allWarningsAsErrors = false
compileTestKotlin.compilerOptions.allWarningsAsErrors = false

spotbugsTestFixtures.enabled = false
spotbugsTest.enabled = false


// Convert yaml to java: relationaldb.models
jsonSchema2Pojo {
Expand Down Expand Up @@ -49,6 +52,7 @@ dependencies {
testFixturesImplementation project(':airbyte-cdk:java:airbyte-cdk:core')
testFixturesApi testFixtures(project(':airbyte-cdk:java:airbyte-cdk:core'))

testFixturesImplementation ('io.airbyte:airbyte-api:0.55.2') { transitive = false }
testFixturesImplementation 'net.sourceforge.argparse4j:argparse4j:0.9.0'
testFixturesImplementation 'io.swagger:swagger-annotations:1.6.13'
testFixturesImplementation 'org.hamcrest:hamcrest-all:1.3'
Expand Down
150 changes: 3 additions & 147 deletions airbyte-cdk/java/airbyte-cdk/dependencies/build.gradle
@@ -1,12 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask

plugins {
id "com.github.eirnym.js2p" version "1.0"
id "de.undercouch.download" version "5.4.0"
id "java-library"
id "org.openapi.generator" version "6.2.1"
}

java {
Expand All @@ -25,127 +19,11 @@ compileKotlin.compilerOptions.allWarningsAsErrors = false
compileTestFixturesKotlin.compilerOptions.allWarningsAsErrors = false
compileTestKotlin.compilerOptions.allWarningsAsErrors = false

String specFile = "$projectDir/src/main/openapi/config.yaml"
String serverOutputDir = "$buildDir/generated/api/server"
String clientOutputDir = "$buildDir/generated/api/client"
String docsOutputDir = "$buildDir/generated/api/docs"
Map<String,String> schemaMappingsValue = [
'OAuthConfiguration' : 'com.fasterxml.jackson.databind.JsonNode',
'SourceDefinitionSpecification' : 'com.fasterxml.jackson.databind.JsonNode',
'SourceConfiguration' : 'com.fasterxml.jackson.databind.JsonNode',
'DestinationDefinitionSpecification': 'com.fasterxml.jackson.databind.JsonNode',
'DestinationConfiguration' : 'com.fasterxml.jackson.databind.JsonNode',
'StreamJsonSchema' : 'com.fasterxml.jackson.databind.JsonNode',
'StateBlob' : 'com.fasterxml.jackson.databind.JsonNode',
'FieldSchema' : 'com.fasterxml.jackson.databind.JsonNode',
]
spotbugsTest.enabled = false
spotbugsTestFixtures.enabled = false

def generate = tasks.register('generate')

def generateApiServer = tasks.register('generateApiServer', GenerateTask) {

inputs.file specFile
outputs.dir serverOutputDir

generatorName = "jaxrs-spec"
inputSpec = specFile
outputDir = serverOutputDir

apiPackage = "io.airbyte.api.generated"
invokerPackage = "io.airbyte.api.invoker.generated"
modelPackage = "io.airbyte.api.model.generated"

schemaMappings.set(schemaMappingsValue)

generateApiDocumentation = false

configOptions.set([
dateLibrary : "java8",
generatePom : "false",
interfaceOnly: "true",
/*
JAX-RS generator does not respect nullable properties defined in the OpenApi Spec.
It means that if a field is not nullable but not set it is still returning a null value for this field in the serialized json.
The below Jackson annotation is made to only keep non null values in serialized json.
We are not yet using nullable=true properties in our OpenApi so this is a valid workaround at the moment to circumvent the default JAX-RS behavior described above.
Feel free to read the conversation on https://github.com/airbytehq/airbyte/pull/13370 for more details.
*/
additionalModelTypeAnnotations: "\n@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)",
])
}
generate.configure {
dependsOn generateApiServer
}

def generateApiClient = tasks.register('generateApiClient', GenerateTask) {

inputs.file specFile
outputs.dir clientOutputDir

generatorName = "java"
inputSpec = specFile
outputDir = clientOutputDir

apiPackage = "io.airbyte.api.client.generated"
invokerPackage = "io.airbyte.api.client.invoker.generated"
modelPackage = "io.airbyte.api.client.model.generated"

schemaMappings.set(schemaMappingsValue)

library = "native"

generateApiDocumentation = false

configOptions.set([
dateLibrary : "java8",
generatePom : "false",
interfaceOnly: "true"
])
}
generate.configure {
dependsOn generateApiClient
}

def generateApiDocs = tasks.register('generateApiDocs', GenerateTask) {

generatorName = "html"
inputSpec = specFile
outputDir = docsOutputDir

apiPackage = "io.airbyte.api.client.generated"
invokerPackage = "io.airbyte.api.client.invoker.generated"
modelPackage = "io.airbyte.api.client.model.generated"

schemaMappings.set(schemaMappingsValue)

generateApiDocumentation = false

configOptions.set([
dateLibrary : "java8",
generatePom : "false",
interfaceOnly: "true"
])
}
def deleteExistingDocs = tasks.register('deleteOldApiDocs', Delete) {
delete rootProject.file("docs/reference/api/generated-api-html")
}
deleteExistingDocs.configure {
dependsOn generateApiDocs
}
def copyApiDocs = tasks.register('copyApiDocs', Copy) {
from(docsOutputDir) {
include "**/*.html"
}
into rootProject.file("docs/reference/api/generated-api-html")
includeEmptyDirs = false
}
copyApiDocs.configure {
dependsOn deleteExistingDocs
}
generate.configure {
dependsOn copyApiDocs
}

dependencies {
api platform('com.fasterxml.jackson:jackson-bom:2.15.2')
api 'com.fasterxml.jackson.core:jackson-annotations'
Expand Down Expand Up @@ -178,6 +56,7 @@ dependencies {

testFixturesApi testFixtures(project(':airbyte-cdk:java:airbyte-cdk:core'))

testFixturesImplementation ('io.airbyte:airbyte-api:0.55.2') { transitive = false }
testFixturesImplementation 'io.swagger:swagger-annotations:1.6.2'
testFixturesImplementation 'org.apache.ant:ant:1.10.11'

Expand Down Expand Up @@ -206,29 +85,6 @@ generate.configure {
dependsOn tasks.named('generateJsonSchema2Pojo')
}


sourceSets {
main {
java {
srcDirs([
"$projectDir/src/main/java",
"${serverOutputDir}/src/gen/java",
"${clientOutputDir}/src/main/java",
])
}
kotlin {
srcDirs([
"$projectDir/src/main/kotlin",
"${serverOutputDir}/src/gen/kotlin",
"${clientOutputDir}/src/main/kotlin",
])
}
resources {
srcDir "$projectDir/src/main/openapi/"
}
}
}

tasks.named('compileJava').configure {
dependsOn generate
}
Expand Down

0 comments on commit e43614f

Please sign in to comment.