You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/07/31 11:33:35 UTC
[GitHub] [airflow] ephraimbuddy opened a new pull request #10078: Add migration guide for CLI commands
ephraimbuddy opened a new pull request #10078:
URL: https://github.com/apache/airflow/pull/10078
Closes: #9952
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463747322
##########
File path: docs/cli-migration-guide.rst
##########
@@ -0,0 +1,144 @@
+ .. 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.
+
+Airflow 2.0 CLI Command Migration Guide
+=======================================
+This article provides guideline for migrating to Airflow 2.0 from previous Airflow versions.
+
+Introduction
+------------
+The Airflow CLI has been organized so that related commands are grouped together as subcommands. You can
+learn about the commands by running ``airflow --help```. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+The table below shows the commands that have changed in Airflow 2.0.
+
+.. list-table:: Airflow 2.0 CLI Migration Guide
+ :widths: 40, 40, 20
+ :header-rows: 1
+
+ * - Old commands
+ - New commands
+ - Group
+
+ * - ``airflow trigger_dag``
+ - ``airflow dags trigger``
+ - ``dags``
+
+ * - ``airflow delete_dag``
+ - ``airflow dags delete``
+ - ``dags``
+
+ * - ``airflow show_dag``
+ - ``airflow dags show``
+ - ``dags``
+
+ * - ``airflow list_dag``
+ - ``airflow dags list``
+ - ``dags``
+
+ * - ``airflow dag_status``
+ - ``airflow dags status``
+ - ``dags``
+
+ * - ``airflow backfill``
+ - ``airflow dags backfill``
+ - ``dags``
+
+ * - ``airflow list_dag_runs``
+ - ``airflow dags list_runs``
+ - ``dags``
+
+ * - ``airflow pause``
+ - ``airflow dags pause``
+ - ``dags``
+
+ * - ``airflow unpause``
+ - ``airflow dags unpause``
+ - ``dags``
+
+ * - ``airflow test``
+ - ``airflow tasks test``
+ - ``tasks``
+
+ * - ``airflow clear``
+ - ``airflow tasks clear``
+ - ``tasks``
+
+ * - ``airflow list_tasks``
+ - ``airflow tasks list``
+ - ``tasks``
+
+ * - ``airflow task_failed_deps``
+ - ``airflow tasks failed_deps``
+ - ``tasks``
+
+ * - ``airflow task_state``
+ - ``airflow tasks state``
+ - ``tasks``
+
+ * - ``airflow run``
+ - ``airflow tasks run``
+ - ``tasks``
+
+ * - ``airflow render``
+ - ``airflow tasks render``
+ - ``tasks``
+
+ * - ``airflow initdb``
+ - ``airflow db init``
+ - ``db``
+
+ * - ``airflow resetdb``
+ - ``airflow db reset``
+ - ``db``
+
+ * - ``airflow upgradedb``
+ - ``airflow db upgrade``
+ - ``db``
+
+ * - ``airflow checkdb``
+ - ``airflow db check``
+ - ``db``
+
+ * - ``airflow shell``
+ - ``airflow db shell``
+ - ``db``
+
+ * - ``airflow pool``
+ - ``airflow pools``
+ - ``pools``
+
+ * - ``airflow create_user``
Review comment:
Does it seem like the flags are not yet effective? When I try the flags it doesn't work
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463999268
##########
File path: UPDATING.md
##########
@@ -78,50 +78,76 @@ This section describes the changes that have been made, and what you need to do
#### Simplification of CLI commands
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
Example Usage:
To create a new user:
```bash
-airflow users --create --username jondoe --lastname doe --firstname jon --email jdoe@apache.org --role Viewer --password test
+airflow users create --username jondoe --lastname doe --firstname jon --email jdoe@apache.org --role Viewer --password test
```
To list users:
```bash
-airflow users --list
+airflow users list
```
To delete a user:
```bash
-airflow users --delete --username jondoe
+airflow users delete --username jondoe
```
To add a user to a role:
```bash
-airflow users --add-role --username jondoe --role Public
+airflow users add-role --username jondoe --role Public
```
To remove a user from a role:
```bash
-airflow users --remove-role --username jondoe --role Public
+airflow users remove-role --username jondoe --role Public
```
#### CLI reorganization
-The Airflow CLI has been organized so that related commands are grouped
-together as subcommands. The `airflow list_dags` command is now `airflow
-dags list`, `airflow pause` is `airflow dags pause`, `airflow config` is `airflow config list`, etc.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`,
+`airflow config` is `airflow config list`, etc.
Review comment:
Can you add explicit text to highlight that in Airflow 1.10 and 2.0 there is an airflow config command but there is a difference in behavior. In Airflow 1.10, it prints all config options. In Airflow 2.0, it's a command group.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj edited a comment on pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#issuecomment-667562388
Can you move this content to UPDAATING.md? I think that this way it will make it easier to find this guide. We'll also be able to update it post-release if we discover new breaking changes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463999475
##########
File path: UPDATING.md
##########
@@ -78,50 +78,76 @@ This section describes the changes that have been made, and what you need to do
#### Simplification of CLI commands
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
Review comment:
In my opinion, these sections can be combined to the next, but examples can be added below the table.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464028822
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
We definitely need to have a description in one place. This is absolutely needed and I never denied it.
But my point is that it will be far more useful for the users if they do not have to look it up in UPDATING.md if they run an old command. UPDATING.md will be HUGE and I just try to think as a user using airflow and being used to run familiar commands.
Giving them suggestion what they can use instead is much better solution than asking them to look it up somewhere (UPDATING.md will not be readily available after you install Airflow - you will have to look it up).
I understand then that it has not been planned in this ticket right?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj merged pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #10078:
URL: https://github.com/apache/airflow/pull/10078
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464026916
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
Could you please create a separate ticket and describe your idea?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464026575
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
My mind is that regardless of the message available to the user as an in-program message, we still need to provide documentation that will summarize the changes. I can't imagine that the user will have to run each command manually to find out what the new name is.
Similarly, the warning about the change of the import path in the module code is not enough. My belief is that users will want to read the documents to know what to do. Of course, not everyone will do it, but some will want access to this type of documentation.
I think this ticket focuses only on documentation for now. In the next step, we can also add hints as messages in CLI.
> Since we do not have an overlap between the old and new commands it should be rather easy to do (now that we have a table with those commands it should be rather easy.
We have one overlapping command - airflow config.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463999124
##########
File path: UPDATING.md
##########
@@ -78,50 +78,76 @@ This section describes the changes that have been made, and what you need to do
#### Simplification of CLI commands
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
Example Usage:
To create a new user:
```bash
-airflow users --create --username jondoe --lastname doe --firstname jon --email jdoe@apache.org --role Viewer --password test
+airflow users create --username jondoe --lastname doe --firstname jon --email jdoe@apache.org --role Viewer --password test
```
To list users:
```bash
-airflow users --list
+airflow users list
```
To delete a user:
```bash
-airflow users --delete --username jondoe
+airflow users delete --username jondoe
```
To add a user to a role:
```bash
-airflow users --add-role --username jondoe --role Public
+airflow users add-role --username jondoe --role Public
```
To remove a user from a role:
```bash
-airflow users --remove-role --username jondoe --role Public
+airflow users remove-role --username jondoe --role Public
```
#### CLI reorganization
Review comment:
I have the impression that we can combine these sections with the next.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463615052
##########
File path: docs/cli-migration-guide.rst
##########
@@ -0,0 +1,144 @@
+ .. 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.
+
+Airflow 2.0 CLI Command Migration Guide
+=======================================
+This article provides guideline for migrating to Airflow 2.0 from previous Airflow versions.
+
+Introduction
+------------
+The Airflow CLI has been organized so that related commands are grouped together as subcommands. You can
+learn about the commands by running ``airflow --help```. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+The table below shows the commands that have changed in Airflow 2.0.
+
+.. list-table:: Airflow 2.0 CLI Migration Guide
+ :widths: 40, 40, 20
+ :header-rows: 1
+
+ * - Old commands
+ - New commands
+ - Group
+
+ * - ``airflow trigger_dag``
+ - ``airflow dags trigger``
+ - ``dags``
+
+ * - ``airflow delete_dag``
+ - ``airflow dags delete``
+ - ``dags``
+
+ * - ``airflow show_dag``
+ - ``airflow dags show``
+ - ``dags``
+
+ * - ``airflow list_dag``
+ - ``airflow dags list``
+ - ``dags``
+
+ * - ``airflow dag_status``
+ - ``airflow dags status``
+ - ``dags``
+
+ * - ``airflow backfill``
+ - ``airflow dags backfill``
+ - ``dags``
+
+ * - ``airflow list_dag_runs``
+ - ``airflow dags list_runs``
+ - ``dags``
+
+ * - ``airflow pause``
+ - ``airflow dags pause``
+ - ``dags``
+
+ * - ``airflow unpause``
+ - ``airflow dags unpause``
+ - ``dags``
+
+ * - ``airflow test``
+ - ``airflow tasks test``
+ - ``tasks``
+
+ * - ``airflow clear``
+ - ``airflow tasks clear``
+ - ``tasks``
+
+ * - ``airflow list_tasks``
+ - ``airflow tasks list``
+ - ``tasks``
+
+ * - ``airflow task_failed_deps``
+ - ``airflow tasks failed_deps``
+ - ``tasks``
+
+ * - ``airflow task_state``
+ - ``airflow tasks state``
+ - ``tasks``
+
+ * - ``airflow run``
+ - ``airflow tasks run``
+ - ``tasks``
+
+ * - ``airflow render``
+ - ``airflow tasks render``
+ - ``tasks``
+
+ * - ``airflow initdb``
+ - ``airflow db init``
+ - ``db``
+
+ * - ``airflow resetdb``
+ - ``airflow db reset``
+ - ``db``
+
+ * - ``airflow upgradedb``
+ - ``airflow db upgrade``
+ - ``db``
+
+ * - ``airflow checkdb``
+ - ``airflow db check``
+ - ``db``
+
+ * - ``airflow shell``
+ - ``airflow db shell``
+ - ``db``
+
+ * - ``airflow pool``
+ - ``airflow pools``
+ - ``pools``
+
+ * - ``airflow create_user``
Review comment:
Can you also update this section in UPDATING.md?
https://github.com/apache/airflow/blob/master/UPDATING.md#cli-changes
Now we have conflicting information because there is no users --create command in any release.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464037317
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
Raised already :) #10109
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464031154
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
I think this is just a documentation update for now, but it is a step that will allow us to work on your idea as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463701732
##########
File path: docs/index.rst
##########
@@ -108,6 +108,7 @@ Content
Operators and hooks <operators-and-hooks-ref>
CLI <cli-ref>
+ CLI migration guide <cli-migration-guide>
Review comment:
Nice. I will do that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464036482
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
I will be happy to implement the ticket when raised.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464024677
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
I still think we should add "legacy" commands in Airflow CLI to print what is the new command and exit with error. This is a better way of "documenting" it than adding UPDATING.md , Most people will not read the UPDATING.md so we should make it as easy and straightforward for the users to get informed about the new command when they run the old one.
Since we do not have an overlap between the old and new commands it should be rather easy to do (now that we have a table with those commands it should be rather easy.
Do you plan to do it within this PR @ephraimbuddy @mik-laj? Or as a separate, follow-up PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#issuecomment-667562388
Can you move this content to UPDAATING.md? I think that this way it will make it easier to find this guide.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ephraimbuddy commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464000230
##########
File path: UPDATING.md
##########
@@ -78,50 +78,76 @@ This section describes the changes that have been made, and what you need to do
#### Simplification of CLI commands
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
Example Usage:
To create a new user:
```bash
-airflow users --create --username jondoe --lastname doe --firstname jon --email jdoe@apache.org --role Viewer --password test
+airflow users create --username jondoe --lastname doe --firstname jon --email jdoe@apache.org --role Viewer --password test
```
To list users:
```bash
-airflow users --list
+airflow users list
```
To delete a user:
```bash
-airflow users --delete --username jondoe
+airflow users delete --username jondoe
```
To add a user to a role:
```bash
-airflow users --add-role --username jondoe --role Public
+airflow users add-role --username jondoe --role Public
```
To remove a user from a role:
```bash
-airflow users --remove-role --username jondoe --role Public
+airflow users remove-role --username jondoe --role Public
```
#### CLI reorganization
Review comment:
Ok. I will do that now
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464034573
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
Sure. Happy to approve it then.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463609763
##########
File path: docs/index.rst
##########
@@ -108,6 +108,7 @@ Content
Operators and hooks <operators-and-hooks-ref>
CLI <cli-ref>
+ CLI migration guide <cli-migration-guide>
Review comment:
In the next PR, maybe you could create a dedicated "Airflow 2.0 Migration Guides" section and have all the migration under that, WDYT??
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463981981
##########
File path: docs/cli-migration-guide.rst
##########
@@ -0,0 +1,144 @@
+ .. 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.
+
+Airflow 2.0 CLI Command Migration Guide
+=======================================
+This article provides guideline for migrating to Airflow 2.0 from previous Airflow versions.
+
+Introduction
+------------
+The Airflow CLI has been organized so that related commands are grouped together as subcommands. You can
+learn about the commands by running ``airflow --help```. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+The table below shows the commands that have changed in Airflow 2.0.
+
+.. list-table:: Airflow 2.0 CLI Migration Guide
+ :widths: 40, 40, 20
+ :header-rows: 1
+
+ * - Old commands
+ - New commands
+ - Group
+
+ * - ``airflow trigger_dag``
+ - ``airflow dags trigger``
+ - ``dags``
+
+ * - ``airflow delete_dag``
+ - ``airflow dags delete``
+ - ``dags``
+
+ * - ``airflow show_dag``
+ - ``airflow dags show``
+ - ``dags``
+
+ * - ``airflow list_dag``
+ - ``airflow dags list``
+ - ``dags``
+
+ * - ``airflow dag_status``
+ - ``airflow dags status``
+ - ``dags``
+
+ * - ``airflow backfill``
+ - ``airflow dags backfill``
+ - ``dags``
+
+ * - ``airflow list_dag_runs``
+ - ``airflow dags list_runs``
+ - ``dags``
+
+ * - ``airflow pause``
+ - ``airflow dags pause``
+ - ``dags``
+
+ * - ``airflow unpause``
+ - ``airflow dags unpause``
+ - ``dags``
+
+ * - ``airflow test``
+ - ``airflow tasks test``
+ - ``tasks``
+
+ * - ``airflow clear``
+ - ``airflow tasks clear``
+ - ``tasks``
+
+ * - ``airflow list_tasks``
+ - ``airflow tasks list``
+ - ``tasks``
+
+ * - ``airflow task_failed_deps``
+ - ``airflow tasks failed_deps``
+ - ``tasks``
+
+ * - ``airflow task_state``
+ - ``airflow tasks state``
+ - ``tasks``
+
+ * - ``airflow run``
+ - ``airflow tasks run``
+ - ``tasks``
+
+ * - ``airflow render``
+ - ``airflow tasks render``
+ - ``tasks``
+
+ * - ``airflow initdb``
+ - ``airflow db init``
+ - ``db``
+
+ * - ``airflow resetdb``
+ - ``airflow db reset``
+ - ``db``
+
+ * - ``airflow upgradedb``
+ - ``airflow db upgrade``
+ - ``db``
+
+ * - ``airflow checkdb``
+ - ``airflow db check``
+ - ``db``
+
+ * - ``airflow shell``
+ - ``airflow db shell``
+ - ``db``
+
+ * - ``airflow pool``
+ - ``airflow pools``
+ - ``pools``
+
+ * - ``airflow create_user``
Review comment:
Yes. In that case, we should update this entry.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r464034599
##########
File path: UPDATING.md
##########
@@ -69,61 +69,86 @@ More tips can be found in the guide:
https://developers.google.com/style/inclusive-documentation
-->
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped together as subcommands,
which means that if you use these commands in your scripts, you have to make changes to them.
This section describes the changes that have been made, and what you need to do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group |
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` | ``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` | ``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` | ``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` |
+| ``airflow test`` | ``airflow tasks test`` | ``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` | ``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` | ``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` | ``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` | ``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` |
+| ``airflow checkdb`` | ``airflow db check`` | ``db`` |
+| ``airflow shell`` | ``airflow db shell`` | ``db`` |
+| ``airflow pool`` | ``airflow pools`` | ``pools`` |
+| ``airflow create_user`` | ``airflow users create`` | ``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` | ``users`` |
+| ``airflow list_users`` | ``airflow users list`` | ``users`` |
Review comment:
Still it needs a rebase @ephraimbuddy :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10078: Add migration guide for CLI commands
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10078:
URL: https://github.com/apache/airflow/pull/10078#discussion_r463612819
##########
File path: docs/cli-migration-guide.rst
##########
@@ -0,0 +1,144 @@
+ .. 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.
+
+Airflow 2.0 CLI Command Migration Guide
+=======================================
+This article provides guideline for migrating to Airflow 2.0 from previous Airflow versions.
+
+Introduction
+------------
+The Airflow CLI has been organized so that related commands are grouped together as subcommands. You can
+learn about the commands by running ``airflow --help```. For example to get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+The table below shows the commands that have changed in Airflow 2.0.
+
+.. list-table:: Airflow 2.0 CLI Migration Guide
+ :widths: 40, 40, 20
+ :header-rows: 1
+
+ * - Old commands
+ - New commands
+ - Group
+
+ * - ``airflow trigger_dag``
+ - ``airflow dags trigger``
+ - ``dags``
+
+ * - ``airflow delete_dag``
+ - ``airflow dags delete``
+ - ``dags``
+
+ * - ``airflow show_dag``
+ - ``airflow dags show``
+ - ``dags``
+
+ * - ``airflow list_dag``
+ - ``airflow dags list``
+ - ``dags``
+
+ * - ``airflow dag_status``
+ - ``airflow dags status``
+ - ``dags``
+
+ * - ``airflow backfill``
+ - ``airflow dags backfill``
+ - ``dags``
+
+ * - ``airflow list_dag_runs``
+ - ``airflow dags list_runs``
+ - ``dags``
+
+ * - ``airflow pause``
+ - ``airflow dags pause``
+ - ``dags``
+
+ * - ``airflow unpause``
+ - ``airflow dags unpause``
+ - ``dags``
+
+ * - ``airflow test``
+ - ``airflow tasks test``
+ - ``tasks``
+
+ * - ``airflow clear``
+ - ``airflow tasks clear``
+ - ``tasks``
+
+ * - ``airflow list_tasks``
+ - ``airflow tasks list``
+ - ``tasks``
+
+ * - ``airflow task_failed_deps``
+ - ``airflow tasks failed_deps``
+ - ``tasks``
+
+ * - ``airflow task_state``
+ - ``airflow tasks state``
+ - ``tasks``
+
+ * - ``airflow run``
+ - ``airflow tasks run``
+ - ``tasks``
+
+ * - ``airflow render``
+ - ``airflow tasks render``
+ - ``tasks``
+
+ * - ``airflow initdb``
+ - ``airflow db init``
+ - ``db``
+
+ * - ``airflow resetdb``
+ - ``airflow db reset``
+ - ``db``
+
+ * - ``airflow upgradedb``
+ - ``airflow db upgrade``
+ - ``db``
+
+ * - ``airflow checkdb``
+ - ``airflow db check``
+ - ``db``
+
+ * - ``airflow shell``
+ - ``airflow db shell``
+ - ``db``
+
+ * - ``airflow pool``
+ - ``airflow pools``
+ - ``pools``
+
+ * - ``airflow create_user``
+ - ``airflow users create``
+ - ``users``
+
+ * - ``airflow delete_user``
+ - ``airflow users delete``
+ - ``users``
+
+ * - ``airflow list_users``
+ - ``airflow users list``
+ - ``users``
+
+ * - ``airflow worker``
+ - ``airflow celery worker``
+ - ``celery``
+
+ * - ``airflow flower``
+ - ``airflow celery flower``
+ - ``celery``
Review comment:
Can you add information about flags?
https://github.com/apache/airflow/blob/master/UPDATING.md#simplification-of-cli-commands
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org