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

Added copy connection action #13859

Closed
wants to merge 7 commits into from

Conversation

VBhojawala
Copy link
Contributor

Added copy connection action which attaches __suffix to duplicated connection.

Closes : #12401

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Jan 23, 2021
@mik-laj
Copy link
Member

mik-laj commented Jan 24, 2021

Can you add tests to avoid regression?

@VBhojawala
Copy link
Contributor Author

Added test case to check copy connection with and without prefix with multi select.

airflow/www/views.py Outdated Show resolved Hide resolved
airflow/www/views.py Outdated Show resolved Hide resolved
'aws_mongo',
'aws_mongo__1',
'aws_mongo__2',
'aws_mongo__3',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it fair to treat all aws_mongo variants as essentially interchangeable in terms of numbering them? Would aws_mongo__1__1 make more sense than aws_mongo__3 to make clear that it's a copy of aws_mongo__1? It doesn't look as nice, but it seems like people would copy aws_mongo__1 because they want a copy of that exact variant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here in test case i have used '__1' as existing connection to test copy connection which were already copied connection and not renamed after copy.

For Pattern matching in RegEx we have used '__/d+$' to differentiate system(airflow) assigned suffix (we have used same Regex for Task and TaskGroup decorators). User can use single underscore '_' or '-' to assign number to connection name which will make it start from 1.

For Example

'mongo_1' -> 'mongo_1__1'
'mongo-1' -> 'mongo-1__1'

tests/www/test_views.py Outdated Show resolved Hide resolved
@VBhojawala
Copy link
Contributor Author

Re-based PR.

@github-actions
Copy link

github-actions bot commented Apr 4, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Apr 4, 2021
@github-actions github-actions bot closed this Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate connections UI
3 participants