mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
Merge branch 'next/minor' of github.com:Start9Labs/start-os into next/major
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { Emver } from '@start9labs/shared'
|
||||
import { Exver } from '@start9labs/shared'
|
||||
import { distinctUntilChanged, map, shareReplay } from 'rxjs/operators'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import {
|
||||
@@ -42,7 +42,7 @@ export class DepErrorService {
|
||||
)
|
||||
|
||||
constructor(
|
||||
private readonly emver: Emver,
|
||||
private readonly exver: Exver,
|
||||
private readonly patch: PatchDB<DataModel>,
|
||||
) {}
|
||||
|
||||
@@ -86,20 +86,26 @@ export class DepErrorService {
|
||||
}
|
||||
}
|
||||
|
||||
const versionSpec = pkg.currentDependencies[depId].versionSpec
|
||||
const currentDep = pkg.currentDependencies[depId]
|
||||
const depManifest = dep.stateInfo.manifest
|
||||
|
||||
// incorrect version
|
||||
if (!this.emver.satisfies(depManifest.version, versionSpec)) {
|
||||
return {
|
||||
type: 'incorrectVersion',
|
||||
expected: versionSpec,
|
||||
received: depManifest.version,
|
||||
if (!this.exver.satisfies(depManifest.version, currentDep.versionRange)) {
|
||||
if (
|
||||
depManifest.satisfies.some(
|
||||
v => !this.exver.satisfies(v, currentDep.versionRange),
|
||||
)
|
||||
) {
|
||||
return {
|
||||
type: 'incorrectVersion',
|
||||
expected: currentDep.versionRange,
|
||||
received: depManifest.version,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// invalid config
|
||||
if (Object.values(pkg.status.dependencyConfigErrors).some(err => !!err)) {
|
||||
if (!currentDep.configSatisfied) {
|
||||
return {
|
||||
type: 'configUnsatisfied',
|
||||
}
|
||||
@@ -114,8 +120,6 @@ export class DepErrorService {
|
||||
}
|
||||
}
|
||||
|
||||
const currentDep = pkg.currentDependencies[depId]
|
||||
|
||||
// health check failure
|
||||
if (depStatus === 'running' && currentDep.kind === 'running') {
|
||||
for (let id of currentDep.healthChecks) {
|
||||
|
||||
Reference in New Issue
Block a user