The backend plugin API (io.jafar.shell.backend.*) follows strict semantic versioning:
- MAJOR (1.0.0 → 2.0.0): Breaking changes to plugin API allowed
- MINOR (0.10.0 → 0.11.0): Backward-compatible additions only
- PATCH (0.10.0 → 0.10.1): Bug fixes, no API changes
The following modifications require a MAJOR version bump:
-
JfrBackend interface changes:
- Adding non-default methods
- Removing methods
- Changing method signatures (parameters, return types)
-
BackendCapability enum:
- Removing capabilities
- Changing capability semantics
-
Source interfaces (EventSource, MetadataSource, ChunkSource, ConstantPoolSource):
- Changing method signatures
- Modifying Map contract keys (e.g., removing "id" field)
-
Exception contracts:
- Removing exception types
- Changing exception inheritance
These changes are backward-compatible:
- Adding default methods to JfrBackend
- Adding new BackendCapability enum values
- Adding optional Map keys to returned data
- Adding new exception types
- Internal implementation changes (BackendRegistry, PluginManager)
japicmp runs on every build for non-SNAPSHOT versions:
- Compares current API against previous release
- Fails build on breaking changes (unless major version bump)
- Generates HTML report:
jfr-shell/build/reports/japicmp.html
When creating a backend plugin:
- Depend on
jafar-shellwithcompileOnlyscope - Target the minimum shell version you want to support
- Test against multiple shell versions if possible
- Use capability checks for optional features
Backend plugins should declare their compatible shell version range:
- Minimum version: Oldest shell version plugin supports
- Maximum version: Latest tested shell version (or next major version)
- Example: Plugin built for 0.10.0 works with 0.10.x and 0.11.x (until 1.0.0)
When a breaking change is necessary:
- Document the change: Update this policy with migration guide
- Bump major version: Increment MAJOR component (e.g., 0.x.y → 1.0.0)
- Deprecation period: For minor versions, provide one version deprecation notice
- Update plugins: Coordinate with known third-party plugin maintainers
- Release notes: Clearly document breaking changes in CHANGELOG.md
- 0.10.0+: Plugin API is stable, breaking changes require major bump
- 1.0.0: Full API stability guarantee, follows semantic versioning strictly