Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/apache/airflow into kalyan/…
Browse files Browse the repository at this point in the history
…AIP-84/model_conf_extra_forbid
  • Loading branch information
rawwar committed Nov 27, 2024
2 parents 3e4bfee + 90442e8 commit 9d36d40
Show file tree
Hide file tree
Showing 996 changed files with 17,173 additions and 5,863 deletions.
7 changes: 6 additions & 1 deletion .devcontainer/mysql/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"rogalmic.bash-debug"
],
"service": "airflow",
"forwardPorts": [8080,5555,5432,6379]
"forwardPorts": [8080,5555,5432,6379],
"workspaceFolder": "/opt/airflow",
// for users who use non-standard git config patterns
// https://github.com/microsoft/vscode-remote-release/issues/2084#issuecomment-989756268
"initializeCommand": "cd \"${localWorkspaceFolder}\" && git config --local user.email \"$(git config user.email)\" && git config --local user.name \"$(git config user.name)\"",
"overrideCommand": true
}
7 changes: 6 additions & 1 deletion .devcontainer/postgres/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"rogalmic.bash-debug"
],
"service": "airflow",
"forwardPorts": [8080,5555,5432,6379]
"forwardPorts": [8080,5555,5432,6379],
"workspaceFolder": "/opt/airflow",
// for users who use non-standard git config patterns
// https://github.com/microsoft/vscode-remote-release/issues/2084#issuecomment-989756268
"initializeCommand": "cd \"${localWorkspaceFolder}\" && git config --local user.email \"$(git config user.email)\" && git config --local user.name \"$(git config user.name)\"",
"overrideCommand": true
}
9 changes: 7 additions & 2 deletions .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ labelPRBasedOnFilePath:
- providers/tests/docker/**/*
- providers/tests/system/docker/**/*

provider:edge:
- providers/src/airflow/providers/edge/**/*
- docs/apache-airflow-providers-edge/**/*
- providers/tests/edge/**/*

provider:elasticsearch:
- providers/src/airflow/providers/elasticsearch/**/*
- docs/apache-airflow-providers-elasticsearch/**/*
Expand Down Expand Up @@ -647,12 +652,12 @@ labelPRBasedOnFilePath:
- airflow/cli/commands/triggerer_command.py
- airflow/jobs/triggerer_job_runner.py
- airflow/models/trigger.py
- airflow/triggers/**/*
- providers/src/airflow/providers/standard/triggers/**/*
- tests/cli/commands/test_triggerer_command.py
- tests/jobs/test_triggerer_job.py
- tests/models/test_trigger.py
- tests/jobs/test_triggerer_job_logging.py
- tests/triggers/**/*
- providers/tests/standard/triggers/**/*

area:Serialization:
- airflow/serialization/**/*
Expand Down
102 changes: 0 additions & 102 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,108 +153,6 @@ jobs:
env:
FORCE_COLOR: 2

test-openapi-client:
timeout-minutes: 10
name: "Test OpenAPI client"
runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
if: inputs.needs-api-codegen == 'true'
steps:
- name: "Cleanup repo"
shell: bash
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: false
- name: "Cleanup docker"
run: ./scripts/ci/cleanup_docker.sh
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
repository: "apache/airflow-client-python"
fetch-depth: 1
persist-credentials: false
path: ./airflow-client-python
- name: "Install Breeze"
uses: ./.github/actions/breeze
- name: "Generate client with breeze"
run: >
breeze release-management prepare-python-client --package-format both
--version-suffix-for-pypi dev0 --python-client-repo ./airflow-client-python
- name: "Show diff"
run: git diff --color HEAD
working-directory: ./airflow-client-python
- name: Install hatch
run: |
python -m pip install --upgrade uv
uv tool install hatch
- name: Run tests
run: hatch run run-coverage
env:
HATCH_ENV: "test"
working-directory: ./clients/python
- name: "Install source version of required packages"
run: |
breeze release-management prepare-provider-packages \
fab \
standard \
common.sql \
sqlite \
--package-format wheel \
--skip-tag-check \
--version-suffix-for-pypi dev0
pip install . \
dist/apache_airflow_providers_fab-*.whl \
dist/apache_airflow_providers_standard-*.whl \
dist/apache_airflow_providers_common_sql-*.whl \
dist/apache_airflow_providers_sqlite-*.whl
breeze release-management prepare-task-sdk-package --package-format wheel
pip install ./dist/apache_airflow_task_sdk-*.whl
- name: "Install Python client"
run: pip install ./dist/apache_airflow_client-*.whl
- name: "Initialize Airflow DB and start webserver"
run: |
airflow db init
# Let scheduler runs a few loops and get all DAG files from example DAGs serialized to DB
airflow scheduler --num-runs 100
airflow users create --username admin --password admin --firstname Admin --lastname Admin \
--role Admin --email [email protected]
killall python || true # just in case there is a webserver running in the background
nohup airflow webserver --port 8080 &
echo "Started webserver"
env:
AIRFLOW__API__AUTH_BACKENDS: >-
airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "True"
AIRFLOW__CORE__LOAD_EXAMPLES: "True"
AIRFLOW_HOME: "${{ github.workspace }}/airflow_home"
- name: "Waiting for the webserver to be available"
run: |
timeout 30 bash -c 'until nc -z $0 $1; do echo "sleeping"; sleep 1; done' localhost 8080
sleep 5
- name: "Run test python client"
run: python ./clients/python/test_python_client.py
env:
FORCE_COLOR: "standard"
- name: "Stop running webserver"
run: killall python || true # just in case there is a webserver running in the background
if: always()
- name: "Upload python client packages"
uses: actions/upload-artifact@v4
with:
name: python-client-packages
path: ./dist/apache_airflow_client-*
retention-days: 7
if-no-files-found: error
- name: "Upload logs from failed tests"
uses: actions/upload-artifact@v4
if: failure()
with:
name: python-client-failed-logs
path: "${{ github.workspace }}/airflow_home/logs"
retention-days: 7

# Those checks are run if no image needs to be built for checks. This is for simple changes that
# Do not touch any of the python code or any of the important files that might require building
# The CI Docker image and they can be run entirely using the pre-commit virtual environments on host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
#
---
name: Static checks, mypy, docs
name: CI Image Checks
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
Expand Down Expand Up @@ -96,6 +96,19 @@ on: # yamllint disable-line rule:truthy
description: "Whether to build docs (true/false)"
required: true
type: string
needs-api-codegen:
description: "Whether to run API codegen (true/false)"
required: true
type: string
default-postgres-version:
description: "The default version of the postgres to use"
required: true
type: string
run-coverage:
description: "Whether to run coverage or not (true/false)"
required: true
type: string

jobs:
static-checks:
timeout-minutes: 45
Expand Down Expand Up @@ -304,3 +317,50 @@ jobs:
- name: "Upload documentation to AWS S3"
if: inputs.branch == 'main'
run: aws s3 sync --delete ./docs/_build s3://apache-airflow-docs

test-python-api-client:
timeout-minutes: 60
name: "Test Python API client"
runs-on: ${{ fromJSON(inputs.runs-on-as-json-default) }}
if: inputs.needs-api-codegen == 'true'
env:
BACKEND: "postgres"
BACKEND_VERSION: "${{ inputs.default-postgres-version }}"
DEBUG_RESOURCES: "${{ inputs.debug-resources }}"
ENABLE_COVERAGE: "${{ inputs.run-coverage }}"
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
IMAGE_TAG: "${{ inputs.image-tag }}"
JOB_ID: "python-api-client-tests"
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
VERBOSE: "true"
steps:
- name: "Cleanup repo"
shell: bash
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: false
- name: "Cleanup docker"
run: ./scripts/ci/cleanup_docker.sh
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
repository: "apache/airflow-client-python"
fetch-depth: 1
persist-credentials: false
path: ./airflow-client-python
- name: "Prepare breeze & CI image: ${{inputs.default-python-version}}:${{inputs.image-tag}}"
uses: ./.github/actions/prepare_breeze_and_image
- name: "Generate airflow python client"
run: >
breeze release-management prepare-python-client --package-format both
--version-suffix-for-pypi dev0 --python-client-repo ./airflow-client-python
- name: "Show diff"
run: git diff --color HEAD
working-directory: ./airflow-client-python
- name: "Python API client tests"
run: breeze testing python-api-client-tests
21 changes: 13 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ jobs:
postgres-exclude: ${{ steps.selective-checks.outputs.postgres-exclude }}
postgres-versions: ${{ steps.selective-checks.outputs.postgres-versions }}
prod-image-build: ${{ steps.selective-checks.outputs.prod-image-build }}
providers-compatibility-checks: ${{ steps.selective-checks.outputs.providers-compatibility-checks }}
# yamllint disable rule:line-length
providers-compatibility-tests-matrix: ${{ steps.selective-checks.outputs.providers-compatibility-tests-matrix }}
providers-test-types-list-as-string: >-
${{ steps.selective-checks.outputs.providers-test-types-list-as-string }}
pull-request-labels: ${{ steps.source-run-info.outputs.pr-labels }}
Expand Down Expand Up @@ -296,10 +297,10 @@ jobs:
chicken-egg-providers: ${{ needs.build-info.outputs.chicken-egg-providers }}
debug-resources: ${{ needs.build-info.outputs.debug-resources }}

static-checks-mypy-docs:
name: "Static checks, mypy, docs"
ci-image-checks:
name: "CI image checks"
needs: [build-info, wait-for-ci-images]
uses: ./.github/workflows/static-checks-mypy-docs.yml
uses: ./.github/workflows/ci-image-checks.yml
secrets: inherit
with:
runs-on-as-json-default: ${{ needs.build-info.outputs.runs-on-as-json-default }}
Expand All @@ -321,10 +322,13 @@ jobs:
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
debug-resources: ${{ needs.build-info.outputs.debug-resources }}
docs-build: ${{ needs.build-info.outputs.docs-build }}
needs-api-codegen: ${{ needs.build-info.outputs.needs-api-codegen }}
default-postgres-version: ${{ needs.build-info.outputs.default-postgres-version }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}

providers:
name: "Provider checks"
uses: ./.github/workflows/check-providers.yml
name: "Provider packages tests"
uses: ./.github/workflows/test-provider-packages.yml
needs: [build-info, wait-for-ci-images]
permissions:
contents: read
Expand All @@ -340,7 +344,8 @@ jobs:
default-python-version: ${{ needs.build-info.outputs.default-python-version }}
upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
selected-providers-list-as-string: ${{ needs.build-info.outputs.selected-providers-list-as-string }}
providers-compatibility-checks: ${{ needs.build-info.outputs.providers-compatibility-checks }}
# yamllint disable rule:line-length
providers-compatibility-tests-matrix: ${{ needs.build-info.outputs.providers-compatibility-tests-matrix }}
skip-providers-tests: ${{ needs.build-info.outputs.skip-providers-tests }}
python-versions: ${{ needs.build-info.outputs.python-versions }}
providers-test-types-list-as-string: ${{ needs.build-info.outputs.providers-test-types-list-as-string }}
Expand Down Expand Up @@ -700,7 +705,7 @@ jobs:
- generate-constraints
- wait-for-ci-images
- wait-for-prod-images
- static-checks-mypy-docs
- ci-image-checks
- tests-sqlite
- tests-mysql
- tests-postgres
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
name: "CodeQL"

on: # yamllint disable-line rule:truthy
pull_request:
branches: ['main', 'v[0-9]+-[0-9]+-test', 'v[0-9]+-[0-9]+-stable']
push:
branches: [main]
schedule:
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/news-fragment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# needs a non-shallow clone.
fetch-depth: 0

- name: Check news fragment
- name: Check news fragment existence
run: >
python -m pip install --upgrade uv &&
uv tool run towncrier check
Expand All @@ -52,3 +52,26 @@ jobs:
&&
false
; }
- name: Check news fragment contains change types
run: >
change_types=(
'DAG changes'
'Config changes'
'API changes'
'CLI changes'
'Behaviour changes'
'Plugin changes'
'Dependency change'
)
news_fragment_content=`git diff origin/${{ github.base_ref }} newsfragments/*.significant.rst`
for type in "${change_types[@]}"; do
if [[ $news_fragment_content != *"$type"* ]]; then
printf "\033[1;33mMissing change type '$type' in significant newsfragment for PR labeled with
'airflow3.0:breaking'.\nCheck
https://github.com/apache/airflow/blob/main/contributing-docs/16_contribution_workflow.rst
for guidance.\033[m\n"
exit 1
fi
done
1 change: 1 addition & 0 deletions .github/workflows/special-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ on: # yamllint disable-line rule:truthy
description: "Whether to debug resources or not (true/false)"
required: true
type: string

jobs:
tests-min-sqlalchemy:
name: "Min SQLAlchemy test"
Expand Down
Loading

0 comments on commit 9d36d40

Please sign in to comment.