Skip to content

Commit 51d1353

Browse files
authored
Move source-declarative-manifest to a standard source, published in step with python cdk (#36501)
1 parent a750e46 commit 51d1353

File tree

22 files changed

+1319
-589
lines changed

22 files changed

+1319
-589
lines changed

.github/workflows/publish-cdk-command-manually.yml

+51-87
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,6 @@ concurrency:
2828
cancel-in-progress: false
2929

3030
jobs:
31-
# We are using these runners because they are the same as the one for `publish-command.yml`
32-
# One problem we had using `ubuntu-latest` for example is that the user is not root and some commands would fail in
33-
# `manage.sh` (specifically `apt-get`)
34-
start-publish-docker-image-runner-0:
35-
name: Start Build EC2 Runner 0
36-
runs-on: ubuntu-latest
37-
outputs:
38-
label: ${{ steps.start-ec2-runner.outputs.label }}
39-
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
40-
steps:
41-
- name: Checkout Airbyte
42-
uses: actions/checkout@v3
43-
with:
44-
repository: airbytehq/airbyte
45-
ref: master
46-
- name: Check PAT rate limits
47-
run: |
48-
./tools/bin/find_non_rate_limited_PAT \
49-
${{ secrets.GH_PAT_BUILD_RUNNER_OSS }} \
50-
${{ secrets.GH_PAT_BUILD_RUNNER_BACKUP }}
51-
- name: Start AWS Runner
52-
id: start-ec2-runner
53-
uses: ./.github/actions/start-aws-runner
54-
with:
55-
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
56-
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
57-
github-token: ${{ env.PAT }}
58-
label: ${{ github.run_id }}-publisher
59-
6031
build-cdk:
6132
runs-on: ubuntu-latest
6233
steps:
@@ -127,14 +98,10 @@ jobs:
12798
repository: ${{ github.event.inputs.repo }}
12899
ref: ${{ github.event.inputs.gitref }}
129100
token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
130-
- name: "Publish Python CDK: bump version"
101+
- name: "Publish Python CDK: bump Poetry package version"
131102
id: bumpversion
132103
run: |
133104
cd airbyte-cdk/python
134-
# Bump docker image version
135-
# TODO: this should not be necessary, as it's the source-declarative-manifest one which should be published separately
136-
pip install bumpversion
137-
bumpversion ${{ github.event.inputs.release-type }}
138105
# Bump package version
139106
poetry version ${{ github.event.inputs.release-type }}
140107
new_version="$(poetry version -s)"
@@ -143,8 +110,8 @@ jobs:
143110
- name: Commit and Push Changes
144111
uses: stefanzweifel/git-auto-commit-action@v4
145112
with:
146-
file_pattern: airbyte-cdk/python/pyproject.toml airbyte-cdk/python/.bumpversion.cfg airbyte-cdk/python/CHANGELOG.md airbyte-cdk/python/Dockerfile
147-
commit_message: 🤖 Bump ${{ github.event.inputs.release-type }} version of Python CDK
113+
file_pattern: airbyte-cdk/python/pyproject.toml airbyte-cdk/python/CHANGELOG.md
114+
commit_message: 🤖 ${{ github.event.inputs.release-type }} bump Python CDK to version $NEW_VERSION
148115
commit_user_name: Octavia Squidington III
149116
commit_user_email: [email protected]
150117
- name: Post failure to Slack channel dev-connectors-extensibility
@@ -221,34 +188,54 @@ jobs:
221188
env:
222189
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
223190

224-
publish-docker-image:
225-
timeout-minutes: 240
191+
bump-manifest-source:
192+
name: Bump CDK dependency of source-declarative-manifest
226193
needs:
227-
- start-publish-docker-image-runner-0
194+
- bump-version
228195
- publish-cdk
229-
runs-on: runner-pool-${{ github.run_id }}
196+
runs-on: ubuntu-latest
230197
steps:
198+
- uses: actions/setup-python@v4
199+
with:
200+
python-version: "3.10"
201+
- name: Install Poetry
202+
id: install_poetry
203+
uses: snok/install-poetry@v1
231204
- name: Checkout Airbyte
232205
uses: actions/checkout@v3
233206
with:
234-
repository: airbytehq/airbyte
207+
repository: ${{ github.event.inputs.repo }}
235208
ref: ${{ github.event.inputs.gitref }}
236-
- name: Install Python
237-
uses: actions/setup-python@v4
209+
- name: Bump CDK dependency of source-declarative-manifest
210+
run: |
211+
cd airbyte-integrations/connectors/source-declarative-manifest
212+
poetry add airbyte-cdk==${{needs.bump-version.outputs.new_cdk_version}}
213+
- name: Bump version of source-declarative-manifest
214+
uses: ./.github/actions/run-airbyte-ci
238215
with:
239-
python-version: "3.10"
240-
- name: Publish source-declarative-manifest
241-
id: publish
242-
env:
243-
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
244-
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
245-
# Oracle expects this variable to be set. Although usually present, this is not set by default on Github virtual runners.
246-
TZ: UTC
247-
uses: Wandalen/[email protected]
216+
context: "master" # TODO: figure out why changing this yells with `The ci_gcs_credentials was not set on this PipelineContext.`
217+
dagger_cloud_token: ${{ secrets.DAGGER_CLOUD_TOKEN_2 }}
218+
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
219+
docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
220+
gcp_gsm_credentials: ${{ secrets.GCP_GSM_CREDENTIALS }}
221+
gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }}
222+
github_token: ${{ secrets.GITHUB_TOKEN }}
223+
metadata_service_gcs_credentials: ${{ secrets.METADATA_SERVICE_PROD_GCS_CREDENTIALS }}
224+
sentry_dsn: ${{ secrets.SENTRY_AIRBYTE_CI_DSN }}
225+
slack_webhook_url: ${{ secrets.PUBLISH_ON_MERGE_SLACK_WEBHOOK }}
226+
spec_cache_gcs_credentials: ${{ secrets.SPEC_CACHE_SERVICE_ACCOUNT_KEY_PUBLISH }}
227+
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
228+
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
229+
# There is no pull request number as we do this manually, so will just reference when we started doing it manually for now
230+
subcommand: "connectors --concurrency=1 --execute-timeout=3600 --name=source-declarative-manifest bump_version ${{ github.event.inputs.release-type }} '36501' 'Bump CDK version to ${{ steps.bumpversion.outputs.NEW_VERSION }}'"
231+
python_registry_token: ${{ secrets.PYPI_TOKEN }}
232+
- name: Commit and Push Changes
233+
uses: stefanzweifel/git-auto-commit-action@v4
248234
with:
249-
command: |
250-
docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD}
251-
./tools/integrations/manage.sh publish airbyte-cdk/python false
235+
file_pattern: docs/integrations/sources/low-code.md airbyte-integrations/connectors/source-declarative-manifest/*
236+
commit_message: 🤖 Cut version ${{needs.bump-version.outputs.new_cdk_version}} of source-declarative-manifest
237+
commit_user_name: Octavia Squidington III
238+
commit_user_email: [email protected]
252239
- name: Post failure to Slack channel dev-connectors-extensibility
253240
if: ${{ failure() }}
254241
uses: slackapi/[email protected]
@@ -257,13 +244,20 @@ jobs:
257244
channel-id: C04J1M66D8B
258245
payload: |
259246
{
260-
"text": "Error during `publish-docker-image` while publishing Python CDK!",
247+
"text": ":warning: A new version of Python CDK has been released but Connector Builder hasn't been automatically updated",
261248
"blocks": [
262249
{
263250
"type": "section",
264251
"text": {
265252
"type": "mrkdwn",
266-
"text": "Error while publishing Docker image following Python CDK release!"
253+
"text": "A new version of Python CDK has been released with <https://github.com/airbytehq/airbyte/blob/master/airbyte-cdk/python/CHANGELOG.md|changelog>: ${{ github.event.inputs.changelog-message }}\n\n"
254+
}
255+
},
256+
{
257+
"type": "section",
258+
"text": {
259+
"type": "mrkdwn",
260+
"text": ":warning: Could not automatically create a PR for Connector Builder>\n"
267261
}
268262
},
269263
{
@@ -382,33 +376,3 @@ jobs:
382376
}
383377
env:
384378
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
385-
386-
# In case of self-hosted EC2 errors, remove this block.
387-
stop-publish-docker-image-runner-0:
388-
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
389-
name: Stop Build EC2 Runner
390-
needs:
391-
- start-publish-docker-image-runner-0 # required to get output from the start-runner job
392-
- publish-docker-image # required to wait when the main job is done
393-
runs-on: ubuntu-latest
394-
steps:
395-
- name: Configure AWS credentials
396-
uses: aws-actions/configure-aws-credentials@v1
397-
with:
398-
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
399-
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
400-
aws-region: us-east-2
401-
- name: Checkout Airbyte
402-
uses: actions/checkout@v3
403-
- name: Check PAT rate limits
404-
run: |
405-
./tools/bin/find_non_rate_limited_PAT \
406-
${{ secrets.GH_PAT_BUILD_RUNNER_OSS }} \
407-
${{ secrets.GH_PAT_BUILD_RUNNER_BACKUP }}
408-
- name: Stop EC2 runner
409-
uses: airbytehq/[email protected]
410-
with:
411-
mode: stop
412-
github-token: ${{ env.PAT }}
413-
label: ${{ needs.start-publish-docker-image-runner-0.outputs.label }}
414-
ec2-instance-id: ${{ needs.start-publish-docker-image-runner-0.outputs.ec2-instance-id }}

.github/workflows/slash-commands.yml

-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ jobs:
2323
permission: write
2424
commands: |
2525
test
26-
legacy-test
2726
test-performance
28-
publish
2927
publish-java-cdk
30-
legacy-publish
3128
connector-performance
3229
static-args: |
3330
repo=${{ steps.getref.outputs.repo }}

airbyte-cdk/python/.bumpversion.cfg

-5
This file was deleted.

airbyte-cdk/python/Dockerfile

-36
This file was deleted.

airbyte-cdk/python/source_declarative_manifest/README.md

-50
This file was deleted.

airbyte-cdk/python/source_declarative_manifest/main.py

-29
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# THIS STOPS SOME MODELS TESTS FROM FALLING OVER. IT'S A HACK, WE SHOULD PIN DOWN WHAT'S ACTUALLY GOING ON HERE
2+
3+
# Import the thing that needs to be imported to stop the tests from falling over
4+
from airbyte_cdk.sources.declarative.manifest_declarative_source import ManifestDeclarativeSource
5+
# "Use" the thing so that the linter doesn't complain
6+
placeholder = ManifestDeclarativeSource

0 commit comments

Comments
 (0)