Skip to content

Propagate triggering user to child DAG runs via TriggerDagRunOperator#65747

Merged
dheerajturaga merged 1 commit into
apache:mainfrom
dheerajturaga:bugfix/propagate-username-child-dagrun
May 4, 2026
Merged

Propagate triggering user to child DAG runs via TriggerDagRunOperator#65747
dheerajturaga merged 1 commit into
apache:mainfrom
dheerajturaga:bugfix/propagate-username-child-dagrun

Conversation

@dheerajturaga
Copy link
Copy Markdown
Member

@dheerajturaga dheerajturaga commented Apr 24, 2026

Previously, when a task used TriggerDagRunOperator to trigger a child DAG,
the child run's triggering_user_name was left unset and the UI displayed
it as anonymous. The information was already captured on the parent
DagRun but never forwarded through the Execution API.

The POST /execution/dag-runs/{dag_id}/{run_id} endpoint now looks up the
calling task instance's parent DagRun and forwards its triggering_user_name
to the new child run. Chains of TriggerDagRunOperator runs now show the
original human user end-to-end

Screenshot 2026-04-23 205456
Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    ClaudeCode

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Apr 24, 2026
@amoghrajesh
Copy link
Copy Markdown
Contributor

CI needs fixing.

@jroachgolf84
Copy link
Copy Markdown
Collaborator

What if there isn't a user? Would it make sense to fall back to the DAG ID (or something like that)?

  Previously, when a task used TriggerDagRunOperator to trigger a child DAG,
  the child run's triggering_user_name was left unset and the UI displayed
  it as anonymous. The information was already captured on the parent
  DagRun but never forwarded through the Execution API.

  The POST /execution/dag-runs/{dag_id}/{run_id} endpoint now looks up the
  calling task instance's parent DagRun and forwards its triggering_user_name
  to the new child run. Chains of TriggerDagRunOperator runs now show the
  original human user end-to-end
@dheerajturaga dheerajturaga force-pushed the bugfix/propagate-username-child-dagrun branch from 9e9114b to 8b717b1 Compare April 24, 2026 14:13
@dheerajturaga
Copy link
Copy Markdown
Member Author

What if there isn't a user? Would it make sense to fall back to the DAG ID (or something like that)?

if there isn't a user, it would default to None just like before. falling back to dagid for triggering user would be incorrect

@dheerajturaga
Copy link
Copy Markdown
Member Author

CI needs fixing.

CI was broken on main, it just got fixed in #65748

@dheerajturaga dheerajturaga added backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch labels Apr 24, 2026
@dheerajturaga dheerajturaga added this to the Airflow 3.2.2 milestone Apr 30, 2026
Copy link
Copy Markdown
Contributor

@shubhamraj-git shubhamraj-git left a comment

Choose a reason for hiding this comment

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

Thanks for the patch. Looks fine.
Tested locally, works as expected.

@dheerajturaga dheerajturaga merged commit f06df11 into apache:main May 4, 2026
141 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 4, 2026
…gRunOperator (apache#65747)

Previously, when a task used TriggerDagRunOperator to trigger a child DAG,
  the child run's triggering_user_name was left unset and the UI displayed
  it as anonymous. The information was already captured on the parent
  DagRun but never forwarded through the Execution API.

  The POST /execution/dag-runs/{dag_id}/{run_id} endpoint now looks up the
  calling task instance's parent DagRun and forwards its triggering_user_name
  to the new child run. Chains of TriggerDagRunOperator runs now show the
  original human user end-to-end
(cherry picked from commit f06df11)

Co-authored-by: Dheeraj Turaga <dheerajturaga@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 4, 2026
…gRunOperator (apache#65747)

Previously, when a task used TriggerDagRunOperator to trigger a child DAG,
  the child run's triggering_user_name was left unset and the UI displayed
  it as anonymous. The information was already captured on the parent
  DagRun but never forwarded through the Execution API.

  The POST /execution/dag-runs/{dag_id}/{run_id} endpoint now looks up the
  calling task instance's parent DagRun and forwards its triggering_user_name
  to the new child run. Chains of TriggerDagRunOperator runs now show the
  original human user end-to-end
(cherry picked from commit f06df11)

Co-authored-by: Dheeraj Turaga <dheerajturaga@gmail.com>
potiuk pushed a commit that referenced this pull request May 10, 2026
…gRunOperator (#65747)

Previously, when a task used TriggerDagRunOperator to trigger a child DAG,
  the child run's triggering_user_name was left unset and the UI displayed
  it as anonymous. The information was already captured on the parent
  DagRun but never forwarded through the Execution API.

  The POST /execution/dag-runs/{dag_id}/{run_id} endpoint now looks up the
  calling task instance's parent DagRun and forwards its triggering_user_name
  to the new child run. Chains of TriggerDagRunOperator runs now show the
  original human user end-to-end
(cherry picked from commit f06df11)

Co-authored-by: Dheeraj Turaga <dheerajturaga@gmail.com>
potiuk pushed a commit that referenced this pull request May 10, 2026
…gRunOperator (#65747)

Previously, when a task used TriggerDagRunOperator to trigger a child DAG,
  the child run's triggering_user_name was left unset and the UI displayed
  it as anonymous. The information was already captured on the parent
  DagRun but never forwarded through the Execution API.

  The POST /execution/dag-runs/{dag_id}/{run_id} endpoint now looks up the
  calling task instance's parent DagRun and forwards its triggering_user_name
  to the new child run. Chains of TriggerDagRunOperator runs now show the
  original human user end-to-end
(cherry picked from commit f06df11)

Co-authored-by: Dheeraj Turaga <dheerajturaga@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants