From f2b508076836839ea32193b92ad4eafd6aaadf81 Mon Sep 17 00:00:00 2001 From: Timothee Legros Date: Fri, 18 Oct 2024 11:13:46 +0300 Subject: [PATCH] added logs for visibility --- .../server/scripts/validate-external-api-versioning.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/commonwealth/server/scripts/validate-external-api-versioning.ts b/packages/commonwealth/server/scripts/validate-external-api-versioning.ts index 6b99b421691..5ab40138242 100644 --- a/packages/commonwealth/server/scripts/validate-external-api-versioning.ts +++ b/packages/commonwealth/server/scripts/validate-external-api-versioning.ts @@ -137,6 +137,10 @@ async function validateExternalApiVersioning() { ? parseSemVer(newOas.info.version) : parseSemVer(process.argv[2]); + console.log( + `Files downloaded and versions parsed. \nNew Version: ${newVersion}\nOld Version: ${oldVersion}`, + ); + if (oldVersion.major < newVersion.major) { if (newVersion.minor !== 0 || newVersion.patch !== 0) { const newMajorVersion = `${newVersion.major}.0.0`; @@ -145,6 +149,7 @@ async function validateExternalApiVersioning() { `Bumped OAS version from ${readableVersion(oldVersion)} to ${newMajorVersion}`, ); } + console.log('Major version already bumped.'); return; // Breaking change, this is valid regardless of schema changes } @@ -161,6 +166,7 @@ async function validateExternalApiVersioning() { }, }); await Promise.all([unlink(productionOasPath), unlink(localOasPath)]); + console.log('OpenAPI spec diff:', result); if (result.breakingDifferencesFound) { throw Error('External API has breaking changes, update the Major version');