[FEATURE] Add test datasource connection button - #99
Open
adrianSepiol wants to merge 1 commit into
Open
Conversation
This was referenced Apr 7, 2026
adrianSepiol
marked this pull request as ready for review
April 7, 2026 09:30
adrianSepiol
marked this pull request as draft
July 27, 2026 12:51
adrianSepiol
force-pushed
the
add-test-connection-button
branch
3 times, most recently
from
July 27, 2026 14:19
3df35e7 to
6e06d51
Compare
adrianSepiol
marked this pull request as ready for review
July 27, 2026 14:23
Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
adrianSepiol
force-pushed
the
add-test-connection-button
branch
from
July 27, 2026 14:31
6e06d51 to
bcda582
Compare
6 tasks
jgbernalp
reviewed
Jul 28, 2026
| const existing = draft.proxy.spec.allowedEndpoints ?? []; | ||
| const alreadyAllowed = existing.some((e) => e.endpointPattern === healthCheckPath && e.method === 'GET'); | ||
| if (!alreadyAllowed) { | ||
| draft.proxy.spec.allowedEndpoints = [...existing, { endpointPattern: healthCheckPath, method: 'GET' }]; |
Contributor
There was a problem hiding this comment.
This is inserted as a regex, would it fail it the dots or other reserved characters are not escaped?
jgbernalp
reviewed
Jul 28, 2026
| }, [testConnection, successSnackbar, exceptionSnackbar]); | ||
|
|
||
| return ( | ||
| <Button onClick={handleClick} color="info" variant="outlined" {...buttonProps}> |
Contributor
There was a problem hiding this comment.
We probably should have a testing... state and block the button while is testing, otherwise rapid clicks can cause multiple snackbars.
jgbernalp
reviewed
Jul 28, 2026
| const pluginSpec = spec.plugin.spec; | ||
|
|
||
| if (hasDirectUrl(pluginSpec)) { | ||
| await fetch(`${pluginSpec.directUrl}${normalizedPath}`, { |
Contributor
There was a problem hiding this comment.
should we sanitize this url?, it seems it might contain double slash // if directUrl ends with slash
jgbernalp
reviewed
Jul 28, 2026
| value: Spec; | ||
| onChange: (next: Spec) => void; | ||
| isReadonly?: boolean; | ||
| testConnection?: () => Promise<void>; |
Contributor
There was a problem hiding this comment.
This seems to apply for all plugins, is there a more concrete interface for the datasources editors?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Button for testing datasource connections
Related pull requests (in order):
Related issue:
perses/perses#1542
Description
Adds a Test Connection button to the datasource editor that validates connectivity before saving. The button is wired through the editor component chain (DatasourceEditorForm → PluginEditor → PluginSpecEditor) where the connection logic is bound to the plugin's healthCheckPath and the current project/dashboard context. As part of this, buildProxyUrl is also migrated to @perses-dev/client, replacing the local implementation in perses/ui/app that will be removed in a companion PR.
Screenshots
In perses/plugins#620
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: