From a8f415ec5ae834ff3d6437ca77398a0bc8de3a1d Mon Sep 17 00:00:00 2001 From: Phil Booth Date: Thu, 25 Apr 2019 14:32:27 +0100 Subject: [PATCH] chore(scripts): only show the private diff size warning on train builds --- release.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/release.sh b/release.sh index d9801c4a22..1910143a34 100755 --- a/release.sh +++ b/release.sh @@ -380,25 +380,25 @@ echo " https://github.com/mozilla/fxa/compare/$TRAIN_BRANCH?expand=1" echo " https://github.com/mozilla/fxa-private/compare/$PRIVATE_BRANCH?expand=1" echo -PRIVATE_DIFF_SIZE=`git diff "$PRIVATE_BRANCH..$PRIVATE_DIFF_FROM" | wc -l | awk '{$1=$1};1'` -IS_BIG_RELEASE=`expr "$PRIVATE_DIFF_SIZE" \> 300` -if [ "$IS_BIG_RELEASE" = "1" ]; then - echo "The diff for the private release is pretty big. You may want to add the following comment to that PR:" - echo - echo "> There's no need to review every line of this diff, since it includes every commit from the release. Instead you can do the following:" - echo ">" - echo '> ```' - echo "> git fetch origin $TRAIN_BRANCH" - echo "> git fetch $PRIVATE_REMOTE $PRIVATE_BRANCH" - echo "> git checkout -b $PRIVATE_BRANCH $PRIVATE_REMOTE/$PRIVATE_BRANCH" - echo "> git diff origin/$TRAIN_BRANCH" - echo '> ```' - echo ">" - echo "> That diff should show only the changes from the private repo, proving that the $TRAIN_BRANCH branches are equal in other respects." - echo -fi - if [ "$BUILD_TYPE" = "Train" ]; then + PRIVATE_DIFF_SIZE=`git diff "$PRIVATE_BRANCH..$PRIVATE_DIFF_FROM" | wc -l | awk '{$1=$1};1'` + IS_BIG_RELEASE=`expr "$PRIVATE_DIFF_SIZE" \> 400` + if [ "$IS_BIG_RELEASE" = "1" ]; then + echo "The diff for the private release is pretty big. You may want to add the following comment to that PR:" + echo + echo "> There's no need to review every line of this diff, since it includes every commit from the release. Instead you can do the following:" + echo ">" + echo '> ```' + echo "> git fetch origin $TRAIN_BRANCH" + echo "> git fetch $PRIVATE_REMOTE $PRIVATE_BRANCH" + echo "> git checkout -b $PRIVATE_BRANCH $PRIVATE_REMOTE/$PRIVATE_BRANCH" + echo "> git diff origin/$TRAIN_BRANCH" + echo '> ```' + echo ">" + echo "> That diff should show only the changes from the private repo, proving that the $TRAIN_BRANCH branches are equal in other respects." + echo + fi + echo "If there's no deploy bug for $TRAIN_BRANCH yet, you should create one using this URL:" echo echo " $DEPLOY_BUG_URL"