chore(scripts): only show the private diff size warning on train builds

This commit is contained in:
Phil Booth 2019-04-25 14:32:27 +01:00
Родитель fdc61382af
Коммит a8f415ec5a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 36FBB106F9C32516
1 изменённых файлов: 18 добавлений и 18 удалений

Просмотреть файл

@ -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"