Skip to content

Add Airflow 3.3 to CI test matrix#840

Open
pankajastro wants to merge 3 commits into
mainfrom
airflow-3.3-test-matrix
Open

Add Airflow 3.3 to CI test matrix#840
pankajastro wants to merge 3 commits into
mainfrom
airflow-3.3-test-matrix

Conversation

@pankajastro

Copy link
Copy Markdown
Contributor

Summary

  • Add Airflow 3.3 to the hatch test-env matrix (pyproject.toml) and the CI workflow's unit/integration test matrices (.github/workflows/cicd.yaml), plus a matching install branch in scripts/test/pre-install-airflow.sh.
  • Fix two version-drift breaks found by actually running the suite against Airflow 3.3:
    • DagBag.__init__ dropped the include_examples kwarg in Airflow 3.3 — dev/tests/dags/test_dag_example.py now checks the signature before passing it, so it still works on 2.9–3.2 too.
    • Airflow 3.3's constraints pull in typer 0.25, which reformatted the CLI's Usage: line (COMMAND [ARGS][COMMAND] [ARGS]...) — the assertion in tests/test__main__.py now checks stable substrings instead of the exact string.

Test plan

  • hatch run tests.py3.13-3.3:test — 293 passed
  • hatch run tests.py3.12-3.3:test — 293 passed
  • hatch run tests.py3.13-3.2:test — 293 passed (no regression)

🤖 Generated with Claude Code

Adds "3.3" alongside the existing Airflow versions in the hatch test-env
matrix and the CI workflow's unit/integration test matrices, plus a
matching install branch in pre-install-airflow.sh.

Also fixes two version-drift breaks surfaced by running against 3.3:
- DagBag.__init__ dropped the `include_examples` kwarg in Airflow 3.3,
  so dev/tests/dags/test_dag_example.py now checks the signature before
  passing it.
- Airflow 3.3's constraints pull in typer 0.25, which changed the CLI's
  "Usage:" line formatting; the help-text assertion in test__main__.py
  now checks the stable substrings instead of the exact string.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 07:22
@pankajastro
pankajastro requested review from a team and gyli as code owners July 17, 2026 07:22
@pankajastro
pankajastro requested review from pankajkoti and tatiana and removed request for a team July 17, 2026 07:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends dag-factory’s CI and Hatch test matrices to include Apache Airflow 3.3, and updates a couple of tests to remain stable across upstream behavior/format changes introduced by Airflow 3.3’s dependency set.

Changes:

  • Add Airflow 3.3 to the Hatch test matrix in pyproject.toml and to the unit/integration job matrices in .github/workflows/cicd.yaml.
  • Update the Airflow pre-install script to install apache-airflow~=3.3.0 when AIRFLOW_VERSION=3.3.
  • Fix test brittleness across versions:
    • Make DagBag(...) construction compatible with Airflow 3.3 by conditionally passing include_examples.
    • Relax CLI help output assertion to avoid Typer-version-specific Usage: formatting drift.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test__main__.py Makes CLI help test resilient to Typer Usage: formatting differences pulled in via Airflow 3.3 constraints.
scripts/test/pre-install-airflow.sh Adds an install branch for Airflow 3.3 while continuing to use Airflow constraints.
pyproject.toml Extends Hatch matrix to run tests against Airflow 3.3 across supported Python versions.
dev/tests/dags/test_dag_example.py Keeps example DAG test compatible by only passing include_examples when supported.
.github/workflows/cicd.yaml Expands CI unit + integration matrices to include Airflow 3.3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- tests/test__main__.py: CI renders typer's help output with ANSI color
  codes that split "Usage: " and "dagfactory" into separate spans, so the
  combined substring check failed there even though it passed locally
  without color. Check the pieces independently instead.
- tests/test_example_dags.py: Airflow 3.3 made create_default_connections()
  session argument keyword-only, and also dropped DagBag's
  include_examples kwarg (same issue already handled in
  dev/tests/dags/test_dag_example.py) which was breaking collection for
  the integration test matrix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread scripts/test/pre-install-airflow.sh Outdated
Copilot review feedback: apache-airflow~=3.3.0 could resolve to a later
3.3.x patch release than the one the constraints-3.3.0 file (which
doesn't itself pin apache-airflow's version) was generated for, causing
a version/constraints mismatch. Pin exactly, matching the other exact
pins in this script.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 07:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines 38 to 41
elif [ "$AIRFLOW_VERSION" = "3.1" ]; then
uv pip install "apache-airflow~=3.1.0" "apache-airflow-providers-http>=4.0.0" "apache-airflow-providers-cncf-kubernetes>=4.4.0" "apache-airflow-providers-common-sql>=1.2.0" "apache-airflow-providers-slack" --constraint /tmp/constraint.txt
elif [ "$AIRFLOW_VERSION" = "3.2" ]; then
uv pip install "apache-airflow~=3.2.0" "apache-airflow-providers-http>=4.0.0" "apache-airflow-providers-cncf-kubernetes>=4.4.0" "apache-airflow-providers-common-sql>=1.2.0" "apache-airflow-providers-slack" --constraint /tmp/constraint.txt
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.62%. Comparing base (694808f) to head (f21a650).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #840   +/-   ##
=======================================
  Coverage   95.62%   95.62%           
=======================================
  Files          13       13           
  Lines        1372     1372           
=======================================
  Hits         1312     1312           
  Misses         60       60           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants