Use rich to render info and cheat-sheet command#12689
Use rich to render info and cheat-sheet command#12689turbaszek merged 7 commits intoapache:masterfrom
Conversation
|
This documentation contains sample output from this command. Can you update it? |
|
Sure, is it only for me or the images are not rendering on this page? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| print("Report uploaded.") | ||
| print() | ||
| print("Link:\t", link) | ||
| print(link) |
There was a problem hiding this 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
|
The Workflow run 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*. |
|
The Workflow run 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*. |
6daf7ac to
9088f0a
Compare
|
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! |
There was a problem hiding this comment.
This should fix CI failure
| prefix: List[str], commands: Iterable[Union[GroupCommand, ActionCommand]], | |
| help_msg: Optional[str] = None | |
| prefix: List[str], | |
| commands: Iterable[Union[GroupCommand, ActionCommand]], | |
| help_msg: Optional[str] = None |
There was a problem hiding this comment.
Yeah, thanks! I fixed it locally but did not add this to commit 🤦
9088f0a to
284da23
Compare
| Config info | ||
| executor | LocalExecutor | ||
| task_logging_handler | airflow.utils.log.file_task_handler.FileTaskHandler | ||
| sql_alchemy_conn | postgresql+psycopg2://postgres:airflow@postgres/airflow |
There was a problem hiding this comment.
If everything is working correctly, the sample value here should be something like postgresql+psycopg2://p...s:PASSWORD@postgres/airflow instead, according to
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
There was a problem hiding this 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.
There was a problem hiding this 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?
airflow/airflow/cli/cli_parser.py
Lines 649 to 653 in 07a2ed5
There was a problem hiding this comment.
But can be discussed & addressed in separate PR anyway, if you prefer. I will approve this PR first.
airflow info
Before:

After:

airflow cheat-sheet
Before:

After:

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