Skip to content

Conversation

@ronaldorcampos
Copy link
Contributor

@ronaldorcampos ronaldorcampos commented Nov 10, 2025

This PR creates a new database clean up cronjob that runs airflow db clean, it runs by default every week, specified by schedule, and deletes records on the metadata db before X days, specified by retentionDays.

This will be helpful to those who want to keep the metadata db lean and dont want to go the extra length and setup a manual cronjob.


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

@ronaldorcampos ronaldorcampos changed the title Add database cleanup feature to clean old records Add database cleanup cronjob to clean old records Nov 10, 2025
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

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

Looks good in my view. Static check failure is from another problem on main, seems unrelated to this PR.

Keeping this PR open a few days in other leaving a second pass review.

@jscheffl jscheffl added this to the Airflow Helm Chart 1.19.0 milestone Nov 12, 2025
@ronaldorcampos
Copy link
Contributor Author

Thanks for the review @jscheffl

@ronaldorcampos
Copy link
Contributor Author

Tests, linting should be fixed now, sorry!

@ronaldorcampos ronaldorcampos force-pushed the feature/cleanup branch 2 times, most recently from d8bdeb4 to a5fe26e Compare November 14, 2025 16:45
Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the PR. Noticed a few minor things.

ronaldorcampos and others added 7 commits November 22, 2025 08:43
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
…pods.py

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
…pods.py

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
# Conflicts:
#	helm-tests/tests/helm_tests/security/test_scc_rolebinding.py
@ronaldorcampos
Copy link
Contributor Author

thanks for the review @jedcunningham. I will open a PR for some changes with cleanup cronjob and also add this #58155 (comment) change too

@jedcunningham jedcunningham merged commit c10cb34 into apache:main Nov 24, 2025
85 checks passed
@jedcunningham
Copy link
Member

Thanks @rcampos87!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:helm-chart Airflow Helm Chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants