Semantic Versioning
Vespa follows semantic versioning as described at vespa.ai/releases#versions.Version numbers follow the format MAJOR.MINOR.PATCH where:
- MAJOR version changes indicate incompatible API changes
- MINOR version changes add functionality in a backward-compatible manner
- PATCH version changes are backward-compatible bug fixes
Public API Compatibility
API Annotations
Vespa uses Java annotations to mark public APIs:Compatibility Rules
This means for public, non-beta APIs:Preserve Method Signatures
You cannot change or remove existing method signatures, including:
- Method names
- Parameter types
- Return types
- Thrown exceptions (cannot add checked exceptions)
What You Can Do
For public APIs, you can:Add New Methods
Add New Methods
Adding new methods to interfaces or classes is allowed (though it may require updating the ABI spec):
Add New Classes
Add New Classes
Adding entirely new classes to a
@PublicAPI package is allowed:Widen Visibility
Widen Visibility
Changing protected methods to public, or package-private to public is allowed:
Mark APIs as @Beta
Mark APIs as @Beta
New APIs can be marked as
@Beta to indicate they’re experimental:ABI Verification
Automatic Verification
ABI (Application Binary Interface) compatibility is verified during the regular Java build:The build step will automatically verify that you haven’t broken ABI compatibility.
Build Failures
The ABI verification can fail in two scenarios:Incompatible Changes
Incompatible Changes
If you make incompatible changes to public APIs:Solution: Revert the incompatible change and find an alternative approach (e.g., add a new method instead of changing an existing one).
New Public API Additions
New Public API Additions
If you add to public APIs:Solution: This is fine if there’s a good reason. Update the ABI spec as instructed in the error message:
When ABI Checks Fail
Read the Error Message
The build output will clearly indicate what compatibility issue was detected.
Determine if the Change is Intentional
- If it’s an incompatible change: You need to find an alternative approach
- If it’s a new addition: Proceed to update the spec
Update the ABI Spec (for new additions)
Run the command provided in the error message to update the baseline.
Working with Beta APIs
When to Use @Beta
Mark APIs as@Beta when:
- The API is experimental and might change
- You’re not yet confident about the design
- You want to gather user feedback before stabilizing
- The feature is new and untested in production
Beta API Rules
This gives you flexibility to:- Change method signatures
- Rename classes
- Remove functionality
- Completely redesign the API
Graduating Beta APIs
When a@Beta API is ready to become stable:
- Remove the
@Betaannotation - Update documentation to reflect the API is now stable
- From that point forward, follow the strict compatibility rules
Once you remove
@Beta, you’re committing to maintaining backward compatibility until the next major version.Best Practices
Design for Extension
Design APIs with future extension in mind. Use interfaces, abstract classes, and builder patterns that allow adding functionality later.
Use @Beta Liberally
When in doubt, mark new APIs as
@Beta initially. You can always stabilize later, but you can’t take it back.Document Deprecations
When deprecating, clearly document what users should use instead and when the API will be removed.
Plan for Major Versions
Keep track of deprecated APIs and plan cleanup for major version releases.
Examples
Adding a New Method (Compatible)
Changing a Method (Incompatible)
Deprecating Old APIs
Next Steps
Contributing Guide
Learn about the overall contribution process
Pull Request Process
Understand how to submit and review PRs