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

[Multi data Source] Data source and Data source management plugin auditing #6204

Closed
2 of 3 tasks
Tracked by #5872
bandinib-amzn opened this issue Mar 19, 2024 · 2 comments · Fixed by #6437
Closed
2 of 3 tasks
Tracked by #5872

[Multi data Source] Data source and Data source management plugin auditing #6204

bandinib-amzn opened this issue Mar 19, 2024 · 2 comments · Fixed by #6437
Assignees
Labels
multiple datasource multiple datasource project refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository. v2.14.0

Comments

@bandinib-amzn
Copy link
Member

bandinib-amzn commented Mar 19, 2024

Issue Description

Perform a general audit of the data source and data source management plugin.

Proposed Implementation

  1. Ensure near 100% coverage of documentation.
  2. Ensure that there is documentation coverage of the backend and its functions.
  3. Perform a static code analysis, and address issues that it finds.
    3.1 Ensure that best practices are followed.
    3.2 Fix typo errors.
    3.3 Remove duplicate code
    3.4 Naming of methods, parameters should be adherent to their functionality.
    3.5 Correct TypeScript type errors
  4. Ensure near 100% coverage of Unit testing
  5. Add functional. integration tests
  6. Search for security vulnerabilities.

Tasks

@bandinib-amzn bandinib-amzn added refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository. multiple datasource multiple datasource project v2.14.0 labels Mar 19, 2024
@bandinib-amzn bandinib-amzn self-assigned this Mar 19, 2024
@bandinib-amzn bandinib-amzn added OSCI Open Source Contributor Initiative and removed OSCI Open Source Contributor Initiative labels Mar 21, 2024
@seraphjiang
Copy link
Member

Thanks @bandinib-amzn for taking the initiative to raise the bar for the quality.

@bandinib-amzn
Copy link
Member Author

Data source plugin and data source management plugin both have data source attribute interface.

Interface in data source plugin:

export interface DataSourceAttributes extends SavedObjectAttributes {
title: string;
description?: string;
endpoint: string;
auth: {
type: AuthType;
credentials: UsernamePasswordTypedContent | SigV4Content | undefined | AuthTypeContent;
};
lastUpdatedTime?: string;
name: AuthType | string;
}

Interface in data source management plugin:

export interface DataSourceAttributes extends SavedObjectAttributes {
title: string;
description?: string;
endpoint?: string;
dataSourceVersion?: string;
installedPlugins?: string[];
auth: {
type: AuthType | string;
credentials:
| UsernamePasswordTypedContent
| SigV4Content
| { [key: string]: string }
| undefined;
};
}

It creates confusion among the plugin owners and in general consumers of data source plugin. Therefore, we should maintain only one interface for data source attributes.

I propose to remove interface from data_source_management[https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/data_source_management/].

  • Move extra properties to interface in data_source plugin.
  • change type of auth_type to be AuthType | string to allow custom auth type along with predefined.
  • To reduce impact and efforts to change reference in files which are using data_source_management plugin interface, we will export the interface from the same file from where we removed duplicate interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multiple datasource multiple datasource project refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository. v2.14.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants