From f995581d3499727fdb098a98584fe6f3d628aa52 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 21 Feb 2022 14:46:57 +0000 Subject: [PATCH] fix: API compatibility check fails in CI pipeline In the master build, we do a version bump which turns `1.146.0` into `1.146.0-rc.0`, which makes the API compatibility checker try to install packages with those versions. Because none of those packages exist, the list of packages ends up empty, which turns our `npm install $PACKAGES` command into `npm install`, which subsequently complains that there's no `package.json`. Strip the `-rc.0` suffix. --- scripts/check-api-compatibility.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/check-api-compatibility.sh b/scripts/check-api-compatibility.sh index 187df5ab4c785..4eee3d1fdb0d2 100755 --- a/scripts/check-api-compatibility.sh +++ b/scripts/check-api-compatibility.sh @@ -55,6 +55,10 @@ if ! ${SKIP_DOWNLOAD:-false}; then echo "Determining baseline version..." >&2 version=$(node -p 'require("./scripts/resolve-version.js").version') + + # Strip RC suffix if present + version=${version%%-rc.*} + echo " Current version is $version." >&2 echo "Using version '$version' as the baseline..." @@ -68,7 +72,8 @@ if ! ${SKIP_DOWNLOAD:-false}; then mkdir -p $tmpdir echo "Installing from NPM..." >&2 - # use npm7 to automatically install peer dependencies + # Use npm7 instead of whatever the current NPM version is to make sure we + # automatically install peer dependencies (cd $tmpdir && npx npm@^7.0.0 install --prefix $tmpdir $install_versions) fi