Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add airflow config lint cli command for lint the configuration changes from Airflow 2.x to Airflow 3.0 #44908

Merged
merged 6 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions airflow/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,27 @@ def string_lower_type(val):
("option",),
help="The option name",
)

ARG_LINT_CONFIG_SECTION = Arg(
("--section",),
help="The section name(s) to lint in the airflow config.",
type=string_list_type,
)
ARG_LINT_CONFIG_OPTION = Arg(
("--option",),
help="The option name(s) to lint in the airflow config.",
type=string_list_type,
)
ARG_LINT_CONFIG_IGNORE_SECTION = Arg(
("--ignore-section",),
help="The section name(s) to ignore to lint in the airflow config.",
type=string_list_type,
)
ARG_LINT_CONFIG_IGNORE_OPTION = Arg(
("--ignore-option",),
help="The option name(s) to ignore to lint in the airflow config.",
type=string_list_type,
)
ARG_OPTIONAL_SECTION = Arg(
("--section",),
help="The section name",
Expand Down Expand Up @@ -1733,6 +1754,18 @@ class GroupCommand(NamedTuple):
ARG_VERBOSE,
),
),
ActionCommand(
name="lint",
help="lint options for the configuration changes while migrating from Airflow 2.x to Airflow 3.0",
func=lazy_load_command("airflow.cli.commands.remote_commands.config_command.lint_config"),
args=(
ARG_LINT_CONFIG_SECTION,
ARG_LINT_CONFIG_OPTION,
ARG_LINT_CONFIG_IGNORE_SECTION,
ARG_LINT_CONFIG_IGNORE_OPTION,
ARG_VERBOSE,
),
),
)

JOBS_COMMANDS = (
Expand Down
Loading