Skip to content

Initialize versioned Dag bundle for callbacks when bundle_version is None#69087

Open
nikolauspschuetz wants to merge 1 commit into
apache:mainfrom
nikolauspschuetz:fix/callback-bundle-init-64891
Open

Initialize versioned Dag bundle for callbacks when bundle_version is None#69087
nikolauspschuetz wants to merge 1 commit into
apache:mainfrom
nikolauspschuetz:fix/callback-bundle-init-64891

Conversation

@nikolauspschuetz

Copy link
Copy Markdown

When bundle versioning is disabled (disable_bundle_versioning=True), DagRun.produce_dag_callback() sets bundle_version=None on the callback request. DagFileProcessorManager.prepare_callback_bundle() then skipped bundle.initialize() for versioning-capable bundles because the guard required a truthy request.bundle_version. As a result, _add_callback_to_queue() built DagFileInfo from an unresolved bundle.path (observed as /dev/null for backends whose path is only valid after initialization).

This initializes the bundle whenever it supports versioning — even when bundle_version is None — so the bundle resolves its current effective version and callbacks always queue a usable path. The normal versioned path and the non-versioning path are unchanged.

closes: #64891


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

@boring-cyborg

boring-cyborg Bot commented Jun 27, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

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

Fixes callback-only Dag processing when bundle versioning is disabled (so callback requests carry bundle_version=None) by ensuring versioning-capable Dag bundles are still initialized, allowing bundle.path to be resolved before queueing callbacks.

Changes:

  • Initialize bundles for callbacks whenever bundle.supports_versioning, even when request.bundle_version is None.
  • Add unit tests covering initialization and resolved bundle.path behavior for bundle_version=None.
  • Add a bugfix newsfragment documenting the change.

Reviewed changes

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

File Description
airflow-core/src/airflow/dag_processing/manager.py Initialize versioning-capable bundles for callbacks even when bundle_version is None, ensuring bundle.path is resolved before building DagFileInfo.
airflow-core/tests/unit/dag_processing/test_manager.py Adds/updates tests to validate initialization and resolved bundle paths for callback requests with bundle_version=None.
airflow-core/newsfragments/64891.bugfix.rst Documents the bugfix in the release notes.

Comment thread airflow-core/src/airflow/dag_processing/manager.py
@nikolauspschuetz nikolauspschuetz force-pushed the fix/callback-bundle-init-64891 branch from 0777775 to de5197c Compare June 28, 2026 04:58
…None

When bundle versioning is disabled, DagRun.produce_dag_callback() sets
bundle_version to None on the callback request. Callback queueing then
skipped bundle.initialize() for versioning-capable bundles, so the queued
DagFileInfo was built from an unresolved bundle path. Initialize the bundle
whenever it supports versioning, letting it resolve its current effective
version, so callbacks always queue a usable path.
@nikolauspschuetz nikolauspschuetz force-pushed the fix/callback-bundle-init-64891 branch from de5197c to 1bf4400 Compare June 28, 2026 04:58
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.

Callback queueing skips versioned bundle initialization when DagCallbackRequest.bundle_version is None

2 participants