Skip to content

Conversation

@jason810496
Copy link
Member

closes: #46517

The inversed_deprecated_options logic in config_command.py causes config lint to retrieve the new section-option pair from the old section-option pair. Adding the lookup_from_deprecated_options argument can resolve the error.


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

@jason810496
Copy link
Member Author

Followup:

Should we add a pre-commit check to ensure the default configuration doesn’t raise issues with airflow config lint?
cc @Lee-W

@Lee-W
Copy link
Member

Lee-W commented Feb 7, 2025

Followup:

Should we add a pre-commit check to ensure the default configuration doesn’t raise issues with airflow config lint? cc @Lee-W

sounds like a great idea!

@Lee-W Lee-W self-requested a review February 7, 2025 07:08
@jason810496 jason810496 force-pushed the fix/legacy-configuration-not-removed-or-updated branch from 96b4fd2 to ed8c6bd Compare February 7, 2025 07:33
@Lee-W Lee-W added the full tests needed We need to run full set of tests for this PR to merge label Feb 10, 2025
@jason810496 jason810496 force-pushed the fix/legacy-configuration-not-removed-or-updated branch from ed8c6bd to 8ff3f65 Compare February 10, 2025 04:26
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

left a few nitpicks. overall looks good

@jason810496 jason810496 force-pushed the fix/legacy-configuration-not-removed-or-updated branch from 8ff3f65 to ff092b5 Compare February 10, 2025 10:48
@Lee-W
Copy link
Member

Lee-W commented Feb 10, 2025

Thanks for addressing this. Will leave this open for 1 or 2 days before merging.

@jason810496 jason810496 force-pushed the fix/legacy-configuration-not-removed-or-updated branch from ff092b5 to b6ac746 Compare February 13, 2025 02:56
@Lee-W
Copy link
Member

Lee-W commented Feb 13, 2025

ah... forget to merge it . will do once CI is green again

@Lee-W Lee-W merged commit 9719737 into apache:main Feb 13, 2025
91 checks passed
ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
* Fix Legacy configuration not removed or updated

* Fix webserver cookie_samesite fallback

* Fix nitpicks
section = self.inversed_deprecated_sections[section]
if not self._suppress_future_warnings:
if lookup_from_deprecated_options:
option_description = self.configuration_description.get(section, {}).get(key, {})
Copy link
Member

Choose a reason for hiding this comment

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

@Lee-W @jason810496 So it turns out this was inaddequately tested before, and was already not working.

This should be self.configuration_description.get(section, {}).get("options", {}).get(key, {})

@jason810496 Would you mind fixing this and adding tests for it?

Copy link
Member Author

@jason810496 jason810496 Feb 21, 2025

Choose a reason for hiding this comment

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

Sure, I will create a PR to fix it I the weekend ( currently out of laptop. If this is very urgent then I might not be able to solve it immediately. )

Copy link
Member

Choose a reason for hiding this comment

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

Of course, no rush! It's been broken for a some unknown time, you were just the unfortunate soul who touched it last 😁

@sunank200 sunank200 added the backport-to-v2-11-test Mark PR with this label to backport to v2-11-test branch label May 8, 2025
sunank200 pushed a commit to astronomer/airflow that referenced this pull request May 8, 2025
* Fix Legacy configuration not removed or updated

* Fix webserver cookie_samesite fallback

* Fix nitpicks

(cherry picked from commit 9719737)
sunank200 pushed a commit to astronomer/airflow that referenced this pull request May 8, 2025
* Fix Legacy configuration not removed or updated

(cherry picked from commit 9719737)
Lee-W pushed a commit that referenced this pull request May 9, 2025
…50353)

* Fix Legacy configuration not removed or updated (#46544)

* Fix Legacy configuration not removed or updated

(cherry picked from commit 9719737)

* allow_trigger_in_future config removal (#46667)

(cherry picked from commit 65bacad)

* Backport airflow config update and airflow config lint changes

* Rename pre-2-7 defaults to provider_config_fallback_defaults (#44895)

* Rename pre-2-7 defaults to provider_config_fallback_defaults

After unsuccessful atempts to remove them, renaming and adding
appropriate warning against removing them seems to be a good idea.

* Update airflow/config_templates/provider_config_fallback_defaults.cfg

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

---------

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
(cherry picked from commit 8c013b6)

* Fix `lookup_from_deprecated_options` in AirflowConfigParser (#47004)

* Fix deprecated_options in AirflowConfigParser

* Add test_deprecated_options_with_lookup_from_deprecated, rename as lookup_from_deprecated

* fixup! Add docstring for lookup_from_deprecated

* Fix fixture params naming

(cherry picked from commit 8e3d25f)

* Fix the tests

---------

Co-authored-by: LIU ZHE YOU <68415893+jason810496@users.noreply.github.com>
Co-authored-by: Phani Kumar <94376113+phanikumv@users.noreply.github.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI area:serialization backport-to-v2-11-test Mark PR with this label to backport to v2-11-test branch full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy configuration not removed or updated

4 participants