Skip to content

adding callback hook for on/off state of dag - #38683

Closed
Bowrna wants to merge 1 commit into
apache:mainfrom
Bowrna:hook_notification_on_off_dag
Closed

Bowrna wants to merge 1 commit into
apache:mainfrom
Bowrna:hook_notification_on_off_dag

Conversation

@Bowrna

@Bowrna Bowrna commented Apr 2, 2024

Copy link
Copy Markdown
Contributor

closes: #36516


^ 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 newsfragments.

Comment thread airflow/models/dag.py Resolved
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 2 times, most recently from 5d0b28a to d2823f6 Compare April 5, 2024 09:31
Comment thread airflow/callbacks/callback_requests.py Resolved
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 6 times, most recently from ff0fea0 to fc06f8e Compare April 14, 2024 00:52
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 6 times, most recently from 02b6c12 to d5f6d74 Compare April 25, 2024 08:55
@Bowrna
Bowrna marked this pull request as ready for review April 25, 2024 08:55
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 2 times, most recently from 52d9f00 to b39a76a Compare May 1, 2024 17:17
@Bowrna

Bowrna commented May 1, 2024

Copy link
Copy Markdown
Contributor Author

I have added the changes and included the toggle_dag_callback inside models. But I am not sure how I can test the changes that adds a new table. Can anyone guide me with any sample PR to have a look? ( I tried figuring out but I couldn't find one that would be useful for me)

eladkal
eladkal previously requested changes May 1, 2024

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

temporary preventing merge as we are now discussing the future of pausing dag in #22006 and it will have direct affect on this PR
cc @pateash

@Bowrna

Bowrna commented May 2, 2024 •

Copy link
Copy Markdown
Contributor Author

@eladkal I checked the other issue. It is about adding another mode drain to the paused/unpaused state of DAG. While this PR is to send a callback on this state change. in this PR it monitors the difference of state and invokes the callback if it varies from the previous state of the DAG. Do you think this has to be blocked until the other issue work is done?

@eladkal
eladkal dismissed their stale review May 3, 2024 17:51

Not relevant

@eladkal

eladkal commented May 3, 2024

Copy link
Copy Markdown
Contributor

@eladkal I checked the other issue. It is about adding another mode drain to the paused/unpaused state of DAG. While this PR is to send a callback on this state change. in this PR it monitors the difference of state and invokes the callback if it varies from the previous state of the DAG. Do you think this has to be blocked until the other issue work is done?

Yes. Removed the temporary blocking.
We can continue with reviewing and merge when ready

@Bowrna

Bowrna commented May 8, 2024

Copy link
Copy Markdown
Contributor Author

I have added the changes and included the toggle_dag_callback inside models. But I am not sure how I can test the changes that adds a new table. Can anyone guide me with any sample PR to have a look? ( I tried figuring out but I couldn't find one that would be useful for me)

@uranusjr @potiuk Can you give me directions in this part?

@potiuk

potiuk commented May 9, 2024

Copy link
Copy Markdown
Member

@uranusjr @potiuk Can you give me directions in this part?

Look at history of airflow/migrations -> this is where migration scripts are maintained and we use alembic to generate / maintain those. Simple description of what needs to be done is in https://github.com/apache/airflow/blob/main/contributing-docs/13_metadata_database_updates.rst - but I personally have never done any of those (somewhat surprisingly) from scratch :)

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Jul 14, 2024
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 2 times, most recently from 562ce27 to d0636ff Compare July 16, 2024 05:32
@eladkal eladkal removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jul 16, 2024
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 2 times, most recently from 21a4ce9 to 2f9d888 Compare July 22, 2024 05:38
@Bowrna

Bowrna commented Jul 26, 2024

Copy link
Copy Markdown
Contributor Author

@potiuk I have added the migration changes. But I am not sure how I can apply those changes and run the code to test the changes. I tried checking around the repo to find help, but I didn't have any clue that I could see. Could you point me to place where I can get help on this part/ tag person who can help? May be I can add those changes and update the documentation part too.

@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch 2 times, most recently from 93ead86 to 8bb27bf Compare July 26, 2024 05:40
@Bowrna

Bowrna commented Aug 5, 2024

Copy link
Copy Markdown
Contributor Author

@potiuk I have added the migration changes. But I am not sure how I can apply those changes and run the code to test the changes. I tried checking around the repo to find help, but I didn't have any clue that I could see. Could you point me to place where I can get help on this part/ tag person who can help? May be I can add those changes and update the documentation part too.

@potiuk A gentle reminder here as I am struck here too. Thanks!

@potiuk

potiuk commented Aug 5, 2024

Copy link
Copy Markdown
Member

Generally speaking - airflow db migrate should migrate the db - also all our tests are running migration up / down -including the latest changed - there is a separate step doing it before tests are run https://github.com/apache/airflow/actions/runs/10106338999/job/27948352857?pr=38683 - and the latest version of it failed with missing airlfow import.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 22, 2024
@Bowrna
Bowrna force-pushed the hook_notification_on_off_dag branch from 8bb27bf to 3ef57ed Compare September 22, 2024 07:55
@github-actions github-actions Bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 23, 2024
@github-actions

github-actions Bot commented Nov 9, 2024

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Nov 9, 2024
@github-actions github-actions Bot closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hook notification when you turn on/off (pause/unpause) a DAG from the UI

4 participants