Skip to content
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
12 changes: 6 additions & 6 deletions .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,9 @@ labelPRBasedOnFilePath:
- docs/helm-chart/**

area:Webserver:
- airflow/cli/commands/webserver_command.py
- airflow/cli/commands/local_commands/webserver_command.py
- airflow/www/**/*
- tests/cli/commands/test_webserver_command.py
- tests/cli/commands/local_commands/test_webserver_command.py
- tests/www/**/*

area:UI:
Expand Down Expand Up @@ -623,9 +623,9 @@ labelPRBasedOnFilePath:
- tests/utils/log/**/*

area:Plugins:
- airflow/cli/commands/plugins_command.py
- airflow/cli/commands/local_commands/plugins_command.py
- airflow/plugins_manager.py
- tests/cli/commands/test_plugins_command.py
- tests/cli/commands/local_commands/test_plugins_command.py
- tests/plugins/**/*
- docs/apache-airflow/authoring-and-scheduling/plugins.rst

Expand All @@ -649,11 +649,11 @@ labelPRBasedOnFilePath:
- docs/apache-airflow/security/secrets/**/*

area:Triggerer:
- airflow/cli/commands/triggerer_command.py
- airflow/cli/commands/local_commands/triggerer_command.py
- airflow/jobs/triggerer_job_runner.py
- airflow/models/trigger.py
- providers/src/airflow/providers/standard/triggers/**/*
- tests/cli/commands/test_triggerer_command.py
- tests/cli/commands/local_commands/test_triggerer_command.py
- tests/jobs/test_triggerer_job.py
- tests/models/test_trigger.py
- tests/jobs/test_triggerer_job_logging.py
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ repos:
(?x)
^airflow/api_connexion/openapi/v1.yaml$|
^airflow/ui/openapi-gen/|
^airflow/cli/commands/fastapi_api_command.py$|
^airflow/cli/commands/webserver_command.py$|
^airflow/cli/commands/local_commands/fastapi_api_command.py$|
^airflow/cli/commands/local_commands/webserver_command.py$|
^airflow/config_templates/|
^airflow/models/baseoperator.py$|
^airflow/operators/__init__.py$|
Expand Down
2 changes: 1 addition & 1 deletion airflow/api_fastapi/gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def post_worker_init(_):
"""
Set process title.

This is used by airflow.cli.commands.fastapi_api_command to track the status of the worker.
This is used by airflow.cli.commands.local_commands.fastapi_api_command to track the status of the worker.
"""
old_title = setproctitle.getproctitle()
setproctitle.setproctitle(settings.GUNICORN_WORKER_READY_PREFIX + old_title)
186 changes: 97 additions & 89 deletions airflow/cli/cli_config.py

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions airflow/cli/commands/hybrid_commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
16 changes: 16 additions & 0 deletions airflow/cli/commands/local_commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from lockfile.pidlockfile import read_pid_from_pidfile, remove_existing_pidfile

from airflow import settings
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.configuration import conf
from airflow.utils import cli as cli_utils
from airflow.utils.cli import setup_locations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from datetime import timedelta
from typing import Any

from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.configuration import conf
from airflow.dag_processing.manager import DagFileProcessorManager, reload_configuration_for_dag_processing
from airflow.jobs.dag_processor_job_runner import DagProcessorJobRunner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
from uvicorn.workers import UvicornWorker

from airflow import settings
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.webserver_command import GunicornMonitor
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.webserver_command import GunicornMonitor
from airflow.exceptions import AirflowConfigException
from airflow.utils import cli as cli_utils
from airflow.utils.cli import setup_locations
Expand Down Expand Up @@ -64,7 +64,7 @@ def fastapi_api(args):
num_workers = args.workers
worker_timeout = args.worker_timeout

worker_class = "airflow.cli.commands.fastapi_api_command.AirflowUvicornWorker"
worker_class = "airflow.cli.commands.local_commands.fastapi_api_command.AirflowUvicornWorker"

from airflow.api_fastapi.app import create_app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from __future__ import annotations

from airflow import settings
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.security import kerberos as krb
from airflow.security.kerberos import KerberosMode
from airflow.utils import cli as cli_utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from multiprocessing import Process

from airflow import settings
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.configuration import conf
from airflow.executors.executor_loader import ExecutorLoader
from airflow.jobs.job import Job, run_job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from multiprocessing import Process

from airflow import settings
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.configuration import conf
from airflow.jobs.job import Job, run_job
from airflow.jobs.triggerer_job_runner import TriggererJobRunner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from lockfile.pidlockfile import read_pid_from_pidfile

from airflow import settings
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option
from airflow.configuration import conf
from airflow.exceptions import AirflowException, AirflowWebServerTimeout
from airflow.utils import cli as cli_utils
Expand Down
16 changes: 16 additions & 0 deletions airflow/cli/commands/remote_commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
2 changes: 1 addition & 1 deletion airflow/www/gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def post_worker_init(_):
"""
Set process title.

This is used by airflow.cli.commands.webserver_command to track the status of the worker.
This is used by airflow.cli.commands.local_commands.webserver_command to track the status of the worker.
"""
old_title = setproctitle.getproctitle()
setproctitle.setproctitle(settings.GUNICORN_WORKER_READY_PREFIX + old_title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

def _run_command_with_daemon_option(*args, **kwargs):
try:
from airflow.cli.commands.daemon_utils import run_command_with_daemon_option
from airflow.cli.commands.local_commands.daemon_utils import run_command_with_daemon_option

run_command_with_daemon_option(*args, **kwargs)
except ImportError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __getattr__(name):
CELERY_CLI_COMMAND_PATH = (
"airflow.providers.celery.cli.celery_command"
if Version(airflow_version) >= Version("2.8.0")
else "airflow.cli.commands.celery_command"
else "airflow.cli.commands.local_commands.celery_command"
)

CELERY_COMMANDS = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from __future__ import annotations

from airflow import settings
from airflow.cli.commands.db_command import run_db_downgrade_command, run_db_migrate_command
from airflow.cli.commands.local_commands.db_command import run_db_downgrade_command, run_db_migrate_command
from airflow.providers.fab.auth_manager.models.db import _REVISION_HEADS_MAP, FABDBManager
from airflow.utils import cli as cli_utils
from airflow.utils.providers_configuration_loader import providers_configuration_loaded
Expand Down
8 changes: 4 additions & 4 deletions providers/tests/celery/cli/test_celery_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ def test_run_command(self, mock_celery_app):
]
)

@mock.patch("airflow.cli.commands.daemon_utils.TimeoutPIDLockFile")
@mock.patch("airflow.cli.commands.daemon_utils.setup_locations")
@mock.patch("airflow.cli.commands.daemon_utils.daemon")
@mock.patch("airflow.cli.commands.local_commands.daemon_utils.TimeoutPIDLockFile")
@mock.patch("airflow.cli.commands.local_commands.daemon_utils.setup_locations")
@mock.patch("airflow.cli.commands.local_commands.daemon_utils.daemon")
@mock.patch("airflow.providers.celery.executors.celery_executor.app")
def test_run_command_daemon(self, mock_celery_app, mock_daemon, mock_setup_locations, mock_pid_file):
mock_setup_locations.return_value = (
Expand Down Expand Up @@ -309,7 +309,7 @@ def test_run_command_daemon(self, mock_celery_app, mock_daemon, mock_setup_locat
]
)
mock_open = mock.mock_open()
with mock.patch("airflow.cli.commands.daemon_utils.open", mock_open):
with mock.patch("airflow.cli.commands.local_commands.daemon_utils.open", mock_open):
celery_command.flower(args)

mock_celery_app.start.assert_called_once_with(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_imports(path: str):

errors: list[str] = []

EXCEPTIONS = ["airflow/cli/commands/kubernetes_command.py"]
EXCEPTIONS = ["airflow/cli/commands/hybrid_commands/kubernetes_command.py"]


def main() -> int:
Expand Down
34 changes: 17 additions & 17 deletions scripts/cov/cli_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@
files_not_fully_covered = [
"airflow/cli/cli_config.py",
"airflow/cli/cli_parser.py",
"airflow/cli/commands/celery_command.py",
"airflow/cli/commands/config_command.py",
"airflow/cli/commands/connection_command.py",
"airflow/cli/commands/dag_command.py",
"airflow/cli/commands/dag_processor_command.py",
"airflow/cli/commands/db_command.py",
"airflow/cli/commands/info_command.py",
"airflow/cli/commands/jobs_command.py",
"airflow/cli/commands/kubernetes_command.py",
"airflow/cli/commands/plugins_command.py",
"airflow/cli/commands/pool_command.py",
"airflow/cli/commands/provider_command.py",
"airflow/cli/commands/scheduler_command.py",
"airflow/cli/commands/standalone_command.py",
"airflow/cli/commands/task_command.py",
"airflow/cli/commands/variable_command.py",
"airflow/cli/commands/webserver_command.py",
"airflow/cli/commands/local_commands/celery_command.py",
"airflow/cli/commands/remote_commands/config_command.py",
"airflow/cli/commands/remote_commands/connection_command.py",
"airflow/cli/commands/remote_commands/dag_command.py",
"airflow/cli/commands/local_commands/dag_processor_command.py",
"airflow/cli/commands/local_commands/db_command.py",
"airflow/cli/commands/local_commands/info_command.py",
"airflow/cli/commands/remote_commands/jobs_command.py",
"airflow/cli/commands/hybrid_commands/kubernetes_command.py",
"airflow/cli/commands/local_commands/plugins_command.py",
"airflow/cli/commands/remote_commands/pool_command.py",
"airflow/cli/commands/remote_commands/provider_command.py",
"airflow/cli/commands/local_commands/scheduler_command.py",
"airflow/cli/commands/local_commands/standalone_command.py",
"airflow/cli/commands/remote_commands/task_command.py",
"airflow/cli/commands/remote_commands/variable_command.py",
"airflow/cli/commands/local_commands/webserver_command.py",
"airflow/cli/simple_table.py",
]

Expand Down
2 changes: 1 addition & 1 deletion scripts/in_container/run_provider_yaml_files_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from rich.console import Console
from tabulate import tabulate

from airflow.cli.commands.info_command import Architecture
from airflow.cli.commands.local_commands.info_command import Architecture
from airflow.exceptions import AirflowProviderDeprecationWarning
from airflow.providers_manager import ProvidersManager

Expand Down
2 changes: 1 addition & 1 deletion tests/api_fastapi/core_api/routes/public/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class TestGetJobs(TestJobEndpoint):
@pytest.mark.parametrize(
"testcase, query_params, expected_status_code, expected_total_entries",
[
# original testcases refactor from tests/cli/commands/test_jobs_command.py
# original testcases refactor from tests/cli/commands/remote_commands/test_jobs_command.py
(TESTCASE_ONE_SCHEDULER, {}, 200, 1),
(TESTCASE_ONE_SCHEDULER_WITH_HOSTNAME, {"hostname": "HOSTNAME"}, 200, 1),
(TESTCASE_HA_SCHEDULERS, {"limit": 100}, 200, 3),
Expand Down
16 changes: 16 additions & 0 deletions tests/cli/commands/hybrid_commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
Loading