fix: unify release runtime coherence verification
This commit is contained in:
@@ -42,33 +42,23 @@ export function compareReleaseToRuntime(
|
||||
release: Readonly<{
|
||||
buildId: string;
|
||||
configSchemaVersion: string;
|
||||
apiContractVersion?: string;
|
||||
apiContractVersion: string;
|
||||
assetManifestHash: string;
|
||||
releaseId: string;
|
||||
}>,
|
||||
runtimeConfig: Readonly<{
|
||||
BUILD_ID: string;
|
||||
CONFIG_SCHEMA_VERSION: string;
|
||||
/**
|
||||
* §5.1. Removed from Runtime Config V2. When neither side declares it there
|
||||
* is nothing to disagree about: contract identity is verified by the
|
||||
* Release Manifest V2 `contractSet` check instead.
|
||||
*/
|
||||
API_CONTRACT_VERSION?: string;
|
||||
API_CONTRACT_VERSION: string;
|
||||
RELEASE_ID: string;
|
||||
}>,
|
||||
) {
|
||||
const declaredContractVersion =
|
||||
runtimeConfig.API_CONTRACT_VERSION ?? release.apiContractVersion ?? "0";
|
||||
return verifyCompatibilityTuple({
|
||||
frontend: {
|
||||
...release,
|
||||
apiContractVersion: release.apiContractVersion ?? declaredContractVersion,
|
||||
},
|
||||
frontend: release,
|
||||
runtime: {
|
||||
buildId: runtimeConfig.BUILD_ID,
|
||||
configSchemaVersion: runtimeConfig.CONFIG_SCHEMA_VERSION,
|
||||
apiContractVersion: declaredContractVersion,
|
||||
apiContractVersion: runtimeConfig.API_CONTRACT_VERSION,
|
||||
assetManifestHash: release.assetManifestHash,
|
||||
releaseId: runtimeConfig.RELEASE_ID,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user