Skip to content

Conversation

@karenbraganz
Copy link
Collaborator

This PR allows the usage of Variable and XCom set & delete methods from code that is run in the triggerer.

At the moment, only Variable and XCom get methods can be used.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@karenbraganz karenbraganz added this to the Airflow 3.0.4 milestone Jul 18, 2025
@karenbraganz karenbraganz marked this pull request as ready for review July 18, 2025 23:13
@amoghrajesh
Copy link
Contributor

@karenbraganz could you please update the PR title to reflect what is being done?

Tests are also needed in airflow-core/tests/unit/jobs/test_triggerer_job.py

@karenbraganz karenbraganz changed the title Add ToTriggerSupervisor message types Allow Variable and XCom set and delete from trigger code Jul 21, 2025
@amoghrajesh
Copy link
Contributor

@karenbraganz how's it going with this one?

@karenbraganz
Copy link
Collaborator Author

@amoghrajesh I have completed writing tests that are passing for Variable set and delete. However, I am having some trouble with XCom since there is no longer a XCom.get_one() method, which I was planning to use in the test to check whether the XCom was set. I am looking into alternative ways to test whether the XCom was set.

@karenbraganz
Copy link
Collaborator Author

I was able to make it work with get_many() instead.

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

I’m starting to wonder if it’d be a good idea to split the if-elses and maybe share duplicate parts between the triggerer and worker supervisor.

@karenbraganz
Copy link
Collaborator Author

@uranusjr could you please elaborate? I don't completely understand what you mean by splitting if-elses and which duplicate parts you are referring to.

@uranusjr
Copy link
Member

uranusjr commented Jul 29, 2025

It’s not spoecific to your PR. The trigger runner and task runner now has a lot of duplicate code handling api calls and they are increasingly difficult to manage. This probably shouldn’t be fixed in this PR but should be kept in mind.

@amoghrajesh
Copy link
Contributor

@karenbraganz I will take a look at this today, the test timeouts could be intermittent. Let me close and open this PR to trigger the tests again.

@amoghrajesh amoghrajesh reopened this Jul 30, 2025
Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

One comment, rest looks good. Preemptively approving.

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

All good.

@amoghrajesh amoghrajesh added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Aug 5, 2025
@amoghrajesh amoghrajesh merged commit 13fa232 into apache:main Aug 5, 2025
58 checks passed
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

Backport failed to create: v3-0-test. View the failure log Run details

Status Branch Result
v3-0-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 13fa232 v3-0-test

This should apply the commit to the v3-0-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

@amoghrajesh
Copy link
Contributor

amoghrajesh commented Aug 5, 2025

Since 3.0.4 is out in RC phase, we should target this for 3.0.5.
@karenbraganz could you help with a backport there (v3-0-test branch)?

Nataneljpwd pushed a commit to Asquator/airflow that referenced this pull request Aug 5, 2025
HsiuChuanHsu pushed a commit to HsiuChuanHsu/airflow that referenced this pull request Aug 5, 2025
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
amoghrajesh pushed a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
amoghrajesh pushed a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
amoghrajesh pushed a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
amoghrajesh pushed a commit to astronomer/airflow that referenced this pull request Aug 11, 2025
kaxil pushed a commit that referenced this pull request Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Triggerer backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Development

Successfully merging this pull request may close these issues.

3 participants