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

Reject 'connections add' CLI request if URI provided is invalid #12370

Merged
merged 2 commits into from
Nov 15, 2020

Conversation

XD-DENG
Copy link
Member

@XD-DENG XD-DENG commented Nov 14, 2020

Closes #12369

  • Reject the request is the URI is invalid
  • The validity is decided by availability of both 'scheme' and 'netloc' in the parse result

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

The validity is decided by availability of both 'scheme' and 'netloc' in the parse result
@XD-DENG XD-DENG added this to the Airflow 2.0.0-beta3 milestone Nov 14, 2020
@XD-DENG XD-DENG requested review from ashb and kaxil November 14, 2020 20:31
for arg in alternative_conn_specs:
if getattr(args, arg) is not None:
invalid_args.append(arg)
elif not args.conn_type:
missing_args.append('conn-uri or conn-type')
if missing_args:
msg = 'The following args are required to add a connection:' + f' {missing_args!r}'
msg = f'The following args are required to add a connection: {missing_args!r}'
Copy link
Member Author

Choose a reason for hiding this comment

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

This line and line 200 are not really related to this PR's scope. But fixing them is too minor and maybe not worth creating separate PR for them. So fixing them together here.

@github-actions
Copy link

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

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Nov 14, 2020
@github-actions
Copy link

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!

@XD-DENG XD-DENG merged commit 823b3aa into apache:master Nov 15, 2020
@XD-DENG XD-DENG deleted the issue-12369 branch November 15, 2020 10:48
@XD-DENG XD-DENG added the type:bug-fix Changelog: Bug Fixes label Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI okay to merge It's ok to merge this PR as it does not require more tests type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In 2.0.0b2/master, CLI "airflow connections add" is not handling invalid URIs properly
2 participants