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 migration guide for CLI commands #10078

Merged
merged 7 commits into from
Aug 2, 2020
Merged

Add migration guide for CLI commands #10078

merged 7 commits into from
Aug 2, 2020

Conversation

ephraimbuddy
Copy link
Contributor

Closes: #9952
^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@turbaszek turbaszek added the area:upgrade Facilitating migration to a newer version of Airflow label Jul 31, 2020
@turbaszek turbaszek requested a review from mik-laj July 31, 2020 13:04
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

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

Awesome work @ephraimbuddy 🎉

docs/index.rst Outdated
@@ -108,6 +108,7 @@ Content

Operators and hooks <operators-and-hooks-ref>
CLI <cli-ref>
CLI migration guide <cli-migration-guide>
Copy link
Member

Choose a reason for hiding this comment

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

In the next PR, maybe you could create a dedicated "Airflow 2.0 Migration Guides" section and have all the migration under that, WDYT??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice. I will do that.


* - ``airflow flower``
- ``airflow celery flower``
- ``celery``
Copy link
Member

Choose a reason for hiding this comment

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

- ``airflow pools``
- ``pools``

* - ``airflow create_user``
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it seem like the flags are not yet effective? When I try the flags it doesn't work

Copy link
Member

Choose a reason for hiding this comment

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

Yes. In that case, we should update this entry.

@mik-laj
Copy link
Member

mik-laj commented Aug 1, 2020

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.

UPDATING.md Outdated
```

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
Copy link
Member

Choose a reason for hiding this comment

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

I have the impression that we can combine these sections with the next.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I will do that now

UPDATING.md Outdated
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.
Copy link
Member

Choose a reason for hiding this comment

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

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.

UPDATING.md Outdated
@@ -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`.
Copy link
Member

Choose a reason for hiding this comment

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

In my opinion, these sections can be combined to the next, but examples can be added below the table.

| ``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`` |
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

Could you please create a separate ticket and describe your idea?

Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

Sure. Happy to approve it then.

Copy link
Member

Choose a reason for hiding this comment

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

Still it needs a rebase @ephraimbuddy :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will be happy to implement the ticket when raised.

Copy link
Member

Choose a reason for hiding this comment

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

Raised already :) #10109

@mik-laj mik-laj merged commit 011c07a into apache:master Aug 2, 2020
@ephraimbuddy ephraimbuddy deleted the migrate-cli-command branch August 2, 2020 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:upgrade Facilitating migration to a newer version of Airflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration guide for CLI commands
5 participants