Skip to content

Fix Triggered DAG button not visible during queued/running state#67327

Merged
jscheffl merged 1 commit into
apache:mainfrom
sejal-gupta-ksolves:fix-trigger-dagrun-button
Jun 10, 2026
Merged

Fix Triggered DAG button not visible during queued/running state#67327
jscheffl merged 1 commit into
apache:mainfrom
sejal-gupta-ksolves:fix-trigger-dagrun-button

Conversation

@sejal-gupta-ksolves

Copy link
Copy Markdown
Contributor

Problem
The "Triggered DAG" button only appeared after the parent task completed execution. During RUNNING/QUEUED states, the button was completely hidden.

Root Cause:
The underlying TriggerDagRunLink reads the target redirection URL directly from XCom metadata using a specific key. By default, this XCom entry was populated downstream during the task-runner's standard finalize() routine at the very end of the task instance lifecycle.

Solution:
Modified the execution routine to eagerly calculate and push the TriggerDagRunLink URL tracking payload to XCom using context["task_instance"].xcom_push right inside the active _trigger_dag_af_3 execution block, immediately after the target run initialization occurs and before the trigger exception is raised.

This enables the FastAPI REST API /links endpoint to immediately serve the rich metadata payload, allowing the new Airflow 3 React UI to successfully render the clickable "Triggered DAG" navigation button the exact millisecond the child DAG is queued.

Screenshot from 2026-05-22 16-27-12

@boring-cyborg

boring-cyborg Bot commented May 22, 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

@eladkal eladkal requested review from jroachgolf84 and shahar1 May 22, 2026 18:38

@jroachgolf84 jroachgolf84 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@sejal-gupta-ksolves, should we add a unit test to this? You'll also want to make suer that all checks are passing!

Comment thread providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py Outdated
@potiuk

potiuk commented May 24, 2026

Copy link
Copy Markdown
Member

@sejal-gupta-ksolves A few things need addressing before review — see our Pull Request quality criteria.

  • Provider compat tests fail across 3 Airflow versions: Compat 3.0.6:P3.10:, Compat 3.1.8:P3.10:, Compat 3.2.1:P3.10: — 7 failing checks total. The change may rely on a symbol or behaviour not present in older supported Airflow versions. See the Checks tab.

No rush.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.


Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting

@sejal-gupta-ksolves

sejal-gupta-ksolves commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@sejal-gupta-ksolves A few things need addressing before review — see our Pull Request quality criteria.

  • Provider compat tests fail across 3 Airflow versions: Compat 3.0.6:P3.10:, Compat 3.1.8:P3.10:, Compat 3.2.1:P3.10: — 7 failing checks total. The change may rely on a symbol or behaviour not present in older supported Airflow versions. See the Checks tab.

No rush.

Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting

Hi @potiuk, I've updated the PR to handle this elegantly using getattr for build_airflow_dagrun_url. It also safely extracts the task instance by checking both task_instance and ti keys from the context dictionary. Clean, backwards-compatible, and all provider unit tests are passing locally.

@sejal-gupta-ksolves

Copy link
Copy Markdown
Contributor Author

@sejal-gupta-ksolves, should we add a unit test to this? You'll also want to make suer that all checks are passing!

Hi @jroachgolf84 I have added a dedicated unit test inside providers/standard/tests/providers/standard/operators/test_trigger_dagrun.py.

@sejal-gupta-ksolves sejal-gupta-ksolves force-pushed the fix-trigger-dagrun-button branch 3 times, most recently from f91b4c2 to 4540d6c Compare May 27, 2026 10:05
@sejal-gupta-ksolves sejal-gupta-ksolves force-pushed the fix-trigger-dagrun-button branch 2 times, most recently from 4cbd760 to af9174e Compare June 3, 2026 07:00
@sejal-gupta-ksolves sejal-gupta-ksolves force-pushed the fix-trigger-dagrun-button branch from 87a5f25 to 5090beb Compare June 8, 2026 06:56
@sejal-gupta-ksolves

Copy link
Copy Markdown
Contributor Author

Hi @jroachgolf84 , just bumping this PR as it has been a couple of weeks since the requested changes were addressed.

I just rebased the branch onto the latest main. The new CI run hit some flaky external network infrastructure timeouts during the Java SDK steps—specifically, a SocketTimeoutException while trying to download the Gradle wrapper binaries (gradle-8.14-bin.zip).

Because the core logic changes for fixing the Triggered DAG button are entirely separate and passing their respective unit tests, could you please take a look when you have a moment and clear the active 'changes requested' status? Thank you!

@potiuk

potiuk commented Jun 9, 2026

Copy link
Copy Markdown
Member

@sejal-gupta-ksolves A few things need addressing before review — see our Pull Request quality criteria.

  • Build docs. See docs.
  • Helm tests. See docs.
  • Unit tests. See docs.

No rush.

Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the pull request.

Looks like a bad rebase happened.

Many unrelated changes. Can you clean the branch please.

@jscheffl jscheffl 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.

Cool!

@jscheffl jscheffl dismissed jroachgolf84’s stale review June 10, 2026 21:42

Tests are added - can you re-review?

@jscheffl jscheffl merged commit ae2fe0c into apache:main Jun 10, 2026
259 of 260 checks passed
@sejal-gupta-ksolves sejal-gupta-ksolves deleted the fix-trigger-dagrun-button branch June 11, 2026 10:53
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.0 milestone Jun 15, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Jun 15, 2026
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.

TriggerDagRunOperator: button Triggered DAG not shown

7 participants