Skip to content

Latest commit

 

History

History
116 lines (82 loc) · 4.59 KB

CONVENTIONS.md

File metadata and controls

116 lines (82 loc) · 4.59 KB

Creating New Plugins

  • Create plugins in your own personal repo (outside of the opensearch-project). This allows for rapid iteration during initial development without the overhead of being an official part of the project.
  • Plugins can be later moved into the opensearch-project on a case-by-case basis. A formal path for this process is yet to be created.
  • Do not add new plugins to the plugins folder within the core OpenSearch repository. The maintainers likely do not have domain expertise in your new optional plugin. If you think it should be there anyway, please explain why in the RFC stage.

Plugin Naming Conventions

GitHub

  • Within the opensearch-project org, do not include the word OpenSearch or OpenSearch Dashboards in the repo name.
  • Inherit templates, CoC, etc., from opensearch-project/.github.
  • Use lowercase repo names.
  • Provide a meaningful description, e.g. An OpenSearch Dashboards plugin to perform real-time and historical anomaly detection on OpenSearch data.

OpenSearch Plugins

  • Do not include the word plugin in the repo name, e.g. job-scheduler.

OpenSearch Dashboard Plugins

Metadata

OpenSearch Plugins

  • Plugin name starts with opensearch-.
  • Include opensearch- in the plugin name.
  • Description does not end with a period.
  • Include OpenSearch and plugin in the description.
opensearchplugin {
    name 'opensearch-job-scheduler'
    description 'OpenSearch Job Scheduler plugin'
    classname 'org.opensearch.jobscheduler.JobSchedulerPlugin'
}

OpenSearch Dashboard Plugins

  • Plugin ID is lowercase camelCase, e.g. observabilityDashboards.
  • Package name in package.json is kebab-case, e.g. observability-dashboards
  • Version follows semver.

For example, dashboards-observability/opensearch_dashboards.json.

{
  "id": "observabilityDashboards",
  "version": "2.5.0.0",
  "opensearchDashboardsVersion": "2.5.0",
  "server": true,
  "ui": true,
  "requiredPlugins": []
}

Artifacts

OpenSearch Plugins

  • Artifacts are of the <package name>-<version> format, e.g. opensearch-job-scheduler-1.0.0.0.zip.

OpenSearch Dashboards Plugins

  • Artifacts are of the <package name>-<version> format, e.g. notebooks-dashboards-1.0.0.0.zip.

Classes

  • Lowercase namespaces, e.g. org.opensearch.jobscheduler.
  • CamelCase classes, e.g. org.opensearch.jobscheduler.JobSchedulerPlugin.

Settings

  • Settings do not have a prefix.
  • Use plugins. for plugin settings, e.g. plugins.jobscheduler.request_timeout.
  • Do not use opensearch in the setting name, e.g. plugins.jobscheduler.request_timeout and not opensearch.jobscheduler.request_timeout.

APIs

  • Use _ as prefix for APIs, e.g. _plugins/_anomaly_detection/*.
  • Use snake case when naming API request/response fields and parameters (for example, use_case), separating individual words with an underscore.
  • Replace hyphens with underscores (for example, for retrieval-augmented generation, use retrieval_augmented_generation).
  • When creating a new type of a component, take note of how other components of this type are named. For example, search processors are named omitting the word processor at the end (the collapse processor is called collapse).

Indices

  • Use . as prefix for indices.

Identifiers

  • TODO

Variables

  • Use common sense for your plugin.