Skip to content

Commit

Permalink
Merge branch 'iceberg-schema-supertype-finder' into iceberg-schema-up…
Browse files Browse the repository at this point in the history
…date-logic

# Conflicts:
#	airbyte-integrations/connectors/destination-s3-data-lake/metadata.yaml
#	airbyte-integrations/connectors/destination-s3-data-lake/src/main/kotlin/io/airbyte/integrations/destination/s3_data_lake/IcebergSchemaSynchronizer.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/main/kotlin/io/airbyte/integrations/destination/s3_data_lake/IcebergSuperTypeFinder.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/main/kotlin/io/airbyte/integrations/destination/s3_data_lake/IcebergTypesComparator.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/main/kotlin/io/airbyte/integrations/destination/s3_data_lake/S3DataLakeWriter.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/test/kotlin/io/airbyte/integrations/destination/s3_data_lake/IcebergSuperTypeFinderTest.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/test/kotlin/io/airbyte/integrations/destination/s3_data_lake/IcebergTableSynchronizerTest.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/test/kotlin/io/airbyte/integrations/destination/s3_data_lake/IcebergTypesComparatorTest.kt
#	airbyte-integrations/connectors/destination-s3-data-lake/src/test/kotlin/io/airbyte/integrations/destination/s3_data_lake/S3DataLakeWriterTest.kt
  • Loading branch information
subodh1810 committed Jan 14, 2025
2 parents 5542700 + 15717e7 commit f9920aa
Show file tree
Hide file tree
Showing 1,356 changed files with 35,621 additions and 36,246 deletions.
37 changes: 24 additions & 13 deletions .github/actions/install-airbyte-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,26 @@ runs:
- name: "Determine how Airbyte CI should be installed"
shell: bash
id: determine-install-mode
# When the PR is from a fork, we always install from binary
if: inputs.is_fork == 'false'
run: |
if [[ "${{ github.ref }}" != "refs/heads/master" ]] && [[ "${{ steps.changes.outputs.pipelines_any_changed }}" == "true" ]]; then
echo "Making changes to Airbyte CI on a non-master branch. Airbyte-CI will be installed from source."
echo "install-mode=source" >> $GITHUB_OUTPUT
echo "SENTRY_ENVIRONMENT=dev" >> $GITHUB_ENV
else
echo "install-mode=binary" >> $GITHUB_OUTPUT
echo "SENTRY_ENVIRONMENT=production" >> $GITHUB_ENV
fi
echo "install-mode=source" >> $GITHUB_OUTPUT
echo "SENTRY_ENVIRONMENT=dev" >> $GITHUB_ENV
# When the PR is from a fork, we always install from binary
# if: inputs.is_fork == 'false'
# run: |
# if [[ "${{ github.ref }}" != "refs/heads/master" ]] && [[ "${{ steps.changes.outputs.pipelines_any_changed }}" == "true" ]]; then
# echo "Making changes to Airbyte CI on a non-master branch. Airbyte-CI will be installed from source."
# echo "install-mode=source" >> $GITHUB_OUTPUT
# echo "SENTRY_ENVIRONMENT=dev" >> $GITHUB_ENV
# else
# echo "install-mode=binary" >> $GITHUB_OUTPUT
# echo "SENTRY_ENVIRONMENT=production" >> $GITHUB_ENV
# fi

- name: Install Airbyte CI from binary
id: install-airbyte-ci-binary
if: steps.determine-install-mode.outputs.install-mode == 'binary' || ${{ inputs.is_fork }} == 'true'
if: false
# if: steps.determine-install-mode.outputs.install-mode == 'binary' || ${{ inputs.is_fork }} == 'true'
shell: bash
run: |
curl -sSL ${{ inputs.airbyte_ci_binary_url }} --output airbyte-ci-bin
Expand All @@ -54,21 +59,27 @@ runs:
- name: Install Python 3.10
id: install-python-3-10
uses: actions/setup-python@v4
if: steps.determine-install-mode.outputs.install-mode == 'source'
# if: steps.determine-install-mode.outputs.install-mode == 'source'
with:
python-version: "3.10"
token: ${{ inputs.github_token }}

- name: Install Airbyte CI from source
id: install-airbyte-ci-source
if: steps.determine-install-mode.outputs.install-mode == 'source'
if: true
# if: steps.determine-install-mode.outputs.install-mode == 'source'
shell: bash
run: |
pip install --upgrade pip
pip install pipx
pipx ensurepath
pipx install ${{ inputs.path_to_airbyte_ci_source }}
- name: Print installed `airbyte-ci` version
shell: bash
run: |
airbyte-ci --version
- name: Get dagger engine image name
id: get-dagger-engine-image-name
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/airbyte-ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
- name: Install Poetry
id: install_poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5

- name: Install Dependencies
id: install_dependencies
Expand All @@ -54,7 +56,7 @@ jobs:
working-directory: airbyte-ci/connectors/pipelines/
run: poetry run poe build-release-binary ${{ env.BINARY_FILE_NAME }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: airbyte-ci-${{ matrix.os }}-${{ steps.get_short_sha.outputs.sha }}
path: airbyte-ci/connectors/pipelines/dist/${{ env.BINARY_FILE_NAME }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/auto_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
python-version: "3.10"
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5
- name: Run auto merge
shell: bash
working-directory: airbyte-ci/connectors/auto_merge
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/connectors_insights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/connectors_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# If the condition is not met the job will be skipped (it will not fail)
if: (github.event_name == 'pull_request' && needs.changes.outputs.connectors == 'true' && github.event.pull_request.head.repo.fork != true) || github.event_name == 'workflow_dispatch'
name: Connectors CI
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
timeout-minutes: 360 # 6 hours
steps:
- name: Checkout Airbyte
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/connectors_version_increment_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
connectors_ci:
name: Connectors Version Increment Check
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
if: github.event.pull_request.head.repo.fork != true
timeout-minutes: 22
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# Any revision upwards should be based on a performance analysis of gradle scans.
# See https://github.com/airbytehq/airbyte/pull/36055 for an example of this,
# which explains why which we went down from 64 cores to 16.
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
name: Gradle Check
timeout-minutes: 30
steps:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/live_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ on:
jobs:
live_tests:
name: Live Tests
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
timeout-minutes: 360 # 6 hours
steps:
- name: Checkout Airbyte
Expand All @@ -63,6 +63,8 @@ jobs:
- name: Install Poetry
id: install_poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5

- name: Make poetry venv in project
id: poetry_venv
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-bulk-cdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
jobs:
publish-bulk-cdk:
name: Publish Bulk CDK
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
timeout-minutes: 30
steps:
- name: Checkout Airbyte
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-java-cdk-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ env:
jobs:
publish-cdk:
name: Publish Java CDK
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
timeout-minutes: 30
steps:
- name: Link comment to Workflow Run
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_connectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
jobs:
publish_connectors:
name: Publish connectors
runs-on: connector-publish-large
runs-on: ubuntu-24.04-4core
steps:
- name: Checkout Airbyte
uses: actions/checkout@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ on:
jobs:
regression_tests:
name: Regression Tests
runs-on: connector-test-large
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
timeout-minutes: 360 # 6 hours
steps:
- name: Install Python
id: install_python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Checkout Airbyte
uses: actions/checkout@v4
- name: Check PAT rate limits
Expand All @@ -63,6 +69,8 @@ jobs:
- name: Install Poetry
id: install_poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5

- name: Make poetry venv in project
id: poetry_venv
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-performance-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
- name: Archive test reports artifacts
if: github.event.inputs.comment-id && failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
Expand All @@ -145,7 +145,7 @@ jobs:
- name: Test coverage reports artifacts
if: github.event.inputs.comment-id && success()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ package io.airbyte.cdk

/** This is used only in tests. */
class ConnectorUncleanExitException(val exitCode: Int) :
Exception("Destination process exited uncleanly: $exitCode")
Exception("Connector process exited uncleanly: $exitCode")
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package io.airbyte.cdk.discover

import io.airbyte.cdk.data.AirbyteSchemaType
import io.airbyte.cdk.data.DoubleCodec
import io.airbyte.cdk.data.JsonDecoder
import io.airbyte.cdk.data.JsonEncoder
import io.airbyte.cdk.data.JsonStringCodec
Expand Down Expand Up @@ -63,8 +64,8 @@ interface MetaField : FieldOrMetaField {
enum class CommonMetaField(
override val type: FieldType,
) : MetaField {
CDC_UPDATED_AT(CdcOffsetDateTimeMetaFieldType),
CDC_DELETED_AT(CdcOffsetDateTimeMetaFieldType),
CDC_UPDATED_AT(CdcStringMetaFieldType),
CDC_DELETED_AT(CdcStringMetaFieldType),
;

override val id: String
Expand All @@ -89,3 +90,9 @@ data object CdcOffsetDateTimeMetaFieldType : LosslessFieldType {
override val jsonEncoder: JsonEncoder<OffsetDateTime> = OffsetDateTimeCodec
override val jsonDecoder: JsonDecoder<OffsetDateTime> = OffsetDateTimeCodec
}

data object CdcNumberMetaFieldType : LosslessFieldType {
override val airbyteSchemaType: AirbyteSchemaType = LeafAirbyteSchemaType.NUMBER
override val jsonEncoder: JsonEncoder<Double> = DoubleCodec
override val jsonDecoder: JsonDecoder<Double> = DoubleCodec
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
package io.airbyte.cdk.load.mock_integration_test

import io.airbyte.cdk.load.test.util.NoopDestinationCleaner
import io.airbyte.cdk.load.test.util.NoopExpectedRecordMapper
import io.airbyte.cdk.load.test.util.NoopNameMapper
import io.airbyte.cdk.load.test.util.UncoercedExpectedRecordMapper
import io.airbyte.cdk.load.write.BasicFunctionalityIntegrationTest
import io.airbyte.cdk.load.write.Untyped
import org.junit.jupiter.api.Disabled
Expand All @@ -18,7 +18,7 @@ class MockBasicFunctionalityIntegrationTest :
MockDestinationSpecification::class.java,
MockDestinationDataDumper,
NoopDestinationCleaner,
NoopExpectedRecordMapper,
UncoercedExpectedRecordMapper,
NoopNameMapper,
isStreamSchemaRetroactive = false,
supportsDedup = true,
Expand All @@ -27,6 +27,7 @@ class MockBasicFunctionalityIntegrationTest :
preserveUndeclaredFields = true,
commitDataIncrementally = false,
allTypesBehavior = Untyped,
envVars = emptyMap(),
supportFileTransfer = false,
) {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ import io.airbyte.cdk.output.ExceptionHandler
import io.airbyte.cdk.output.OutputConsumer
import io.airbyte.protocol.models.v0.AirbyteConnectionStatus
import io.airbyte.protocol.models.v0.AirbyteMessage
import io.github.oshai.kotlinlogging.KotlinLogging
import io.micronaut.context.annotation.Requires
import jakarta.inject.Singleton

private val logger = KotlinLogging.logger {}

@Singleton
@Requires(property = Operation.PROPERTY, value = "check")
@Requires(env = ["destination"])
Expand All @@ -40,6 +43,7 @@ class CheckOperation<T : ConfigurationSpecification, C : DestinationConfiguratio
)
outputConsumer.accept(successMessage)
} catch (t: Throwable) {
logger.warn(t) { "Caught throwable during CHECK" }
val (traceMessage, statusMessage) = exceptionHandler.handleCheckFailure(t)
outputConsumer.accept(traceMessage)
outputConsumer.accept(statusMessage)
Expand Down
Loading

0 comments on commit f9920aa

Please sign in to comment.