Skip to content

[Feat]: Enhance builder version check to support migration mode #635

@viacheslav-lunev

Description

@viacheslav-lunev

Is your feature request related to a problem? Please describe

Current builder version check blocks publication process until migration is not completed.
It directly impacts Apihub operations and not acceptable.

Describe the solution you'd like

Need to modify existing builder version check. New version should consider migration running.

If migration is in progress, then publication should be allowed even if previous version is built with old builder (not migrated yet). If the This case need to add a special version metadata field called previousBuilderVersion.
But this rule is applicable only in case of minor or patch builder version change.
Examples:

  • 1.0.0 -> 1.0.1 - continue build
  • 1.0.0 -> 1.1.0 - continue build
  • 1.0.0 -> 2.0.0 - fail build

Migration status should be retrieved from /api/v1/system/info, property migrationInProgress.

Scope/design

api-processor scope

Definitions: current api-processor version === version of the api-processor currently building the changelog

Add apiProcessorVersionValidationLevel (optional) to BuilderRunOptions, possible values are:

  • major
  • strict (default)

Note: this should be added to BuilderRunOptions, not to BuildConfig, since it is a so it is a transient option for the current build try, not something we want persisted in the BuildConfig.

Modify the validateApiProcessorVersion so that

  • if apiProcessorVersionValidationLevel is major, validation fails only if major part of the builderVersion for previous or current package version differs from the major part of current api-processor version
    • if any of versions are not parseable as SemVer, validation should not fail
  • if apiProcessorVersionValidationLevel is strict, validation fails if builderVersion for previous or current package version differs from current api-processor version (current behaviour)

Store build version for package versions participating in the comparison if they differ from the current api-processor version

  • if builderVersion for the previous package version differs from the current api-processor version, store builderVersion for the previous package version to the previousVersionBuilderVersion in the info.json of the changelog build result. Do not add previousVersionBuilderVersion if it the same as current api-processor version.
    -if builderVersion for the current package version differs from the current api-processor version, store builderVersion for the current package version to the currentVersionBuilderVersion in the info.json of the changelog build result. Do not add currentVersionBuilderVersion if it the same as current api-processor version.

So, overall info.json:

  • will have builderVersion holding current api-processor version
  • may have previousVersionBuilderVersion
  • may have currentVersionBuilderVersion

Document new properties in the API specification

UI scope

If migration is in progress (as reported by /api/v1/system/info, property migrationInProgress), start changelog builds with apiProcessorVersionValidationLevel set to major

Build task consumer

Same as UI

Metadata

Metadata

No fields configured for Feature.

Projects

Status

In Test

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions