53 Commits
Author SHA1 Message Date
Shahar Epstein e853537c04 Bump inline script metadata to Python 3.11 (#74152)
* Bump inline script metadata to Python 3.11

The prek hooks and dev scripts declare the interpreter they run under
in PEP 723 metadata, and prek picks the hook interpreter from it, so
this has to land before any hook starts using 3.11-only APIs. With
Python 3.10 gone from the project they can also drop the tomli backport from their dependency lists, because
tomllib is in the standard library from 3.11.

* Refresh diagram checksums for the Python 3.11 script headers
2026-10-06 23:20:46 +02:00
Jens Scheffler 75bd628712 Fix code formatting via ruff preview (#57641) 2025-11-01 10:04:48 +01:00
Kaxil Naik bfa4a1bb50 Fix deprecated GitHub API authentication in airflow-github script (#56978)
Replace deprecated login_or_token parameter with Auth.Token() to eliminate
deprecation warnings when running the airflow-github compare command.

Updates all three Github() instantiations in compare, changelog, and
needs_categorization functions to use the new auth parameter.
2025-10-21 21:23:14 +01:00
Kaxil Naik ffb908435d Massively optimize airflow-github script performance (96% faster) (#54292)
**Change Summary**:
- Use GitHub search API to batch-fetch PRs by status (merged/closed/open)
- Implement batch git operations replacing individual PR lookups
- Add caching for commit SHAs and cherry-pick detection
- Improve output clarity: rename 'MERGED' column to 'CHERRY'

**Performance improvements**:
- `--unmerged` mode: 73s → 2.9s (96% faster)
- Regular mode: 73s → 12.7s (83% faster)
- Eliminates O(n) git operations with O(1) cache lookups
2025-08-08 23:12:55 +01:00
Kaxil Naik 29a1cb0cfd Fix cherry-pick detection in airflow-github script (#54287)
- Fix `is_cherrypicked` function to detect PRs with multiple reference numbers
- Differentiate between Closed and Merged status for better PR state visibility
- Add PEP 723 script dependencies for easier execution with 'uv run --no-project'

The cherry-pick detection was failing for PRs that had additional PR numbers
appended during cherry-picking (e.g., '(#53955) (#53964)'). This change improves
release management workflow by providing clearer PR status information.
2025-08-08 21:14:51 +01:00
Kaxil Naik baf5faec69 Change v1 to v2 in generated OpenAPI schema files (#50705) 2025-05-17 13:35:20 +05:30
Kaxil Naik 9bc8cb044f Fix Airflow Python client generation for 3.0.0 (#50704)
It was using the old OpenAPI generated schema. https://github.com/apache/airflow-client-python
2025-05-17 05:17:45 +05:30
Hussein Awala cb295c351a remove superfluous else block (#49199)
* remove superfluous else block

* fix unit tests

* fix static checks
2025-04-14 15:17:13 +02:00
Jarek Potiuk d4473555c0 Simplify tooling by switching completely to uv (#48223)
The lazy consensus decision has been made at the devlist to switch
entirely to `uv` as development tool:

link: https://lists.apache.org/thread/6xxdon9lmjx3xh8zw09xc5k9jxb2n256

This PR implements that decision and removes a lot of baggage connected
to using `pip` additionally to uv to install and sync the environment.
It also introduces more consistency in the way how distribution
packages are used in airflow sources - basicaly switching all internal
distributions to use `pyproject.toml` approach and linking them all
together via `uv`'s workspace feature.

This enables much more streamlined development workflows, where any
part of airflow development is manageable using `uv sync` in the right
distribution - opening the way to moving more of the "sub-worfklows"
from the CI image to local virtualenv environment.

Unfortunately, such change cannot be done incrementally, really, because
any change in the project layout drags with itself a lot of changes
in the test/CI/management scripts, so we have to implement one big
PR covering the move.

This PR is "safe" in terms of the airflow and provider's code - it
does not **really** (except occasional imports and type hint changes
resulting from better isolation of packages) change Airflow code nor
it should not affect any airflow or provider code, because it does
not move any of the folder where airflow or provider's code is modified.

It does move the test code - in a number of "auxiliary" distributions
we have. It also moves the `docs` generation code to `devel-common`
and introduces separate conf.py files for every doc package.

What is still NOT done after that move and will be covered in the
follow-up changes:

* isolating docs-building to have separate configuraiton for docs
  building per distribution - allowing to run doc build locally
  with it's own conf.py file

* moving some of the tests and checks out from breeze container
  image up to the local environment (for example mypy checks) and
  likely isolating them per-provider

* Constraints are still generated using `pip freeze` and automatically
  managed by our custom scripts in `canary` builds - this will be
  replaced later by switching to `uv.lock` mechanism.

* potentially, we could merge `devel-common` and `dev` - to be
  considered as a follow-up.

* PROD image is stil build with `pip` by default when using
  `PyPI` or distribution packages  - but we do not support building
  the source image with `pip` - when building from sources, uv
  is forced internally to install packages. Currently we have
  no plans to change default PROD building to use `uv`.

This is the detailed list of changes implemented in this PR:

* uv is now mandatory to install as pre-requisite in order to
  develop airflow. We do not support installing airflow for
  development with `pip` - there will be a lot of cases where
  it will not work for development - including development
  dependencies and installing several distributions together.

* removed meta-package `hatch_build.py' and replacing it with
  pre-commit automatically modifying declarative pyproject.toml

* stripped down `hatch_build_airflow_core.py` to only cover custom
  git and asset build hooks (and renaming the file to `hatch_build.py`
  and moving all airflow dependencies to `pyproject.toml`

* converted "loose" packages in airflow repo into distributions:
  * docker-tests
  * kubernetes-tests
  * helm-tests
  * dev (here we do not have `src` subfolder - sources are directly
    in the distribution, which is for-now inconsistent with other
    distributions).

  The names of the `_tests` distribution folders have been renamed to
  the `-tests` convention to make sure the imports are always
  referring to base of each distribution and are not used from the
  content root.

* Each eof the distributions (on top of already existing airflow-core,
  task-sdk, devel-common and 90+providers has it's own set of
  dependencies, and the top-level meta-package workspace root brings
  those distributions together allowing to install them all tegether
  with a simple `uv sync --all-packages` command and come up with
  consistent set of dependencies that are good for all those
  packages (yay!). This is used to build CI image with single
  common environment to run the tests (with some quirks due to
  constraints use where we have to manually list all distributions
  until we switch to `uv.lock` mechanism)

* `doc` code is moved to `devel-common` distribution. The `doc` folder
  only keeps README informing where the other doc code is, the
  spelling_wordlist.txt and start_docs_server.sh. The documentation is
  generated in `generated/generated-docs/` folder which is entirely
  .gitignored.

* the documentation is now fully moved to:
  * `airflow-core/docs` - documentation for Airflow Core
  * `providers/**/docs` - documentation for Providers
  * `chart/docs` - documentation for Helm Chart
  * `task-sdk/docs` - documentation for Task SDK (new format not yet published)
  * `docker-stack-docs` - documentation for Docker Stack'
  * `providers-summary-docs` - documentation for provider summary page

* `versions` are not dynamically retrieved from `__init__.py` all
  of them are synchronized directly to pyproject.toml files - this
  way - except the custom build hook - we have no dynamic components
  in our `pyproject.toml` properties.

* references to extras were removed from INSTALL and other places,
  the only references to extras remains in the user documentation - we
  stop using extras for local development, we switch to using
  dependency groups.

* backtracking command was removed from breeze - we did not need it
  since we started using `uv`

* internal commands (except constraint generation) have been moved to
  `uv` from `pip`

* breeze requires `uv` to be installed and expects to be installed by
  `uv tool install -e ./dev/breeze`

* pyproject.tomls are dynamically modified when we add a version
  suffix dynamically (`--version-suffix-for-pypi`) - only for the
  time of building the versions with updated suffix

* `mypy` checks are now consistently used across all the different
  distributions and for consistency (and to fix some of the issues
  with namespace packages) rather than using "folder" approach
  when running mypy checks, even if we run mypy for whole
  distribution, we run check on individual files rather than on
  a folder. That adds consistency in execution of mypy heursistics.
  Rather than using in-container mypy script all the logic of
  selection and parameters passed to mypy are in pre-commit code.
  For now we are still using CI image to run mypy because mypy is
  very sensitive to version of dependencies installed, we should
  be able to switch to running mypy locally once we have the
  `uv.lock` mechanism incorporated in our workflows.

* lower bounds for dependencies have been set consistently across
  all the distributions. With `uv sync` and dependabot, those
  should be generally kept consistently for the future

* the `devel-common` dependencies have been groupped together in
  `devel-common` extras - including `basic`, `doc`, `doc-gen`, and
  `all` which will make it easier to install them for some OS-es
  (basic is used as default set of dependencies to cover most
  common set of development dependencies to be used for development)

* generated/provider_dependencies.json are not committed to the
  repository any longer. They are .gitignored and geberated
  on-the-flight as needed (breeze will generate them automatically
  when empty and pre-commit will always regenerate them to be
  consistent with provider's pyproject.toml files.

* `chart-utils` have been noved to `helm-tests` from `devel-common`
  as they were only used there.

* for k8s tests we are using the `uv` main `.venv` environment
  rather than creating our own `.build` environment and we use
  `uv sync` to keep it in sync

* Updated `uv` version to 0.6.10

* We are using `uv sync` to perform "upgrade to newer depencies"
  in `canary` builds and locally

* leveldb has been turned into "dependency group" and removed from
  apache-airflow and apache-airflow-core extras, it is now only
  available by google provider's leveldb optional extra to install
  with `pip`
2025-04-02 13:11:13 +02:00
Jarek Potiuk 243fe86d4b Move airflow sources to airflow-core package (#47798)
This is continuation of the separation of the Airflow codebase into
separate distributions. This one splits airflow into two of them:

* apache-airflow - becomes an empty, meta no-code distribution that
  only has dependencies to apache-airflow-core and task-sdk
  distributions and it has preinstalled provider distributions
  added in standard "wheel" distribution. All "extras" lead
  either to "apache-airflow-core" extras or to providers - the
  dependencies and optional dependencies are calculated differently
  depending on "editable" or "standard" mode - in editable mode,
  just provider dependencies are installed for preinstalled providers
  in standard mode - those preinstalled providers are dependencies.

* the apache-airflow-core distribution contains all airflow core
  sources (previously in apache-airflow) and it has no provider
  extras. Thanks to that apache-airflow distribution does not
  have any dynamically calculated dependencies.

* the apache-airflow-core distribution hs "hatch_build_airflow_core.py"
  build hooks that add custom build target and implement custom
  cleanup in order to implement compiling assets as part of the build.

* During the move, the following changes were applied for consistency:

  * packages when used in context of distribution packages have been
    renamed to "distributions" - including all documentations and
    commands in breeze to void confusion with import packages
    (see
https://packaging.python.org/en/latest/discussions/distribution-package-vs-import-package/)

  * all tests in `airflow-core` follow now the same convention
    where tests are in `unit`, `system` and `integration` package.
    no extra package has been as second level, because all the
    provider tests have "<PROVIDER>" there, so we just have to avoid
    naming airflow unit."<PROVIDER>" with the same name as provider.

  * all tooling in CI/DEV have been updated to follow the new
    structure. We should always build to packages now when we
    are building them using `breeze`.
2025-03-21 14:25:26 +01:00
Jens Scheffler 7bd8ea6821 Cleanup leftovers from api connexion (#47490)
* Cleanup leftovers frmo API Connexion

* Cleanup leftovers frmo API Connexion, wipe all leftovers

* Fix selective checks

* Add missing dependecy of connexion to FAB provider

* Clean another CODEOWNER leftover

* Revert exceptions about project tests missing
2025-03-07 20:44:52 +01:00
Ephraim Anierobi 8914ba2c64 Fix changelog generation for minor releases (#38321)
Update how we search for existing PRs
2024-03-20 13:04:15 +01:00
Jarek Potiuk 6daceb844c Move CI documentation to inside Breeze docs (#37039)
This PR moves the documentation of CI of ours to inside Breeze
doc folder and splits the documentation in separate docs / chapters
following similar changes done for Breeze docs #36936 and the
contributing docs #36969.
2024-01-27 19:06:05 +01:00
Jarek Potiuk 8708bffa87 Split contributing docs to multiple files (#36969)
Following #36936 and the fact that GitHub stopped rendering big .rst
files, we also split CONTRIBUTING.rst into multiplet files. It will be
much easier to follow and it will render in GitHub.
2024-01-26 15:02:12 +01:00
Jarek Potiuk 4f48e3f201 Move Breeze documentation to inside Breeze and split it. (#36936)
The BREEZE.rst document became enormous - enough for it to stop being
rendered by GitHub. This change splits it into multiple smaller
documents - each focusing on a specific aspect of Breeze, making it
possible by the user to focus on only that aspect that the user
is interested at.

We also add nice index that guides the user to know about all the
aspects of Breeze.
2024-01-21 21:41:54 +01:00
Amogh Desai f337bfb07e Adding log to airflow-github for disabled progress bar (#36782)
* Adding log to airflow-github for disabled progress bar

* Adding log to airflow-github for disabled progress bar
2024-01-16 19:24:22 +01:00
Amogh Desai b3b8ae99ca Tracking airflow-github changelog activities using progress bar (#36610)
* Tracking airflow-github changelog activities using progress bar

* review comments from ephraimbuddy
2024-01-05 14:00:39 +01:00
Amogh Desai 142c7376c6 Optimise getting changelogs in airflow-github (#36548) 2024-01-05 11:59:55 +05:30
Andrey Anshin 2f205d52ac Upgrade ruff to v0.0.292 (#35066) 2023-10-20 00:19:35 +02:00
Ephraim Anierobi 90628e480a Order cherrypicking candidates by the closed date (#34739)
Currently, the candidates are ordered by the PR number but ordering by the closed date
is better and will help avoid some conflicts
2023-10-03 22:56:58 +01:00
Jarek Potiuk 3766ab07d7 More complete fix for dev release scripts to filter commit for PR (#33418)
This is a more complete fix to #33411. This is also a follow up on
earlier implementation of #33261 that addressed checking if PRs
are merged. This one applies the same pattern to finding commit
but also improves it by checking if the (#NNNNNN) ends the subject
- so even if the PR is in the same form in the message, it will be
filtered out.

The previous "--reverse" quick fix in #33411 had potential of problem in
case there were releated PRs merged before the original PR (which is
quite posssible when you have a series of PRs referring to each other.
2023-08-15 21:54:52 +02:00
Ephraim Anierobi 5b104a9020 Fix getting correct commit from multiple referenced PR (#33411)
When a PR is referenced by other PRs, our dev tool for getting the correct
commit lists the latest commit when looking for the commmit sha but we should get the oldest.
2023-08-15 18:35:16 +01:00
Jarek Potiuk eb07618d29 Fix missing related PRs when cherry-picking (#33261)
The `airflow-github` tooling had a check if PR has been already
merged, but the PR did not work well when there was already a PR
cherry-picked that referred the PR in question in their log message.

The check was done via `git log --grep=#PR` essentially and so
it happenes that `--grep` matches not only the first line of
the message but the whole log message. So if the log message
contained reference to the cherry-picked PR it was seen as merged.

This change adds ( ) around and $ to the regexp to match not
only the PR number but also parentheses around.
2023-08-09 16:41:06 +01:00
Ephraim Anierobi b13fc27e0b Update main with 2.6.0 release details (#30966)
* Update main with 2.6.0 release details

* Add release notes

(cherry picked from commit 6c32de4987)

* Update Release Note

(cherry picked from commit 969381d271)

* Update Release Note

(cherry picked from commit 37026566b9)

* fixup! Update Release Note

(cherry picked from commit 82548bad5c)

* Update Release Note

(cherry picked from commit 07272b62f1)

* fixup! Update Release Note

(cherry picked from commit ab54c63940)
2023-04-30 15:31:07 +01:00
Ephraim Anierobi 3d6ad50745 Some minor updates to the release command (#30944)
pygithub now requires to specify if a search is for pull request or issues and not both.
Also, a fix on searching old rc versions after removing the asf svn repo
2023-04-28 23:40:45 +01:00
Ephraim Anierobi 2557c07aa5 Update the release note (#30680)
* Update the release note

During the beta release, I observed some minor things that need fixing.
Here's the PR

* Use local import
2023-04-17 13:13:05 +01:00
Jarek Potiuk 34d11542a0 Remove requirement for test_ prefix for pytest test modules (#30315)
Currently we had a requirement to use `test_` prefix for modules for all
our tests, however this means that we could have missed some of the
tests from pytest collection when they were placed in a module without
the `test_` prefix. This happened already: see #30311 and #30306

The previous attempts to remove it failed, because cassandra tests
seemed to be incompatible with pytest collection when we allowed all
Python files, also there were a few names that caused the pytest
collection to fail with selecting all Python files for collection.

The move is accompanied by converting pytest configuration to
pyproject.toml.

After long investigation, it turned out that the cause of cassandra
failures was pytest assert rewrite with collided with Cython-related
type_codes.py definition of types.

See https://github.com/datastax/python-driver/pull/1142 for PR
that is aimed to fix it on cassandra side, in the meantime we
are manually patching the type_codes.py file from Cassandra by adding
PYTEST_DONT_REWRITE to its docstring when building the CI image for
testing.

Another error was using run_module method which also suffers from
assert rewriting incompatibilities but this could be fixed by using
run_path instead. https://github.com/pytest-dev/pytest/issues/9007

Yet another assert-rewrite problem was that ``test_airflow_context``
also failed with ``--assert=rewrite`` turned on when python_files
were not filtered. No solution was found on how we can disable
the rewrite (apparently it happens for yaml.py file but adding
PYTEST_DONT_REWRITE to yaml.py and related files did not help,
so we had to extract the test to separate test type)

Also test in docker_tests/kubernetes_tests should be run with working
directory being in their folders in order to apply pyproject.toml from
their directores (without specifying asyncio mode).

The following changes are applied:

* conversion of pytest configuration from pytest.ini to
  pyproject.toml (for main project, docker_tests and breeze)

* addedd pyproject.toml to breeze, docker_tests, kubernetes_tests
  to reflect they need different configuration for pytest (lack
  of pytest-asyncio for example)

* adding automated patching of Cassandra type_codes.py with
  PYTEST_DONT_REWRITE docstring marker

* add pyproject.toml to docker context in order to include it in
  sources of airflow in the image

* changed working directory for k8s suite of breeze commands to be
  kubernetes_tests

* remove pytest.ini from docker compose mounting and automated removal
  in entrypoin in case old image is used

* rename few breeze function to not start with "test_" so that they
  are not collected as test methods

* remove few test dags from collecton by pytest by name

* replace run_module with run_path usage in EKS test and test_www.

* CI workflow is updated to use docker_tests as working directory
  for those tests

* perf dags were moved out of the tests/test_utils dir to dev
  directory.

* PlainAsserts test type was added and the ``test_airflow_context``
  test is run in this separate test type when running parallel
  tests by default.
2023-03-31 07:45:09 +02:00
Pierre Jeambrun 0d3cdc3f19 Add command to apply the API clients policy (#30045) 2023-03-12 04:45:02 +08:00
Ephraim Anierobi bad875b58d Only get changelog for core commits (#27900) 2022-11-24 23:17:51 +01:00
Daniel Standish bfcae349b8 Enable string normalization in python formatting (other) (#27206) 2022-10-24 13:15:20 +08:00
Jarek Potiuk 42167990de Add __future__.annotations automatically by isort (#26383)
This is a follow up after #26289 and 26290 to automatically add
__future__.annotations import to all new files (except empty __init__).

Also the isort configureation is moved to pyproject toml to be
consistent across manual and pre-commit runs of isort
2022-09-14 12:19:17 +02:00
Jed Cunningham b966b8d881 Add more to the ignore list for non-core changes (#26355) 2022-09-13 08:26:35 -06:00
Jarek Potiuk 37581dadaa Convert Helm tests to use the new Python Breeeze (#25678)
This PR converts the Helm tests to use the new Python Breeze.
It has all the features of previous Kind breeze command and more.

All the commands are now grupped under k8s group and they are very
easy to use locally (even easier than the previous version).

The CI part is also converted and simplified - i.e. the upgrade
test is now much faster (only tests one upgrade per job and it
runs withing the original Helm/Kubernetes tests jobs so it will
not have the cluster creation overhead.

Most importantly - this is almost the last step before we can get
rid of the old legacy breeze code and one that we can get rid of
the `./breeze-legacy` script because all functionality from the
old breeze has been moved to the Python version with this change.

This removal allows us also to remove a lot of the common library
bash code that is not used any more anywhere - even in CI.

The only change left is running regular tests in parallel.

Closes: #23085
2022-09-02 23:20:45 +02:00
Brent Bovenzi 69d4fc5da7 Remove airflow/ui (#26113)
* remove airflow/ui directory

* fix mentions of /ui

* update github ci yml file
2022-09-01 15:42:50 -04:00
Ephraim Anierobi bd8a911814 Fix airflow-github needs-categorization tool handling of renamed files (#25670)
Renamed files are listed by github to start with `{old-filename} -> {new-filename}`.
Currently, these are treated as core files. Here we search the renamed files if it starts with what should be ignored
2022-08-12 14:34:48 +01:00
Jarek Potiuk 359700a450 Remove "Label when approved" workflow (#24704)
The labelling workflow has proven to be far less useful than we
thought and some of the recent changes in selective checks made
it largely obsolete. The committers can still add "full tests needed"
label when they think it is needed and there is no need to label
the PRs automatically for that (or any other reason).

For quite a while this workflow is basically a useless noise.
2022-06-28 16:23:02 +02:00
Jarek Potiuk aa8cd30c46 Cleanup references to selective checks (#24649)
Selective checks docs have been moved to breeze as part of #24610
but some of the references were still left.

This PR cleans it up.
2022-06-25 11:26:52 +02:00
Jed Cunningham 43bcfa1463 Update list of non-core files (#23236) 2022-04-26 01:01:20 -06:00
Jed Cunningham 1691968f0d Update list of non-core files/paths (#21907) 2022-03-01 13:10:30 -07:00
Jed Cunningham a282329682 Simply imports in dev github script (#21702) 2022-02-20 22:19:57 +01:00
Jarek Potiuk 066ba15c3b Convert our internal tools to use rich_click (#21689)
Rich_click provides out-of-the-box beautifying of the click command
line tools to provide 'rich' help output.

This PR changes our internal tools (including the new Breeze2
in-progress effort to use rich click to make our help nicer.
2022-02-19 21:26:38 +01:00
Jed Cunningham 074b0c9e62 Move confirm script into scripts/tools (#21626) 2022-02-17 15:05:13 +01:00
Jed Cunningham 012917878f Add dev script to find core PRs missing categorization (#21432) 2022-02-08 12:56:52 -07:00
Jed Cunningham 993ed933e9 Update docs/tools for releasing core Airflow (#20211)
When building the "testing status" issue, don't include things skipped
on the changelog or doc-only changes.

Also, don't add skipped changelog entries in the changelog.
2021-12-11 17:04:35 +01:00
Jed Cunningham 64b8389ad8 Improve airflow-github dev script (#19631) 2021-11-17 14:21:34 +00:00
Kamil Breguła 86a2a19ad2 More f-strings (#18855) 2021-10-17 18:34:06 +02:00
Jarek Potiuk 1e647029e4 Rename the main branch of the Airflow repo to be main (#16149) 2021-06-01 12:16:18 +02:00
James Timmins 8505d2f0a4 Fix typo. (#16192) 2021-06-01 08:53:39 +02:00
Kaxil Naik 4e8f9cc8d0 Enable Black - Python Auto Formmatter (#9550) 2020-11-03 23:51:54 +00:00
Kaxil Naik 8c42cf1b00 Use PyUpgrade to use Python 3.6 features (#11447)
Use features like `f-strings` instead of format across the code-base.
More details: https://github.com/asottile/pyupgrade
2020-11-03 21:53:59 +00:00