From 2a9f60a321f7b79c3ee7e07cd384ce5a02e66f55 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 6 Dec 2021 17:22:18 -0500 Subject: [PATCH] tools: Fix changelogger-release.sh logic (#22015) When changelogger-release.sh calls check-intra-monorepo-deps.sh to update projects individually, we need to not have check-intra-monorepo-deps.sh try to update pnpm-lock.yaml because the dependencies may not be in a consistent state until it has finished updating all projects. So when check-intra-monorepo-deps.sh is called with a list of projects to update, rely on the caller (changelogger-release.sh) to do the pnpm lock file update. --- tools/changelogger-release.sh | 3 +++ tools/check-intra-monorepo-deps.sh | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/changelogger-release.sh b/tools/changelogger-release.sh index bd6aa2b0cc0de..5ed73adaeee61 100755 --- a/tools/changelogger-release.sh +++ b/tools/changelogger-release.sh @@ -174,6 +174,9 @@ for SLUG in "${SLUGS[@]}"; do fi done +debug " Updating pnpm.lock..." +pnpm install --silent + cat <<-EOM You can examine the changelogs with diff --git a/tools/check-intra-monorepo-deps.sh b/tools/check-intra-monorepo-deps.sh index 4c70e3c6cbe6d..654f859a46747 100755 --- a/tools/check-intra-monorepo-deps.sh +++ b/tools/check-intra-monorepo-deps.sh @@ -89,6 +89,7 @@ function get_packages { get_packages +DO_PNPM_LOCK=true SLUGS=() if [[ $# -le 0 ]]; then # Use a temp variable so pipefail works @@ -99,6 +100,7 @@ if [[ $# -le 0 ]]; then mapfile -t -O ${#SLUGS[@]} SLUGS <<<"$TMP" else SLUGS=( "$@" ) + DO_PNPM_LOCK=false fi if $UPDATE; then @@ -244,12 +246,16 @@ for SLUG in "${SLUGS[@]}"; do done if $ANYJS; then - spin - debug "Updating pnpm-lock.yaml" - if [[ -n "$CI" ]]; then - pnpm install --no-frozen-lockfile + if $DO_PNPM_LOCK; then + spin + debug "Updating pnpm-lock.yaml" + if [[ -n "$CI" ]]; then + pnpm install --no-frozen-lockfile + else + pnpm install --silent + fi else - pnpm install --silent + debug "Skipping pnpm-lock.yaml update because we were passed a list of packages" fi fi