Skip to content

Commit

Permalink
tools: Fix changelogger-release.sh logic (#22015)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anomiex committed Dec 6, 2021
1 parent 249bf4a commit 2a9f60a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions tools/changelogger-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions tools/check-intra-monorepo-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -99,6 +100,7 @@ if [[ $# -le 0 ]]; then
mapfile -t -O ${#SLUGS[@]} SLUGS <<<"$TMP"
else
SLUGS=( "$@" )
DO_PNPM_LOCK=false
fi

if $UPDATE; then
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 2a9f60a

Please sign in to comment.