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

Initial Review and Publishing Process #1

Closed
7 tasks done
ppaulweber opened this issue Jan 19, 2024 · 0 comments · Fixed by #2
Closed
7 tasks done

Initial Review and Publishing Process #1

ppaulweber opened this issue Jan 19, 2024 · 0 comments · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@ppaulweber
Copy link
Member

ppaulweber commented Jan 19, 2024

In order to have this data source plugin published in the Grafana plugin catalog we have received the following change requests:

  • provide missing hide functionality (either frontend or backend side) of a given data source
  • rework the metric query mode user experience
  • handle query state changes correctly in the frontend to only send necessary JSON data along with the query request
  • provide clear separation of plugin.Datasource configuration and JSON data model and JSON secrets, see:
    Password string `json:"password"` // secrets
  • remove necessary getResource frontend calls and still not used backend logic, see: https://github.com/fiskaly/grafana.surrealdb/blob/v0.1.0/src/datasource.ts#L26 and
    func (r *Datasource) CallResource(ctx context.Context, request *backend.CallResourceRequest, response backend.CallResourceResponseSender) error {
    // log.DefaultLogger.Info(fmt.Sprintf("CallResource: %s", request.Path))
    switch request.Path {
    // case "TODO":
    // return response.Send(
    // &backend.CallResourceResponse{
    // Status: http.StatusOK,
    // Body: []byte(`{}`),
    // },
    // )
    default:
    return response.Send(
    &backend.CallResourceResponse{
    Status: http.StatusNotFound,
    Body: []byte(`{}`),
    },
    )
    }
    }
  • replace the panic() with an empty string, see:
    panic(fmt.Sprintf("invalid QueryMode state '%d'", r))
  • remove query syntax checks and use directly the checks by the underlying data source, see:
    if strings.HasPrefix(surql, "select") == false &&
    strings.HasPrefix(surql, "SELECT") == false &&
    strings.HasPrefix(surql, "info") == false &&
    strings.HasPrefix(surql, "INFO") == false &&
    strings.HasPrefix(surql, "return") == false &&
    strings.HasPrefix(surql, "RETURN") == false {
@ppaulweber ppaulweber added the bug Something isn't working label Jan 19, 2024
@ppaulweber ppaulweber self-assigned this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant