MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Component Versioning

Component Versioning

The ComponentVersioningService manages the full lifecycle of platform component versions. It provides semantic version parsing, version registration, status transitions, deprecation workflows, compatibility checking, and version comparison. All version data is cached and evicted automatically when changes occur.


Register a Version

Endpoint: POST /api/v1/registry/components/:componentId/versions

curl -X POST http://localhost:8084/api/v1/registry/components/550e8400-e29b-41d4-a716-446655440000/versions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${TOKEN}" \
  -d '{
    "version": "3.2.0",
    "description": "New query optimization engine",
    "releaseNotes": "Added cost-based optimizer for complex joins",
    "status": "STABLE",
    "releaseDate": "2026-02-01",
    "dockerImage": "matih/trino:3.2.0",
    "helmChartVersion": "0.15.0",
    "minPlatformVersion": "2.0.0",
    "maxPlatformVersion": "3.0.0",
    "lts": false,
    "recommended": true
  }'

When a version is registered, the service parses the version string using the semver4j library to populate the semanticVersion field. If the version is marked as recommended, all other versions for the same component have their recommended flag cleared.


ComponentVersion Structure

FieldTypeDescription
idUUIDVersion identifier
versionStringVersion string (e.g., 3.2.0)
semanticVersionStringParsed semantic version
descriptionStringHuman-readable description
releaseNotesStringDetailed release notes
statusVersionStatusCurrent lifecycle status
releaseDateLocalDateOfficial release date
endOfLifeDateLocalDateDate version reaches end of life
endOfSupportDateLocalDateDate support ends
dockerImageStringDocker image reference
helmChartVersionStringCorresponding Helm chart version
minPlatformVersionStringMinimum compatible platform version
maxPlatformVersionStringMaximum compatible platform version
ltsbooleanWhether this is a long-term support version
recommendedbooleanWhether this is the recommended version
breakingChangesJSONList of breaking changes from prior version
knownIssuesJSONKnown issues in this version
configSchemaJSONConfiguration schema for this version
dependenciesListVersion dependency relationships

Version Status Lifecycle

StatusDescriptionTransitions To
ALPHAEarly development, not production-readyBETA, DEPRECATED
BETAFeature-complete, undergoing testingRC, DEPRECATED
RCRelease candidate, final testing phaseSTABLE, DEPRECATED
STABLEProduction-ready, fully supportedDEPRECATED
DEPRECATEDSupported but scheduled for removalEND_OF_LIFE
END_OF_LIFENo longer supported or maintainedTerminal state

Endpoint: PUT /api/v1/registry/versions/:versionId/status?status=DEPRECATED

When a version is transitioned to END_OF_LIFE and no endOfLifeDate is set, the current date is automatically assigned.


Deprecation

Endpoint: POST /api/v1/registry/versions/:versionId/deprecate?endOfSupportDate=2026-12-31

When a version is deprecated:

  1. The status is set to DEPRECATED
  2. The endOfSupportDate is recorded
  3. If the deprecated version was the recommended version, the recommended flag is cleared and the latest stable version is automatically promoted to recommended
  4. A VERSION_DEPRECATED event is published to Kafka

Set Recommended Version

Endpoint: POST /api/v1/registry/components/:componentId/versions/:versionId/set-recommended

Only one version per component can be recommended at a time. Setting a new recommended version automatically clears the flag on the previous recommended version.


Version Comparison

Endpoint: GET /api/v1/registry/versions/:versionId1/compare/:versionId2

Compares two versions of the same component using semantic versioning rules.

VersionComparison Structure

FieldTypeDescription
version1ComponentVersionFirst version
version2ComponentVersionSecond version
comparisonint-1 (older), 0 (same), 1 (newer)
isUpgradebooleanWhether version2 is newer than version1
upgradeTypeStringmajor, minor, or patch
hasBreakingChangesbooleanWhether version2 has breaking changes

Compatibility Check

Endpoint: POST /api/v1/registry/versions/:versionId/check-compatibility

Validates whether a version is compatible with the currently installed component versions.

curl -X POST http://localhost:8084/api/v1/registry/versions/550e8400/check-compatibility \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${TOKEN}" \
  -d '{
    "trino": "3.1.0",
    "kafka": "3.6.0",
    "postgresql": "16.1"
  }'

CompatibilityResult Structure

FieldTypeDescription
compatiblebooleanWhether all required dependencies are satisfied
errorsListBlocking compatibility issues
warningsListNon-blocking recommendations
recommendationsMapSuggested version upgrades for dependencies

The check evaluates each VersionDependency against the installed versions, comparing minimum and maximum version constraints using semantic versioning.


Version Dependencies

Each version can declare dependencies on other platform components through the VersionDependency entity.

FieldTypeDescription
dependsOnComponentIdUUIDTarget component identifier
dependsOnComponentNameStringTarget component name
minVersionStringMinimum required version
maxVersionStringMaximum supported version
recommendedVersionStringRecommended version of the dependency
versionConstraintStringVersion constraint expression
typeDependencyTypeDependency classification

Dependency Types

TypeDescription
REQUIREDMust be present and within version bounds
OPTIONALEnhanced functionality when present
RECOMMENDEDStrongly suggested for optimal performance
INCOMPATIBLEConflict marker -- cannot coexist

Automated Lifecycle Processing

A scheduled task runs daily at 6:00 AM to process version lifecycle transitions:

  1. Versions that have reached their endOfLifeDate are automatically transitioned to END_OF_LIFE status
  2. Versions reaching their endOfSupportDate trigger VERSION_END_OF_SUPPORT events for downstream notification