Skip to content

[v2-11-test] Ensure that the the generated airflow.cfg contains a ran… - #47755

Merged
kaxil merged 5 commits into
apache:v2-11-testfrom
jscheffl:backport-106b872-v2-10-test
Apr 30, 2025
Merged

kaxil merged 5 commits into
apache:v2-11-testfrom
jscheffl:backport-106b872-v2-10-test

Conversation

@jscheffl

@jscheffl jscheffl commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

…dom jwt_secret and fernet_key (#46966)

  • Ensure that the the generated airflow.cfg contains a random jwt_secret and fernet_key

Backport with adjustments to v2-11-test

@jscheffl
jscheffl force-pushed the backport-106b872-v2-10-test branch from 81c710d to 55b4ea2 Compare March 16, 2025 21:38
@jscheffl jscheffl added this to the Airflow 2.10.6 milestone Mar 16, 2025
@jscheffl
jscheffl force-pushed the backport-106b872-v2-10-test branch from 55b4ea2 to 4c11b56 Compare March 23, 2025 19:40
@jscheffl
jscheffl force-pushed the backport-106b872-v2-10-test branch from 4c11b56 to dce0e57 Compare April 20, 2025 21:08
@kaxil kaxil modified the milestones: Airflow 2.10.6, Airflow 2.11.0 Apr 29, 2025
@kaxil

kaxil commented Apr 29, 2025

Copy link
Copy Markdown
Member

Could you fix the failing test @jscheffl ?

@kaxil
kaxil changed the base branch from v2-10-test to v2-11-test April 29, 2025 17:17
@kaxil kaxil changed the title [v2-10-test] Ensure that the the generated airflow.cfg contains a ran… [v2-11-test] Ensure that the the generated airflow.cfg contains a ran… Apr 29, 2025
@jscheffl

Copy link
Copy Markdown
Contributor Author

@kaxil oh, lost focus on this one. Let me attempt to re-base and get it fixed. Jarek had a few fixes for docs on the branch...

ashb and others added 3 commits April 29, 2025 22:32
…dom jwt_secret and fernet_key (apache#46966)

* Ensure that the the generated airflow.cfg contains a random jwt_secret and fernet_key

I don't know exactly when this got broken, and unforutnaltey it wasn't tested,
but I suspect it might have been around the time we swapped the default config
from a config file to the yaml based values. I.e. a while ago!

To make sure it doesn't get broken I've gone and added some unit tests

And to make my next PR and test easier I have done the same thing with the
`auth_jwt_secret` that we do for fernet_key -- of only set it in the config
file if we're generating that file, not always in memory.

* Improve upgrade path by generating and warning about the missing config
(cherry picked from commit 106b872)

Co-authored-by: Ash Berlin-Taylor <ash@apache.org>
@jscheffl
jscheffl force-pushed the backport-106b872-v2-10-test branch from dce0e57 to 5addf0c Compare April 29, 2025 20:32
@kaxil

kaxil commented Apr 30, 2025

Copy link
Copy Markdown
Member

Test failure:

FAILED tests/core/test_configuration.py::test_write_default_config_contains_generated_secrets - AttributeError: <module 'airflow.configuration' from '/opt/airflow/airflow/configuration.py'> has no attribute 'JWT_SECRET_KEY'

@jscheffl

Copy link
Copy Markdown
Contributor Author

@kaxil I hope now I make it...

@kaxil
kaxil merged commit b68510e into apache:v2-11-test Apr 30, 2025
@kaxil kaxil mentioned this pull request May 15, 2025
9 of 39 tasks
@jscheffl
jscheffl deleted the backport-106b872-v2-10-test branch October 5, 2025 07:43
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.

3 participants