Skip to content

[RFC] Clarifying Semantic Versioning for OpenSearch Dashboards #9491

Open
@ashwin-pc

Description

@ashwin-pc

Summary

This RFC proposes a refined Semantic Versioning (SemVer) policy for OpenSearch Dashboards. It explicitly separates internal npm dependencies from the semver public contract, reduces the likelihood that internal changes will cause breaking version bumps, and provides examples illustrating when a dependency update affects the public API (and thus semver) versus when it does not.

Background

OpenSearch Dashboards currently treats many aspects of its platform—including npm dependencies, server APIs, and the UI—as part of its semver contract. In particular:

  • Plugin Dependencies: Plugins share many core npm dependencies with the platform. Upgrading or changing a dependency version can cause plugin authors to modify their implementations, even if the public contract remains untouched.
  • Server APIs: The server exposes documented APIs used by plugins and external consumers.
  • UI Changes: Significant UI updates have also been considered potentially breaking, though the criteria for what qualifies as a breaking UI change is not always clear.
    This broad interpretation of what counts as a semver-breaking change has made it difficult to address security fixes and internal improvements without triggering a major version increment.

Motivation

  1. Security Fixes Without Major Releases: Enable prompt patching of vulnerabilities without forcing plugin developers to react to an unnecessary major version bump.
  2. Clear Separation of Internal vs. Public: Provide explicit guidance to distinguish changes that affect external plugin authors or users from internal implementation details.
  3. Predictable Release Cycles: Reduce friction and confusion for plugin maintainers, ensuring that semver-breaking updates only occur when a documented public interface truly changes.
  4. Better Communication: Clarify what “public contract” means, so contributors and users know precisely which changes are considered breaking, minor, or patches.

Proposal

1. Defining the Public Contract

Principle: A “public contract” is any interface or behavior that is:

  • Documented:
    Covered in official documentation or API references explicitly intended for external consumption (e.g., plugin APIs, server endpoints).
  • Stability-Promised:
    Declared stable and supported across releases unless a deliberate version bump is communicated.
  • Externally Consumed:
    Relied upon by third-party developers or users, such that any change would require them to alter their code or workflows.
  • Impactful When Altered:
    Modifications would force external consumers to update their implementations or significantly change their usage patterns.

Public Contract Checklist

Ask these questions when determining if a change affects the public contract:

  1. Is it explicitly documented as part of our public API or UI behavior?
  2. Is it intended for and used by plugin developers or end users (externally)?
  3. Would a change force external consumers to adjust their code or workflows?
  4. Have we promised stability for it across releases?
    If all answers above are “yes,” changes to that interface are semver-breaking. Otherwise, the change can be classified as internal.

2. Excluding npm Dependencies from Semantic Versioning

Because of the coupled architecture, npm dependencies are often shared between OpenSearch Dashboards and its plugins, causing updates to affect plugin builds. This policy explicitly excludes npm dependency changes from semver unless they alter a documented, stable public interface.

  1. Internal vs. Public Impact:
    • Internal Updates: Any upgrade or addition to npm dependencies that does not alter a documented API or plugin interface is considered an internal change.
      Example: Upgrading from [email protected] to [email protected] to address a security fix. The plugin API or behavior doesn’t change, so this is not a breaking change.
    • Public Interface Changes: If a dependency upgrade does modify a documented function, endpoint, or behavior on which plugins rely, it is a breaking change.
      Example: Migrating from lodash@4 to lodash@5 means that we cannot support a data plugin API that directly exposes a lodash API that changes with the version upgrade
  2. Handling New Dependencies: When core introduces a new npm dependency that plugins might already use, it is not considered breaking unless it forces changes in the documented public interface.

Objective: Decouple the semver contract from routine npm dependency updates, so only true API/behavioral changes trigger a major version bump.

3. Versioning Rules

OpenSearch Dashboards adopts Semantic Versioning 2.0.0 with the following structure:

  • Major Version (X): Introduces breaking changes to the documented public contract (e.g., plugin APIs, server APIs, or UI behaviors that are explicitly supported).
    • Deprecations planned for removal can also occur here.
  • Minor Version (Y): Adds new, non-breaking features or enhancements to the public contract.
    • Includes additions to server APIs, new plugin APIs, or UI enhancements that do not disrupt existing usage.
  • Patch Version (Z): Contains backward-compatible bug fixes, security patches, or internal improvements.
    • Npm dependency upgrades that do not alter the public contract fall into this category.

4. UI Versioning Considerations

While UI changes can sometimes be disruptive, the RFC distinguishes:

  • UI as a Public Contract: If the UI includes documented user experiences or extension points (e.g., plugin injection points, UI event hooks), then changes to these behaviors are considered breaking.
  • Cosmetic or Minor Changes: Layout or style updates that do not affect documented plugin interactions or user workflows should be classified as internal, and thus only require a patch or minor release if they are purely additive.

5. Deprecation Policy

To provide clarity on when features or interfaces will be removed:

  1. Announce Deprecation: Clearly mark deprecated features in release notes, documentation, and console/log warnings.
  2. Provide a Timeline: Maintain support for deprecated features for at least one minor release cycle before removal in the next major version.
  3. Migration Guidance: Offer instructions on how to transition away from deprecated features.

6. Implementation Plan

Once this RFC is closed we can add a SEMVER.md file in the repository to outline these rules, including the examples of internal vs. public changes.

Feedback required

The feedback that this RFC is looking for is

  1. Feedback from plugin developers, end users, and maintainers on the proposed policy
  2. Use cases to further refine the guidance around “public contract” boundaries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions