mirror of
https://github.com/enso-org/enso.git
synced 2024-11-23 08:08:34 +03:00
update: dev version check
This commit is contained in:
parent
2385f5b357
commit
c121d57215
@ -261,11 +261,13 @@ object ProjectManagementApi {
|
||||
|
||||
case class BrokenComponentError(msg: String) extends Error(4021, msg)
|
||||
|
||||
case class ProjectManagerUpgradeRequired(minimumRequiredVersion: SemVer)
|
||||
extends Error(
|
||||
case class ProjectManagerUpgradeRequired(
|
||||
currentVersion: SemVer,
|
||||
minimumRequiredVersion: SemVer
|
||||
) extends Error(
|
||||
4022,
|
||||
s"Project manager $minimumRequiredVersion is required to install the " +
|
||||
s"requested engine. Please upgrade."
|
||||
s"requested engine. Current version is $currentVersion. Please upgrade."
|
||||
) {
|
||||
|
||||
/** Additional payload that can be used to get the version string of the
|
||||
|
@ -27,8 +27,8 @@ object ProjectServiceFailureMapper {
|
||||
case CannotRemoveOpenProject => CannotRemoveOpenProjectError
|
||||
case ProjectOperationTimeout => ServiceError
|
||||
case LanguageServerFailure(msg) => LanguageServerError(msg)
|
||||
case ProjectManagerUpgradeRequiredFailure(version) =>
|
||||
ProjectManagerUpgradeRequired(version)
|
||||
case ProjectManagerUpgradeRequiredFailure(current, required) =>
|
||||
ProjectManagerUpgradeRequired(current, required)
|
||||
case MissingComponentFailure(msg) => MissingComponentError(msg)
|
||||
case BrokenComponentFailure(msg) => BrokenComponentError(msg)
|
||||
case ComponentInstallationFailure(msg) => ComponentInstallationError(msg)
|
||||
|
@ -84,6 +84,7 @@ object ProjectServiceFailure {
|
||||
* than what is currently running.
|
||||
*/
|
||||
case class ProjectManagerUpgradeRequiredFailure(
|
||||
currentVersion: SemVer,
|
||||
minimumRequiredVersion: SemVer
|
||||
) extends ProjectServiceFailure
|
||||
|
||||
|
@ -29,6 +29,7 @@ object RuntimeVersionManagerErrorRecoverySyntax {
|
||||
MissingComponentFailure(message)
|
||||
case upgradeRequired: UpgradeRequiredError =>
|
||||
ProjectManagerUpgradeRequiredFailure(
|
||||
upgradeRequired.currentVersion,
|
||||
upgradeRequired.expectedVersion
|
||||
)
|
||||
case UninstallationError(message) =>
|
||||
|
@ -25,7 +25,7 @@ object CurrentVersion {
|
||||
|
||||
/** Check if the current version is the development one. */
|
||||
def isDevVersion: Boolean =
|
||||
currentVersion == defaultDevEnsoVersion
|
||||
currentVersion.preRelease == defaultDevEnsoVersion.preRelease
|
||||
|
||||
/** Override launcher version with the provided one.
|
||||
*
|
||||
|
@ -59,13 +59,15 @@ case class ComponentMissingError(message: String, cause: Throwable = null)
|
||||
/** Indicates that a requested engine version requires a newer launcher/project
|
||||
* manager version.
|
||||
*
|
||||
* @param currentVersion the current engine version
|
||||
* @param expectedVersion the minimum version that is required to run the engine
|
||||
*/
|
||||
case class UpgradeRequiredError(
|
||||
currentVersion: SemVer,
|
||||
expectedVersion: SemVer
|
||||
) extends ComponentsException(
|
||||
s"Minimum version required to use this engine is " +
|
||||
s"$expectedVersion."
|
||||
s"$expectedVersion. Current version is $currentVersion."
|
||||
)
|
||||
|
||||
/** Indicates uninstallation failure. */
|
||||
|
@ -464,7 +464,10 @@ class RuntimeVersionManager(
|
||||
engineRelease.manifest
|
||||
)
|
||||
if (!isCompatible) {
|
||||
throw UpgradeRequiredError(engineRelease.manifest.minimumRequiredVersion)
|
||||
throw UpgradeRequiredError(
|
||||
CurrentVersion.version,
|
||||
engineRelease.manifest.minimumRequiredVersion
|
||||
)
|
||||
}
|
||||
if (engineRelease.isBroken) {
|
||||
val continue = userInterface.shouldInstallBrokenEngine(version)
|
||||
@ -726,7 +729,12 @@ class RuntimeVersionManager(
|
||||
): Try[Manifest] = {
|
||||
Manifest.load(path / Manifest.DEFAULT_MANIFEST_NAME).flatMap { manifest =>
|
||||
if (!isEngineVersionCompatibleWithThisInstaller(manifest)) {
|
||||
Failure(UpgradeRequiredError(manifest.minimumRequiredVersion))
|
||||
Failure(
|
||||
UpgradeRequiredError(
|
||||
CurrentVersion.version,
|
||||
manifest.minimumRequiredVersion
|
||||
)
|
||||
)
|
||||
} else Success(manifest)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user