Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/unstructured-0.11.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Nov 13, 2024
2 parents 77e1d62 + 998d399 commit cc30c12
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 16 deletions.
57 changes: 48 additions & 9 deletions .github/workflows/connector-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
fail-fast: false
matrix:
include:
- connector: source-hardcoded-records
cdk_extra: n/a
- connector: source-shopify
cdk_extra: n/a
# Currently not passing CI (unrelated)
Expand All @@ -87,31 +89,68 @@ jobs:
if: ${{ matrix.cdk_extra != 'n/a' && needs.cdk_changes.outputs[matrix.cdk_extra] == 'false' }}
run: |
echo "Aborting job as specified extra not changed: ${{matrix.cdk_extra}} = ${{ needs.cdk_changes.outputs[matrix.cdk_extra] }}"
echo "> Skipped '${{matrix.connector}}' (no relevant changes)" >> $GITHUB_STEP_SUMMARY
echo "status=cancelled" >> $GITHUB_OUTPUT
exit 1
exit 0
continue-on-error: true
# Get the monorepo so we can test the connectors
- name: Checkout CDK
if: steps.no_changes.outcome != 'failure'
if: steps.no_changes.outputs.status != 'cancelled'
uses: actions/checkout@v4
with:
path: airbyte-python-cdk
- name: Checkout Airbyte Monorepo
uses: actions/checkout@v4
if: steps.no_changes.outcome != 'failure'
if: steps.no_changes.outputs.status != 'cancelled'
with:
repository: airbytehq/airbyte
ref: master
# TODO: Revert to `master` after Airbyte CI released:
ref: aj/airbyte-ci/update-python-local-cdk-code
path: airbyte
- name: Test Connector
if: steps.no_changes.outcome != 'failure'
if: steps.no_changes.outputs.status != 'cancelled'
timeout-minutes: 90
env:
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
POETRY_DYNAMIC_VERSIONING_BYPASS: "0.0.0"
# TODO: Revert below to use `tools.airbyte-ci-binary.install` after Airbyte CI released:
run: |
cd airbyte
make tools.airbyte-ci-binary.install
airbyte-ci connectors \
make tools.airbyte-ci-dev.install
airbyte-ci-dev connectors \
--name ${{matrix.connector}} \
test
--global-status-check-context='Connectors Test: ${{matrix.connector}}'"
--use-local-cdk \
test \
--fail-fast \
--skip-step qa_checks \
--skip-step connector_live_tests
# Upload the job output to the artifacts
- name: Upload Job Output
id: upload_job_output
if: always() && steps.no_changes.outputs.status != 'cancelled'
uses: actions/upload-artifact@v4
with:
name: ${{matrix.connector}}-job-output
path: airbyte/airbyte-ci/connectors/pipelines/pipeline_reports

- name: Evaluate Job Output
if: always() && steps.no_changes.outputs.status != 'cancelled'
run: |
# save job output json file as ci step output
json_output_file=$(find airbyte/airbyte-ci/connectors/pipelines/pipeline_reports -name 'output.json' -print -quit)
job_output=$(cat ${json_output_file})
success=$(echo ${job_output} | jq -r '.success')
failed_step=$(echo ${job_output} | jq -r '.failed_steps | select(length > 0) | .[0] // "None"')
run_duration=$(echo ${job_output} | jq -r '.run_duration')
echo "## Job Output for ${{matrix.connector}}" >> $GITHUB_STEP_SUMMARY
echo "- Success: ${success}" >> $GITHUB_STEP_SUMMARY
echo "- Test Duration: $(printf "%.0f" ${run_duration})s" >> $GITHUB_STEP_SUMMARY
if [ "${success}" != "true" ]; then
echo "- Failed Step: ${failed_step}" >> $GITHUB_STEP_SUMMARY
fi
echo -e "\n[Download Job Output](${{steps.upload_job_output.outputs.artifact-url}})" >> $GITHUB_STEP_SUMMARY
if [ "${success}" != "true" ]; then
echo "::error::Test failed for connector '${{ matrix.connector }}' on step '${failed_step}'. Check the logs for more details."
exit 1
fi
14 changes: 10 additions & 4 deletions airbyte_cdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,18 @@
"StreamSlice",
]

__version__ = _dunamai.get_version(
"airbyte-cdk",
third_choice=_dunamai.Version.from_any_vcs,
).serialize()
__version__: str
"""Version generated by poetry dynamic versioning during publish.
When running in development, dunamai will calculate a new prerelease version
from existing git release tag info.
"""

try:
__version__ = _dunamai.get_version(
"airbyte-cdk",
third_choice=_dunamai.Version.from_any_vcs,
fallback=_dunamai.Version("0.0.0+dev"),
).serialize()
except:
__version__ = "0.0.0+dev"
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
from __future__ import annotations

from enum import Enum
from typing import Any, Dict, List, Optional, Union
from typing import Any, Dict, List, Literal, Optional, Union

from pydantic.v1 import BaseModel, Extra, Field
from typing_extensions import Literal


class AuthFlowType(Enum):
Expand Down Expand Up @@ -632,6 +631,7 @@ class HttpResponseFilter(BaseModel):
description="Match the response if its HTTP code is included in this list.",
examples=[[420, 429], [500]],
title="HTTP Codes",
unique_items=True,
)
predicate: Optional[str] = Field(
None,
Expand Down
4 changes: 3 additions & 1 deletion bin/generate_component_manifest_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


PIP_DEPENDENCIES = [
"datamodel_code_generator==0.11.19",
"datamodel_code_generator==0.26.3",
]


Expand Down Expand Up @@ -73,6 +73,8 @@ async def main():
"--enum-field-as-literal",
"one",
"--set-default-enum-member",
"--use-double-quotes",
"--remove-special-field-name-prefix",
],
use_entrypoint=True,
)
Expand Down

0 comments on commit cc30c12

Please sign in to comment.