Skip to content

Commit a86b9b3

Browse files
committed
Merge branch 'main' into dbgold17/refactor-cdk-oauth
2 parents 720244a + 13a38db commit a86b9b3

File tree

264 files changed

+19493
-2211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+19493
-2211
lines changed

.github/workflows/connector-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ concurrency:
2525
jobs:
2626
cdk_changes:
2727
name: Get Changes
28-
runs-on: ubuntu-22.04
28+
runs-on: ubuntu-24.04
2929
permissions:
3030
statuses: write
3131
pull-requests: read
@@ -62,7 +62,7 @@ jobs:
6262
# Forked PRs are handled by the community_ci.yml workflow
6363
# If the condition is not met the job will be skipped (it will not fail)
6464
# runs-on: connector-test-large
65-
runs-on: ubuntu-22.04
65+
runs-on: ubuntu-24.04
6666
timeout-minutes: 360 # 6 hours
6767
strategy:
6868
fail-fast: false
@@ -75,11 +75,11 @@ jobs:
7575
# Chargebee is being flaky:
7676
# - connector: source-chargebee
7777
# cdk_extra: n/a
78-
# These two are behind in CDK updates and can't be used as tests until they are updated:
79-
# - connector: source-s3
80-
# cdk_extra: file-based
78+
# This one is behind in CDK updates and can't be used as tests until it is updated:
8179
# - connector: destination-pinecone
8280
# cdk_extra: vector-db-based
81+
- connector: source-google-drive
82+
cdk_extra: file-based
8383
- connector: destination-motherduck
8484
cdk_extra: sql
8585
# ZenDesk currently failing (as of 2024-12-02)
@@ -96,7 +96,7 @@ jobs:
9696
name: "Check: '${{matrix.connector}}' (skip=${{needs.cdk_changes.outputs['src'] == 'false' || needs.cdk_changes.outputs[matrix.cdk_extra] == 'false'}})"
9797
permissions:
9898
checks: write
99-
contents: write # Required for creating commit statuses
99+
contents: write # Required for creating commit statuses
100100
pull-requests: read
101101
steps:
102102
- name: Abort if extra not changed (${{matrix.cdk_extra}})
@@ -153,7 +153,7 @@ jobs:
153153
POETRY_DYNAMIC_VERSIONING_BYPASS: "0.0.0"
154154
run: |
155155
cd airbyte
156-
make tools.airbyte-ci-dev.install
156+
make tools.airbyte-ci.install
157157
airbyte-ci \
158158
--ci-report-bucket-name=airbyte-ci-reports-multi \
159159
connectors \
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker Build Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
docker-build-check:
10+
name: SDM Docker Image Build # Renamed job to be more descriptive
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
# Build the Python package to create the wheel files needed for the Docker build
19+
- name: Build Python Package
20+
uses: hynek/build-and-inspect-python-package@v2
21+
env:
22+
POETRY_DYNAMIC_VERSIONING_BYPASS: "0.0.0dev0"
23+
24+
# Copy the wheel files to the dist directory
25+
- name: Copy wheel files to dist directory
26+
run: |
27+
mkdir -p dist
28+
cp /tmp/baipp/dist/*.whl dist/
29+
30+
- name: Set up QEMU for multi-platform builds
31+
uses: docker/setup-qemu-action@v3
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Build Docker image for multiple platforms
37+
id: docker-build
38+
uses: docker/build-push-action@v5
39+
with:
40+
context: .
41+
platforms: linux/amd64,linux/arm64
42+
push: false
43+
tags: airbyte/source-declarative-manifest:pr-${{ github.event.pull_request.number }}
44+
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=SDM Docker image for PR ${{ github.event.pull_request.number }}

.github/workflows/poe-command.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: On-Demand Poe Task
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
comment-id:
7+
description: "Optional comment-id of the slash command. Ignore if not applicable."
8+
required: false
9+
pr:
10+
description: "PR Number"
11+
required: false
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
run-poe-command:
19+
env:
20+
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Run Poe Slash Command Processor
24+
uses: aaronsteers/poe-command-processor@v1
25+
with:
26+
pr: ${{ github.event.inputs.pr }}
27+
comment-id: ${{ github.event.inputs.comment-id }}
28+
github-token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}

.github/workflows/pypi_publish.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Note: We may want to rename this file at some point. However, if we rename the workflow file name,
66
# we have to also update the Trusted Publisher settings on PyPI.
77

8-
name: Packaging and Publishing
8+
name: CDK Publish
99

1010
on:
1111
push:
@@ -14,7 +14,12 @@ on:
1414
workflow_dispatch:
1515
inputs:
1616
version:
17-
description: "Note that this workflow is intended for prereleases. For public-facing stable releases, please use the GitHub Releases workflow instead: https://github.com/airbytehq/airbyte-python-cdk/blob/main/docs/RELEASES.md. If running this workflow from main or from a dev branch, please enter the desired version number here, for instance 1.2.3dev0 or 1.2.3rc1."
17+
description: >
18+
Note that this workflow is intended for prereleases. For public-facing stable releases,
19+
please use the GitHub Releases workflow instead:
20+
https://github.com/airbytehq/airbyte-python-cdk/blob/main/docs/RELEASES.md.
21+
For prereleases, please leave the version blank to use the detected version. Alternatively,
22+
you can override the dynamic versioning for special use cases.
1823
required: false
1924
publish_to_pypi:
2025
description: "Publish to PyPI. If true, the workflow will publish to PyPI."
@@ -37,17 +42,29 @@ jobs:
3742
name: Build Python Package
3843
runs-on: ubuntu-24.04
3944
steps:
40-
- name: Detect Release Tag Version
45+
- name: Checkout CDK Repo
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Detect Prerelease Version using Dunamai
51+
uses: mtkennerly/dunamai-action@v1
52+
with:
53+
args: --format "{base}.post{distance}.dev${{ github.run_id }}"
54+
env-var: DETECTED_VERSION
55+
56+
- name: Detect Release Tag Version from git ref ('${{ github.ref_name }}')
4157
if: startsWith(github.ref, 'refs/tags/v')
4258
run: |
59+
echo "Overriding Dunamai detected version: '${{ env.DETECTED_VERSION || 'none' }}'"
60+
# Extract the version from the git ref
4361
DETECTED_VERSION=${{ github.ref_name }}
44-
echo "Version ref set to '${DETECTED_VERSION}'"
4562
# Remove the 'v' prefix if it exists
4663
DETECTED_VERSION="${DETECTED_VERSION#v}"
47-
echo "Setting version to '$DETECTED_VERSION'"
64+
echo "Setting detected version to '$DETECTED_VERSION'"
4865
echo "DETECTED_VERSION=${DETECTED_VERSION}" >> $GITHUB_ENV
4966
50-
- name: Validate and set VERSION from git ref ('${{ github.ref_name }}') and input (${{ github.event.inputs.version || 'none' }})
67+
- name: Validate and set VERSION (detected='${{ env.DETECTED_VERSION }}', input='${{ github.event.inputs.version || 'none' }}')
5168
id: set_version
5269
run: |
5370
INPUT_VERSION=${{ github.event.inputs.version }}
@@ -62,8 +79,8 @@ jobs:
6279
INPUT_VERSION="${INPUT_VERSION#v}"
6380
# Fail if detected version is non-empty and different from the input version
6481
if [ -n "${DETECTED_VERSION:-}" ] && [ -n "${INPUT_VERSION:-}" ] && [ "${DETECTED_VERSION}" != "${INPUT_VERSION}" ]; then
65-
echo "Error: Version input '${INPUT_VERSION}' does not match detected version '${DETECTED_VERSION}'."
66-
exit 1
82+
echo "Warning: Version input '${INPUT_VERSION}' does not match detected version '${DETECTED_VERSION}'."
83+
echo "Using input version '${INPUT_VERSION}' instead."
6784
fi
6885
# Set the version to the input version if non-empty, otherwise the detected version
6986
VERSION="${INPUT_VERSION:-$DETECTED_VERSION}"
@@ -84,10 +101,6 @@ jobs:
84101
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
85102
fi
86103
87-
- uses: actions/checkout@v4
88-
with:
89-
fetch-depth: 0
90-
91104
- uses: hynek/build-and-inspect-python-package@v2
92105
env:
93106
# Pass in the evaluated version from the previous step
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Dependency Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "airbyte_cdk/**"
9+
- "poetry.lock"
10+
- "pyproject.toml"
11+
pull_request:
12+
paths:
13+
- "airbyte_cdk/**"
14+
- "poetry.lock"
15+
- "pyproject.toml"
16+
17+
jobs:
18+
dependency-analysis:
19+
name: Dependency Analysis with Deptry
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.10"
28+
- name: Set up Poetry
29+
uses: Gr1N/setup-poetry@v9
30+
with:
31+
poetry-version: "2.0.1"
32+
- name: Install dependencies
33+
run: poetry install --all-extras
34+
35+
# Job-specific step(s):
36+
- name: Run Deptry
37+
run: |
38+
poetry run deptry .

.github/workflows/semantic_pr_check.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ jobs:
3939
Build
4040
tests
4141
Tests
42+
43+
- name: Check for "do not merge" in PR title
44+
if: ${{ github.event.pull_request.draft == false }}
45+
uses: actions/github-script@v6
46+
with:
47+
script: |
48+
const title = context.payload.pull_request.title.toLowerCase();
49+
if (title.includes('do not merge') || title.includes('do-not-merge')) {
50+
core.setFailed('PR title contains "do not merge" or "do-not-merge". Please remove this before merging.');
51+
}

.github/workflows/slash_command_dispatch.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ on:
66

77
jobs:
88
slashCommandDispatch:
9-
# Only allow slash commands on pull request (not on issues)
10-
if: ${{ github.event.issue.pull_request }}
119
runs-on: ubuntu-24.04
1210
steps:
1311
- name: Slash Command Dispatch
@@ -19,17 +17,25 @@ jobs:
1917
repository: ${{ github.repository }}
2018
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
2119
dispatch-type: workflow
22-
issue-type: pull-request
20+
issue-type: both
21+
22+
# Only run for users with 'write' permission on the main repository
23+
permission: write
24+
2325
commands: |
2426
autofix
2527
test
2628
poetry-lock
29+
poe
30+
31+
# Notes regarding static-args:
32+
# - Slash commands can be invoked from both issues and comments.
33+
# - If the slash command is invoked from an issue, we intentionally pass 'null' as the PR number.
34+
# - Comment ID will always be sent, and this is sufficient to post back status updates to the originating comment.
2735
static-args: |
28-
pr=${{ github.event.issue.number }}
36+
pr=${{ github.event.issue.pull_request != null && github.event.issue.number || '' }}
2937
comment-id=${{ github.event.comment.id }}
3038
31-
# Only run for users with 'write' permission on the main repository
32-
permission: write
3339
3440
- name: Edit comment with error message
3541
if: steps.dispatch.outputs.error-message
@@ -51,7 +57,7 @@ jobs:
5157
- \`/test\` - Runs the test suite
5258
- \`/poetry-lock\` - Re-locks dependencies and updates the poetry.lock file
5359
- \`/help\` - Shows this help message"
54-
60+
5561
if [[ "${{ github.event.comment.body }}" == "/help" ]]; then
5662
echo "body=$HELP_TEXT" >> $GITHUB_OUTPUT
5763
else

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ dist
1515
.idea
1616
.vscode
1717
**/__pycache__
18+
.tmp

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
- id: check-toml
3737

3838
- repo: https://github.com/astral-sh/ruff-pre-commit
39-
rev: v0.8.3
39+
rev: v0.11.5
4040
hooks:
4141
# Run the linter with repo-defined settings
4242
- id: ruff

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# A new version of source-declarative-manifest is built for every new Airbyte CDK release, and their versions are kept in sync.
66
#
77

8-
FROM docker.io/airbyte/python-connector-base:3.0.0@sha256:1a0845ff2b30eafa793c6eee4e8f4283c2e52e1bbd44eed6cb9e9abd5d34d844
8+
FROM docker.io/airbyte/python-connector-base:4.0.0@sha256:d9894b6895923b379f3006fa251147806919c62b7d9021b5cd125bb67d7bbe22
99

1010
WORKDIR /airbyte/integration_code
1111

@@ -24,8 +24,8 @@ RUN pip install dist/*.whl
2424
RUN mkdir -p source_declarative_manifest \
2525
&& echo 'from source_declarative_manifest.run import run\n\nif __name__ == "__main__":\n run()' > main.py \
2626
&& touch source_declarative_manifest/__init__.py \
27-
&& cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/_run.py source_declarative_manifest/run.py \
28-
&& cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/spec.json source_declarative_manifest/
27+
&& cp /usr/local/lib/python3.11/site-packages/airbyte_cdk/cli/source_declarative_manifest/_run.py source_declarative_manifest/run.py \
28+
&& cp /usr/local/lib/python3.11/site-packages/airbyte_cdk/cli/source_declarative_manifest/spec.json source_declarative_manifest/
2929

3030
# Remove unnecessary build files
3131
RUN rm -rf dist/ pyproject.toml poetry.lock README.md

0 commit comments

Comments
 (0)