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

Standardize plugin naming conventions #10

Closed
dblock opened this issue Apr 28, 2021 · 13 comments
Closed

Standardize plugin naming conventions #10

dblock opened this issue Apr 28, 2021 · 13 comments
Assignees
Labels
Milestone

Comments

@dblock
Copy link
Member

dblock commented Apr 28, 2021

Dashboard plugins are non-dashboard plugins are following different naming conventions. Plugin names, folder names, architecture naming and artifact naming should be consistent for all plugins, regardless of what kinds of plugins they are.

For dashboards this was enforced in 7.7 here, PR here.

@dblock dblock added the enhancement New feature or request label Apr 28, 2021
@dblock dblock changed the title Plugin artifacts naming conventions Standardize plugin artifacts naming conventions Apr 28, 2021
@dblock dblock added this to the 1.0 beta2 milestone Apr 28, 2021
@stockholmux
Copy link
Member

This drives me nuts. This may echo a Javascript/TypeScript style, avoiding translating what is reference in source to a filename, which makes some sense.

@dblock dblock self-assigned this Apr 28, 2021
@saratvemulapalli saratvemulapalli changed the title Standardize plugin artifacts naming conventions Standardize plugin naming conventions May 7, 2021
@saratvemulapalli
Copy link
Member

saratvemulapalli commented May 7, 2021

Updated this issue to track all items for naming conventions across plugins.
We can work on a doc once these items are cemented!

  • Artifacts
  • Folder name
  • Classes
  • APIs
  • Indices
  • Identifiers
  • Variables

@ohltyler
Copy link
Member

ohltyler commented May 7, 2021

Proposed a fix in this issue on Dashboards last week which could unblock automating this rename process and allow for easily changing the plugin name and folder to be consistent with OpenSearch plugins (in other words, not camel case).

The plugin id itself is used by the Dashboards platform, & will be a more complex fix as it is required to be camel case and is "part of the plugin contract" as mentioned here. It will have a lot more implications when changing from camel case to something else.

This id change is largely internal though. The quicker fix will address the (1) Artifacts and (2) Folder name boxes mentioned above, to allow for consistency.

@cliu123
Copy link
Member

cliu123 commented May 7, 2021

A template of the naming convention for class, method and variable, ES plugins do not have prefixes.
@dblock @dblock @stockholmux If we could have a quick decision on this, that would help us unblock a few plugin PRs pending for review. Thanks!

@dblock
Copy link
Member Author

dblock commented May 10, 2021

This is part of #12.

@cliu123
Copy link
Member

cliu123 commented May 10, 2021

This is part of #12.

@dblock The scope of this issue looks closer to the naming convention for method, class and variable.
@dblock @saratvemulapalli Replacing kibana/opendistro with openSearchDashboards/openSearch vs. Removing the prefixes. Is it necessary to impose commen naming conventions to all plugins for class, method and variable? If not, plugins can decide to go with whatever approaches that make more sense.

@vrozov
Copy link

vrozov commented May 11, 2021

@dblock #12 seems to be more related to supporting backward compatibility and this issue was updated by @saratvemulapalli to include discussion on naming convention for various artifacts (folders, APIs, classes, methods and etc).

One of the goal of adopting naming convention is to improve code readability and another goal is to minimize diffs when developers with different code style and preferences contribute to a shared (open source) project. With code readability in mind and to make contributions easier I would suggest not to require OpenSearch and OpenSearchDashboard prefix for classes, methods and variables.

@dblock
Copy link
Member Author

dblock commented May 11, 2021

I just started something in #19 for "recommended" naming conventions.

I'll track opensearch-project/OpenSearch-Dashboards#322 for backwards compat.

@saratvemulapalli
Copy link
Member

@vrozov Definitely agreed. Classes, varibles, methods etc should not have OpenSearch in them and its up to plugin owners to decide whats right for them.

This list will just provide guidance if we need something common, it provides a recommendation and it makes sure we are consistent across plugins.

@cliu123
Copy link
Member

cliu123 commented May 11, 2021

@vrozov Definitely agreed. Classes, varibles, methods etc should not have OpenSearch in them and its up to plugin owners to decide whats right for them.

This list will just provide guidance if we need something common, it provides a recommendation and it makes sure we are consistent across plugins.

It's great that we have had the agreement on this.
@dblock If no further concerns, we'll go ahead and remove the opensearch prefixes from the class name, method name and variable name.

@dblock
Copy link
Member Author

dblock commented May 11, 2021

It sounds good to me. Can you please suggest text for these specific examples on top of #19?

@cliu123
Copy link
Member

cliu123 commented May 12, 2021

Updated this issue to track all items for naming conventions across plugins.
We can work on a doc once these items are cemented!

  • Artifacts
  • Folder name
  • Classes
  • APIs
  • Indices
  • Identifiers
  • Variables

@saratvemulapalli We have more to rename, for example, settings.

@dblock
Copy link
Member Author

dblock commented May 12, 2021

I merged #19, which brought in https://github.com/opensearch-project/opensearch-plugins/blob/main/CONVENTIONS.md. Please contribute more conventions to this document!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants