-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
[AIRFLOW-3998] Use nested commands in cli. #4821
Conversation
7513be6
to
0981878
Compare
Codecov Report
@@ Coverage Diff @@
## master #4821 +/- ##
==========================================
- Coverage 79.1% 78.83% -0.27%
==========================================
Files 489 489
Lines 30704 30675 -29
==========================================
- Hits 24288 24184 -104
- Misses 6416 6491 +75
Continue to review full report at Codecov.
|
👍 like to see this change. |
62fb38d
to
3656e9e
Compare
f5d7718
to
b611410
Compare
b611410
to
7edf4f1
Compare
This is still incomplete but ready for more review. I grouped commands related to dags into the @ashb @feng-tao @XD-DENG @Fokko: what do you think about the proposed changes? Happy to make any revisions, and I'll update documentation if/when we decide the final command structure. |
No strong preference to same commit/PR or others but maybe a slight lean towards another PR as this is already quite big. Have you checked what the rendered CLI docs look like with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Largely good I think, I only skimmed over the code changes (assuming they are some-what mechanical/rote in nature).
The following tasks are still at a top level:
task_failed_deps
-> should be undertasks
group?initdb
/upgradedb
/resetdb
- maybe adb
group is called for?sync_perm
-- it cuts across users, roles and dags, so this one probably should stay at the top level?run
-- this somehow exists at the top level and under tasks.
Just running airflow tasks
etc or any other "group" command fails with :AttributeError: 'Namespace' object has no attribute 'func'
- that should print the help for the group ideally.
airflow/bin/cli.py
Outdated
|
||
@cli_utils.action_logging | ||
def variables_export(args): | ||
export_helper(args.file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export_helper(args.file) | |
variable_export_helper(args.file) |
(and whatever is needed to make that function exist too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this change.
airflow/bin/cli.py
Outdated
'func': trigger_dag, | ||
'help': "Trigger a DAG run", | ||
'args': ('dag_id', 'subdir', 'run_id', 'conf', 'exec_date'), | ||
'help': 'DAGs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we expand this help text a little bit? Even something like "List and manage DAGs" would be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
6ece318
to
5d75b7e
Compare
2927a79
to
916af83
Compare
@ashb: looks like sphinx-argparse handles nested commands correctly, and I updated so that missing subcommands print usage instructions instead of throwing an error. I also shuffled commands as suggested. |
4a46363
to
5b67478
Compare
Updated documentation to match the new CLI structure. What's the next step here? A vote on the AIP? |
@jmcarp Yeah sounds right. Do you have time to write the vote email summarizing the changes or would you like me to pick this up? |
the change LGTM, once we get the pass from AIP. I think it is good to go. |
I'm traveling for work this week, so if you have time, feel free to write the vote email @ashb. Otherwise, I'll pick this up again next week. |
@ashb: now that I have time to get back to this, I'm not sure where to find the procedure for holding the vote. How does that work? |
It's not written down anywhere yet as we haven't fully formalized it. Here's an example of a recent vote on adding Pylint: https://lists.apache.org/thread.html/f4940d36e98ded96a2473bb2ccdfa4cc648faa2c1334b2aa901c0bba@%3Cdev.airflow.apache.org%3E |
3a460cb
to
9eec98a
Compare
Updated, tests passing. |
9eec98a
to
8086520
Compare
Sorry @jmcarp, I was in inbox hell and didn't see the ping, and it's conflicted again. I'm happy with this change now and the AIP is passed so once you resolve the conflicts again you can merge yourself(?) |
8086520
to
d30237f
Compare
Conflicts resolved @ashb. I don't think I ever got commit access to the repo--I must have missed a step. Any idea what I missed? |
I'm waiting for Travis to finish work. |
Make sure you have checked all steps below.
Jira
Description
This is a proof of concept for https://issues.apache.org/jira/browse/AIRFLOW-3998 / https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-16%3A+Use+nested+commands+in+CLI.
Tests
Commits
Documentation
Code Quality
flake8