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/11/28 15:54:17 UTC

[GitHub] [airflow] turbaszek opened a new pull request #12689: Use rich to render airflow info command

turbaszek opened a new pull request #12689:
URL: https://github.com/apache/airflow/pull/12689


   Before:
   <img width="1902" alt="Screenshot 2020-11-28 at 16 42 32" src="https://user-images.githubusercontent.com/9528307/100519768-49ee2300-319a-11eb-8fc7-99aba4591167.png">
   
   After:
   <img width="1902" alt="Screenshot 2020-11-28 at 16 41 34" src="https://user-images.githubusercontent.com/9528307/100519762-435fab80-319a-11eb-8b3d-b9baeae599bb.png">
   
   ---
   **^ 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] turbaszek commented on pull request #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735249954


   > http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/modules_management.html
   
   Sure, is it only for me or the images are not rendering on this page?


----------------------------------------------------------------
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] turbaszek commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532099056



##########
File path: airflow/cli/commands/cheat_sheet_command.py
##########
@@ -15,53 +15,44 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import contextlib
-from typing import Iterable, List, Union
+from typing import Iterable, List, Optional, Union
 
-from termcolor import cprint
+from rich.console import Console
 
 from airflow.cli.cli_parser import ActionCommand, GroupCommand, airflow_commands
+from airflow.cli.commands.info_command import SimpleTable
 from airflow.utils.helpers import partition
-from airflow.utils.platform import is_terminal_support_colors
-from airflow.utils.process_utils import patch_environ
-
-ANSI_COLORS_DISABLED = "ANSI_COLORS_DISABLED"
-"""Environment variable disable using rich output. It is supported by termcolor library"""
 
 
 def cheat_sheet(args):
     """Display cheat-sheet."""
-    with contextlib.ExitStack() as exit_stack:
-        if not is_terminal_support_colors():
-            exit_stack.enter_context(patch_environ({ANSI_COLORS_DISABLED: "1"}))
-        cprint("List of all commands:".upper(), attrs=["bold", "underline"])
-        print()
-        display_commands_index()
+    display_commands_index()
 
 
 def display_commands_index():
     """Display list of all commands."""
 
-    def display_recursive(prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]]):
+    def display_recursive(
+        prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]],
+        help_msg: Optional[str] = None

Review comment:
       Yeah, thanks! I fixed it locally but did not adde this to commit 🤦 




----------------------------------------------------------------
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] turbaszek commented on a change in pull request #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532087615



##########
File path: airflow/cli/commands/info_command.py
##########
@@ -447,8 +418,7 @@ def _send_report_to_fileio(info):
     try:
         link = _upload_text_to_fileio(str(info))
         print("Report uploaded.")
-        print()
-        print("Link:\t", link)
+        print(link)

Review comment:
       This simplifies output so users can do `airflow info --file-io | grep https | pbcopy`. Example:
   ```
   Uploading report to file.io service.
   Report uploaded.
   https://file.io/xfDPsSSxkFm9
   ```
   




----------------------------------------------------------------
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] turbaszek commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532099056



##########
File path: airflow/cli/commands/cheat_sheet_command.py
##########
@@ -15,53 +15,44 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import contextlib
-from typing import Iterable, List, Union
+from typing import Iterable, List, Optional, Union
 
-from termcolor import cprint
+from rich.console import Console
 
 from airflow.cli.cli_parser import ActionCommand, GroupCommand, airflow_commands
+from airflow.cli.commands.info_command import SimpleTable
 from airflow.utils.helpers import partition
-from airflow.utils.platform import is_terminal_support_colors
-from airflow.utils.process_utils import patch_environ
-
-ANSI_COLORS_DISABLED = "ANSI_COLORS_DISABLED"
-"""Environment variable disable using rich output. It is supported by termcolor library"""
 
 
 def cheat_sheet(args):
     """Display cheat-sheet."""
-    with contextlib.ExitStack() as exit_stack:
-        if not is_terminal_support_colors():
-            exit_stack.enter_context(patch_environ({ANSI_COLORS_DISABLED: "1"}))
-        cprint("List of all commands:".upper(), attrs=["bold", "underline"])
-        print()
-        display_commands_index()
+    display_commands_index()
 
 
 def display_commands_index():
     """Display list of all commands."""
 
-    def display_recursive(prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]]):
+    def display_recursive(
+        prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]],
+        help_msg: Optional[str] = None

Review comment:
       Yeah, thanks! I fixed it locally but did not add this to commit 🤦 




----------------------------------------------------------------
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] turbaszek commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532114307



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       Created a separate issue: https://github.com/apache/airflow/issues/12696




----------------------------------------------------------------
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 #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735252715


   There is a problem with one image because it references a file from airflow-site, but it shouldn't take up that much space as it's only used by anchor.
   <img width="751" alt="Screenshot 2020-11-28 at 17 30 09" src="https://user-images.githubusercontent.com/12058428/100520691-62ad0780-319f-11eb-9835-487f3c0ca4f3.png">
   


----------------------------------------------------------------
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] XD-DENG commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532107720



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       If everything is working correctly, the sample value here should be something like `postgresql+psycopg2://postgres:PASSWORD@postgres/airflow` instead, according to https://github.com/apache/airflow/blob/b858683abf5b17ef85d4b246e05871819a747f14/airflow/cli/commands/info_command.py#L85
   
   May you please help double check?
   
   OR, personally I think we can consider removing `sql_alchemy_conn` from the info command output
   
   ADD-UP: if we show it here, either we are showing something useful BUT sensitive, or we are showing something not very useful (after sufficient necessary masking), IMHO




----------------------------------------------------------------
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] XD-DENG commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532112938



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       My bad that I missed the `--anonymize` flag.
   
   Regarding whether to keep `sql_alchemy_conn` in the output of `airflow info`, I still keep my view given it's (almost) the only sensitive item in the output. *But I will not insist in this opinion in this PR*.
   
   OR, at least, let's make anonymisation default. Currently it's `store_true`, i.e. no anonymisation by default. Let me know your thoughts?
   
   https://github.com/apache/airflow/blob/07a2ed5a2ab6edf3fc38c94186fe2204a47f44b7/airflow/cli/cli_parser.py#L649-L653




----------------------------------------------------------------
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 #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735250877


   I have images on this page.
   <img width="1157" alt="Screenshot 2020-11-28 at 17 15 29" src="https://user-images.githubusercontent.com/12058428/100520298-5d4ebd80-319d-11eb-8aaf-b9fc6ce55e06.png">
   


----------------------------------------------------------------
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] XD-DENG commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532107720



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       If everything is working correctly, the sample value here should be something like `postgresql+psycopg2://postgres:PASSWORD@postgres/airflow` instead, according to https://github.com/apache/airflow/blob/b858683abf5b17ef85d4b246e05871819a747f14/airflow/cli/commands/info_command.py#L85
   
   May you please help double check?
   
   OR, personally I think we can consider removing `sql_alchemy_conn` from the info command output 




----------------------------------------------------------------
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] turbaszek commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532110245



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       In my opinion it works as expected. I can use example generated with `--anonymize` flag:
   ```
   root@1aa14208df15:/opt/airflow# airflow info --anonymize
   ...
   Config info
   executor             | LocalExecutor
   task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
   sql_alchemy_conn     | postgresql+psycopg2://p...s:PASSWORD@postgres/airflow
   ```
   
   If some one can run `airflow info` in your deployment - it's too late, so masking information like conn uri (which is also accessible via `airflow config` command) will not increase security.




----------------------------------------------------------------
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 #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735248978


   This documentation contains sample output from this command. Can you update it?
   http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/modules_management.html


----------------------------------------------------------------
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] XD-DENG commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532107720



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       If everything is working correctly, the sample value here should be something like `postgresql+psycopg2://postgres:PASSWORD@postgres/airflow` instead, according to https://github.com/apache/airflow/blob/b858683abf5b17ef85d4b246e05871819a747f14/airflow/cli/commands/info_command.py#L85
   
   May you please help double check?
   
   OR, personally I think we can considering remove `sql_alchemy_conn` from the info command output 




----------------------------------------------------------------
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] github-actions[bot] commented on pull request #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735272903


   [The Workflow run](https://github.com/apache/airflow/actions/runs/388932142) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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] turbaszek commented on a change in pull request #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532087615



##########
File path: airflow/cli/commands/info_command.py
##########
@@ -447,8 +418,7 @@ def _send_report_to_fileio(info):
     try:
         link = _upload_text_to_fileio(str(info))
         print("Report uploaded.")
-        print()
-        print("Link:\t", link)
+        print(link)

Review comment:
       In this way users can do `airflow info --file-io | grep https | pbcopy`




----------------------------------------------------------------
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] github-actions[bot] commented on pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735280695


   The PR should be OK to be merged with just subset of tests as it does not modify Core of Airflow. The committers might merge it or can add a label 'full tests needed' and re-run it to run all tests if they see it is needed!


----------------------------------------------------------------
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] XD-DENG commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532107720



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       If everything is working correctly, the sample value here should be something like `postgresql+psycopg2://p...s:PASSWORD@postgres/airflow` instead, according to https://github.com/apache/airflow/blob/b858683abf5b17ef85d4b246e05871819a747f14/airflow/cli/commands/info_command.py#L85
   
   May you please help double check?
   
   OR, personally I think we can consider removing `sql_alchemy_conn` from the info command output
   
   ADD-UP: if we show it here, either we are showing something useful BUT sensitive, or we are showing something not very useful (after sufficient necessary masking), IMHO




----------------------------------------------------------------
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] github-actions[bot] commented on pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735277659


   [The Workflow run](https://github.com/apache/airflow/actions/runs/388968122) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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] turbaszek commented on pull request #12689: Use rich to render airflow info command

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#issuecomment-735251640


   <img width="1902" alt="Screenshot 2020-11-28 at 17 21 43" src="https://user-images.githubusercontent.com/9528307/100520487-3775e880-319e-11eb-873f-f305dd3c64b6.png">
   


----------------------------------------------------------------
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] XD-DENG commented on a change in pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532113300



##########
File path: docs/modules_management.rst
##########
@@ -232,29 +232,45 @@ Below is the sample output of the ``airflow info`` command:
 
 .. code-block:: none
 
-    Apache Airflow [1.10.11]
-
-    Platform: [Linux, x86_64] uname_result(system='Linux', node='Shekhar', release='5.4.0-42-generic', version='#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020', machine='x86_64', processor='x86_64')
-    Locale: ('en_US', 'UTF-8')
-    Python Version: [3.8.2 (default, Jul 16 2020, 14:00:26)  [GCC 9.3.0]]
-    Python Location: [/home/rootcss/venvs/airflow/bin/python3]
-
-    git: [git version 2.25.1]
-    ssh: [OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020]
-    kubectl: [NOT AVAILABLE]
-    gcloud: [NOT AVAILABLE]
-    cloud_sql_proxy: [NOT AVAILABLE]
-    mysql: [NOT AVAILABLE]
-    sqlite3: [3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1]
-    psql: [psql (PostgreSQL) 12.2 (Ubuntu 12.2-4)]
-
-    Airflow Home: [/home/rootcss/airflow]
-    System PATH: [/home/rootcss/venvs/airflow/bin:/home/rootcss/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/rootcss/.rvm/bin:/usr/local/go/bin:/home/rootcss/.rvm/bin]
-    Python PATH: [/home/rootcss/venvs/airflow/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/rootcss/venvs/airflow/lib/python3.8/site-packages:/home/rootcss/airflow/dags:/home/rootcss/airflow/config:/home/rootcss/airflow/plugins]
-    airflow on PATH: [True]
-
-    Executor: [SequentialExecutor]
-    SQL Alchemy Conn: [sqlite:////home/rootcss/airflow/airflow.db]
-    DAGS Folder: [/home/rootcss/airflow/dags]
-    Plugins Folder: [/home/rootcss/airflow/plugins]
-    Base Log Folder: [/home/rootcss/airflow/logs]
+    Apache Airflow: 2.0.0b3
+
+    System info
+    OS              | Linux
+    architecture    | x86_64
+    uname           | uname_result(system='Linux', node='85cd7ab7018e', release='4.19.76-linuxkit', version='#1 SMP Tue May 26 11:42:35 UTC 2020', machine='x86_64', processor='')
+    locale          | ('en_US', 'UTF-8')
+    python_version  | 3.8.6 (default, Nov 25 2020, 02:47:44)  [GCC 8.3.0]
+    python_location | /usr/local/bin/python
+
+    Tools info
+    git             | git version 2.20.1
+    ssh             | OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
+    kubectl         | NOT AVAILABLE
+    gcloud          | NOT AVAILABLE
+    cloud_sql_proxy | NOT AVAILABLE
+    mysql           | mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
+    sqlite3         | 3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1
+    psql            | psql (PostgreSQL) 11.9 (Debian 11.9-0+deb10u1)
+
+    Paths info
+    airflow_home    | /root/airflow
+    system_path     | /opt/bats/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    python_path     | /usr/local/bin:/opt/airflow:/files/plugins:/usr/local/lib/python38.zip:/usr/local/lib/python3.8:/usr/
+                    | local/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/site-packages:/files/dags:/root/airflow/conf
+                    | ig:/root/airflow/plugins
+    airflow_on_path | True
+
+    Config info
+    executor             | LocalExecutor
+    task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler
+    sql_alchemy_conn     | postgresql+psycopg2://postgres:airflow@postgres/airflow

Review comment:
       But can be discussed & addressed in separate PR anyway, if you prefer. I will approve this PR first.




----------------------------------------------------------------
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] turbaszek merged pull request #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
turbaszek merged pull request #12689:
URL: https://github.com/apache/airflow/pull/12689


   


----------------------------------------------------------------
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 #12689: Use rich to render info and cheat-sheet command

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #12689:
URL: https://github.com/apache/airflow/pull/12689#discussion_r532098635



##########
File path: airflow/cli/commands/cheat_sheet_command.py
##########
@@ -15,53 +15,44 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import contextlib
-from typing import Iterable, List, Union
+from typing import Iterable, List, Optional, Union
 
-from termcolor import cprint
+from rich.console import Console
 
 from airflow.cli.cli_parser import ActionCommand, GroupCommand, airflow_commands
+from airflow.cli.commands.info_command import SimpleTable
 from airflow.utils.helpers import partition
-from airflow.utils.platform import is_terminal_support_colors
-from airflow.utils.process_utils import patch_environ
-
-ANSI_COLORS_DISABLED = "ANSI_COLORS_DISABLED"
-"""Environment variable disable using rich output. It is supported by termcolor library"""
 
 
 def cheat_sheet(args):
     """Display cheat-sheet."""
-    with contextlib.ExitStack() as exit_stack:
-        if not is_terminal_support_colors():
-            exit_stack.enter_context(patch_environ({ANSI_COLORS_DISABLED: "1"}))
-        cprint("List of all commands:".upper(), attrs=["bold", "underline"])
-        print()
-        display_commands_index()
+    display_commands_index()
 
 
 def display_commands_index():
     """Display list of all commands."""
 
-    def display_recursive(prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]]):
+    def display_recursive(
+        prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]],
+        help_msg: Optional[str] = None

Review comment:
       This should fix CI failure
   
   ```suggestion
           prefix: List[str], 
           commands: Iterable[Union[GroupCommand, ActionCommand]],
           help_msg: Optional[str] = None
   ```




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