-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat: add test connection button to ui #51055
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
feat: add test connection button to ui #51055
Conversation
cbd480b to
b806bc1
Compare
pierrejeambrun
left a comment
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.
Nice, thanks for the pull request.
There is a configuration option core.test_connection to enable or not this feature. We should read that config and display or not the buttons depending on the value.
To retrieve this value in the front-end, you'll most probably need to add the value to the ui/config.py get_configs endpoint. This endpoint is called at the initialization of the web application and you can access the value through the useConfig hook.
855293f to
1266a90
Compare
|
@pierrejeambrun Thanks for the review! I've just updated this PR. We can now control the state of the button via |
pierrejeambrun
left a comment
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.
Nice, a few suggestiosn / nit.
Looking good overall.
airflow-core/src/airflow/ui/src/pages/Connections/TestConnectionButton.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Connections/TestConnectionButton.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Connections/TestConnectionButton.tsx
Outdated
Show resolved
Hide resolved
b9ca4fd to
ed3555b
Compare
ed3555b to
1b2fb19
Compare
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.
Thanks, we can improve in follow up PRs if needed. (The toast message on success, not sure we need to display the msg there)
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.
Yeah. It confused me as well, but that's how our api currently works. The test connection API returns I need some hints or suggestions on how to deal with this. |
airflow-core/src/airflow/ui/src/pages/Connections/TestConnectionButton.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Connections/TestConnectionButton.tsx
Outdated
Show resolved
Hide resolved
eb53842 to
eb707fb
Compare
@pierrejeambrun Eventually I removed the toasts which can be misleading for now. I'd like to help if we have further discussions and follow-up issues! |
eb707fb to
6604800
Compare
airflow-core/src/airflow/ui/src/pages/Connections/TestConnectionButton.tsx
Show resolved
Hide resolved
bbovenzi
left a comment
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.
One last thing. Let's not add any new plaintext. Instead, add each one to the i18n/en/ directory at least.
* feat: add test connection button to ui * fix: determine test connection access based on configuration settings * fix: simplify button design * refactor: small changes on test connection button * fix: remove toasts * fix: add loading prop to the button * feat: support i18n in test connection button
* feat: add test connection button to ui * fix: determine test connection access based on configuration settings * fix: simplify button design * refactor: small changes on test connection button * fix: remove toasts * fix: add loading prop to the button * feat: support i18n in test connection button


closes: #50607
Why
The "test connection" fuctionality is currently missing in Airflow 3 UI.
What
Add a "Test Connection" button to each connection entry.
test-connection-button.mp4
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.