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

Add extension points for data source links and config properties customization. #2892

Closed
wants to merge 2 commits into from

Conversation

emtwo
Copy link

@emtwo emtwo commented Oct 3, 2018

This PR places 2 extension points for someone interested in writing an extension that would provide a link for data source documentation.

It also adds the ability to add configuration properties which could be used, for example, to let someone input their desired data source URL from the admin page.

Here is an example of this usage: https://github.com/mozilla/redash-stmo/blob/master/src/redash_stmo/datasource_link.py#L61

@request-info
Copy link

request-info bot commented Oct 3, 2018

We would appreciate it if you could provide us with more info about this issue/pr!

@request-info request-info bot added the Needs More Information Seen by a team member, not ready for a full review label Oct 3, 2018
Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

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

Do you really use different URLs for the same type of data source?

Wouldn't it be possible for the extension to have a list of URLs that you load based on the data source type and/or name?

@emtwo
Copy link
Author

emtwo commented Oct 4, 2018

@arikfr Perhaps in most cases the same type of data source will have the same documentation. But, for example, different versions of the same data source type might have different documentation.

Is your concern that you prefer extensions cannot customize config properties? I think it could be useful and generalize to other use cases as well.

@arikfr
Copy link
Member

arikfr commented Oct 5, 2018

Perhaps in most cases the same type of data source will have the same documentation. But, for example, different versions of the same data source type might have different documentation.

In this case, you can have overrides based on the data source ID/name. It's not very convenient to manage as if it was in the UI, but still manageable considering how (not) often data sources update.

Is your concern that you prefer extensions cannot customize config properties? I think it could be useful and generalize to other use cases as well.

Exactly. Do you have such use cases in mind?

@jezdez jezdez removed the Needs More Information Seen by a team member, not ready for a full review label Oct 8, 2018
@emtwo
Copy link
Author

emtwo commented Oct 17, 2018

Is your concern that you prefer extensions cannot customize config properties? I think it could be useful and generalize to other use cases as well.

Exactly. Do you have such use cases in mind?

We've used it before here: mozilla#31 to allow versioned tables to not be visible. I know you've mentioned a couple of times (e.g. mozilla#376 (comment)) your idea to have a better schema browser so that we wouldn't need that feature.

However, there could be additional metadata about a data source that does not always generally apply to every user of Redash. Perhaps for example, we are thinking of having links to sample queries per data source that can serve as documentation to guide a user. These would not be great to have hard-coded since they could change for a variety of reasons (e.g. schema change, adding new examples). But I could also see this being a feature that not everyone needs in Redash.

@emtwo
Copy link
Author

emtwo commented Nov 9, 2018

@arikfr I think in person you had mentioned a simpler way we can do this. Would you be able to share on this ticket the idea you had in mind? Thanks!

@arikfr
Copy link
Member

arikfr commented Nov 13, 2018

So my idea was simple:

  1. To avoid having to update the configuration schema to add arbitrary data to a data source, let's just have another field on this model to hold the extra options. This field won't have a schema, so can be used by extensions. Also, it won't be encrypted (unlike options post Change: encrypt data source options. 🔓 #2970).

  2. Update the data source creation/edit form to have some global options that apply to all data sources. These global options will be stored in this new field.

  3. Add extension point to make it possible to add new fields to the global options.

This will be useful for the data source URL option, to store SSH credentials (to support SSH tunnels) or for table filtering options.

WDYT?

@emtwo emtwo mentioned this pull request Mar 8, 2019
1 task
@emtwo
Copy link
Author

emtwo commented Mar 8, 2019

Closing this in favour of #3558

@emtwo emtwo closed this Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants