Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into artem1205/precommit…
Browse files Browse the repository at this point in the history
…-fix-unused-imports
  • Loading branch information
artem1205 committed Feb 23, 2025
2 parents ca7ac53 + 35d60a2 commit a6a4f6b
Show file tree
Hide file tree
Showing 2,172 changed files with 168,322 additions and 126,719 deletions.
20 changes: 10 additions & 10 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
/airbyte-integrations/connectors/destination-snowflake-cortex @airbytehq/ai-language-models

# CI/CD
/.github/ @airbytehq/dev-tooling
/airbyte-ci/ @airbytehq/dev-tooling
/.github/ @airbytehq/dev-extensibility
/airbyte-ci/ @airbytehq/dev-extensibility

# Python CDK and Connector Acceptance Tests
/airbyte-integrations/connector-templates/ @airbytehq/dev-marketplace-contributions
/airbyte-integrations/bases/connector-acceptance-test/ @airbytehq/dev-tooling
/airbyte-integrations/connector-templates/ @airbytehq/dev-extensibility
/airbyte-integrations/bases/connector-acceptance-test/ @airbytehq/dev-extensibility

# Build customization file change
/airbyte-integrations/connectors/**/build_customization.py @airbytehq/dev-tooling
/airbyte-integrations/connectors/**/build_customization.py @airbytehq/dev-extensibility

# Protocol related items
/docs/understanding-airbyte/airbyte-protocol.md @airbytehq/protocol-reviewers
Expand Down Expand Up @@ -59,8 +59,8 @@
/airbyte-integrations/connectors/destination-redshift/ @airbytehq/move-destinations

# Python critical connectors
/airbyte-integrations/connectors/source-facebook-marketing/ @airbytehq/python-team
/airbyte-integrations/connectors/source-hubspot/ @airbytehq/python-team
/airbyte-integrations/connectors/source-salesforce/ @airbytehq/python-team
/airbyte-integrations/connectors/source-shopify/ @airbytehq/python-team
/airbyte-integrations/connectors/source-stripe/ @airbytehq/python-team
/airbyte-integrations/connectors/source-facebook-marketing/ @airbytehq/dev-extensibility
/airbyte-integrations/connectors/source-hubspot/ @airbytehq/dev-extensibility
/airbyte-integrations/connectors/source-salesforce/ @airbytehq/dev-extensibility
/airbyte-integrations/connectors/source-shopify/ @airbytehq/dev-extensibility
/airbyte-integrations/connectors/source-stripe/ @airbytehq/dev-extensibility
9 changes: 6 additions & 3 deletions .github/actions/install-airbyte-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ runs:
sudo mv airbyte-ci-bin /usr/local/bin/airbyte-ci
sudo chmod +x /usr/local/bin/airbyte-ci
- name: Install Python 3.10
id: install-python-3-10
- name: Install Python 3.11
id: install-python-3-11
uses: actions/setup-python@v4
# if: steps.determine-install-mode.outputs.install-mode == 'source'
with:
python-version: "3.10"
python-version: "3.11"
token: ${{ inputs.github_token }}
cache: "pip"
check-latest: true
update-environment: true

- name: Install Airbyte CI from source
id: install-airbyte-ci-source
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 @@ -38,7 +38,9 @@ jobs:
id: install_python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
check-latest: true
update-environment: true

- name: Install Poetry
id: install_poetry
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/airbyte-ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
internal_poetry_packages:
- airbyte-ci/connectors/pipelines/**
- airbyte-ci/connectors/base_images/**
- airbyte-ci/connectors/common_utils/**
- airbyte-ci/connectors/connectors_insights/**
- airbyte-ci/connectors/connector_ops/**
- airbyte-ci/connectors/connectors_qa/**
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/auto_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
check-latest: true
update-environment: true
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bump-version-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }}
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }}
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
git_repo_url: https://github.com/${{ steps.job-vars.outputs.repo }}.git
subcommand: |
connectors --modified bump-version \
${{ github.event.inputs.type }} \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/connector-performance-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
check-latest: true
update-environment: true
- name: Install CI scripts
run: |
pip install pipx
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/connector_teams_review_requirements.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Connectors Version Increment Check
name: Connectors Pre-Release Checks

concurrency:
# This is the name of the concurrency group. It is used to prevent concurrent runs of the same workflow.
Expand All @@ -20,9 +20,11 @@ on:
- "airbyte-integrations/connectors/**/*"
jobs:
connectors_ci:
name: Connectors Version Increment Check
name: Connector Pre-Release Checks
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
if: github.event.pull_request.head.repo.fork != true
if: >
github.event.pull_request.head.repo.fork != true &&
github.event.pull_request.draft == false
timeout-minutes: 22
steps:
- name: Checkout Airbyte
Expand Down Expand Up @@ -51,4 +53,4 @@ jobs:
github_token: ${{ env.PAT }}
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
subcommand: "connectors --modified test --only-step=version_inc_check --global-status-check-context='Version increment check for Java connectors' --global-status-check-description='Checking if java connectors modified in this PR got their version bumped'"
subcommand: "connectors --modified test --only-step=version_inc_check --only-step=qa_checks --global-status-check-context='Connectors Pre-Release Check' --global-status-check-description='Checking if connectors modified in this PR are ready for release'"
2 changes: 1 addition & 1 deletion .github/workflows/connectors_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ jobs:
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
# A connector test can't take more than 5 hours to run (5 * 60 * 60 = 18000 seconds)
subcommand: "connectors --execute-timeout=18000 --modified test"
subcommand: "connectors --execute-timeout=18000 --modified test --skip-step=qa_checks --skip-step=version_inc_check"
4 changes: 3 additions & 1 deletion .github/workflows/format-fix-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"
check-latest: true
update-environment: true
- name: Run pre-commit
uses: pre-commit/[email protected]
continue-on-error: true
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"
check-latest: true
update-environment: true
- name: Run pre-commit
uses: pre-commit/[email protected]
id: format-check
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/live_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: Use the local CDK when building the target connector
default: "false"
type: boolean
disable_proxy:
description: Disable proxy for requests
default: "false"
type: boolean
connection_subset:
description: The subset of connections to select from.
required: true
Expand Down Expand Up @@ -108,6 +112,15 @@ jobs:
echo "READ_WITH_STATE_FLAG=" >> $GITHUB_ENV
fi
- name: Setup Proxy Flag
if: github.event_name == 'workflow_dispatch'
run: |
if ${{ github.event.inputs.disable_proxy }}; then
echo "DISABLE_PROXY_FLAG=--connector_live_tests.disable-proxy" >> $GITHUB_ENV
else
echo "DISABLE_PROXY_FLAG=" >> $GITHUB_ENV
fi
- name: Setup Connection Subset Option
if: github.event_name == 'workflow_dispatch'
run: |
Expand All @@ -129,4 +142,4 @@ jobs:
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=live --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }}
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=live --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.DISABLE_PROXY_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }}
19 changes: 17 additions & 2 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: Use the local CDK when building the target connector
default: "false"
type: boolean
disable_proxy:
description: Disable proxy for requests
default: "false"
type: boolean
connection_subset:
description: The subset of connections to select from.
required: true
Expand All @@ -51,7 +55,9 @@ jobs:
id: install_python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
check-latest: true
update-environment: true

- name: Checkout Airbyte
uses: actions/checkout@v4
Expand Down Expand Up @@ -114,6 +120,15 @@ jobs:
echo "READ_WITH_STATE_FLAG=" >> $GITHUB_ENV
fi
- name: Setup Proxy Flag
if: github.event_name == 'workflow_dispatch'
run: |
if ${{ github.event.inputs.disable_proxy }}; then
echo "DISABLE_PROXY_FLAG=--connector_live_tests.disable-proxy" >> $GITHUB_ENV
else
echo "DISABLE_PROXY_FLAG=" >> $GITHUB_ENV
fi
- name: Setup Connection Subset Option
if: github.event_name == 'workflow_dispatch'
run: |
Expand All @@ -135,4 +150,4 @@ jobs:
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=regression --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }} --global-status-check-context="Regression Tests" --global-status-check-description='Running regression tests'
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=regression --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.DISABLE_PROXY_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }} --global-status-check-context="Regression Tests" --global-status-check-description='Running regression tests'
4 changes: 2 additions & 2 deletions .github/workflows/release-airbyte-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- name: Checkout Airbyte
uses: actions/checkout@v3
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- name: Release Octavia
id: release_octavia
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-performance-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
check-latest: true
update-environment: true
- name: Install CI scripts
run: |
pip install pipx
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/upload-metadata-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
check-latest: true
update-environment: true
- name: Install metadata_service
if: steps.changed-files.outputs.any_changed == 'true'
run: pip install airbyte-ci/connectors/metadata_service/lib
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ repos:

- id: spotless
name: Format Java files with Spotless
entry: bash -c 'command -v mvn >/dev/null 2>&1 || { if [ -z "$CI" ]; then echo "Maven not installed, skipping spotless" >&2; exit 0; fi }; mvn -f spotless-maven-pom.xml spotless:apply'
entry: bash -c 'command -v mvn >/dev/null 2>&1 || { echo "Maven not installed. Install with brew install maven" >&2; exit 1; }; mvn -f spotless-maven-pom.xml spotless:apply'
language: system
files: \.(java|kt|gradle)$
pass_filenames: false
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.11
1 change: 0 additions & 1 deletion .secrets

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tools.pre-commit.install.Linux:

tools.pre-commit.install.Darwin:
@echo "Installing pre-commit with brew..."
@brew install pre-commit
@brew install pre-commit maven
@echo "Pre-commit installation complete"

tools.git-hooks.install: tools.airbyte-ci.install tools.pre-commit.install.$(OS) tools.git-hooks.clean ## Setup pre-commit hooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ interface SourceConfiguration : Configuration, SshTunnelConfiguration {
val maxConcurrency: Int
val resourceAcquisitionHeartbeat: Duration

/** Whether it's a CDC configuration. Default to global state */
fun isCdc(): Boolean {
return global
}

/**
* Micronaut factory which glues [ConfigurationSpecificationSupplier] and
* [SourceConfigurationFactory] together to produce a [SourceConfiguration] singleton.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/* Copyright (c) 2024 Airbyte, Inc., all rights reserved. */
package io.airbyte.cdk.discover

import io.airbyte.cdk.command.SourceConfiguration
import io.airbyte.protocol.models.Field as AirbyteField
import io.airbyte.protocol.models.v0.AirbyteStream
import io.airbyte.protocol.models.v0.CatalogHelpers

/** Stateless object for building an [AirbyteStream] during DISCOVER. */
interface AirbyteStreamFactory {
/** Connector-specific [AirbyteStream] creation logic for GLOBAL-state streams. */
fun createGlobal(discoveredStream: DiscoveredStream): AirbyteStream

/** Connector-specific [AirbyteStream] creation logic for STREAM-state streams. */
fun createNonGlobal(discoveredStream: DiscoveredStream): AirbyteStream
/** Connector-specific [AirbyteStream] creation logic. */
fun create(config: SourceConfiguration, discoveredStream: DiscoveredStream): AirbyteStream

companion object {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ class DiscoverOperation(
val primaryKey: List<List<String>> = metadataQuerier.primaryKey(streamID)
val discoveredStream = DiscoveredStream(streamID, fields, primaryKey)
val airbyteStream: AirbyteStream =
if (config.global) {
airbyteStreamFactory.createGlobal(discoveredStream)
} else {
airbyteStreamFactory.createNonGlobal(discoveredStream)
}
airbyteStreamFactory.create(config, discoveredStream)
airbyteStreams.add(airbyteStream)
}
}
Expand Down
Loading

0 comments on commit a6a4f6b

Please sign in to comment.