#!/bin/sh

# Pre-commit Git checks.
# Set up:
#  ln -s .githooks/pre-commit .git/hooks/pre-commit

# Constants.
BOLD="\e[1m"
UNSET="\e[0m"
WHITE="\e[97m"
RED="\e[91m"
BACK_MAGENTA="\e[45m"
BACK_BLUE="\e[44m"
BACK_RED="\e[41m"
BACK_GREEN="\e[42m"

# Methods.
function echo_error {
  ERR_MSG=$1
  HELP_MSG=$2
  echo -e "$BOLD $BACK_BLUE $WHITE Precommit:\t $BACK_RED Changes NOT committed. $UNSET"
  echo -e "$BOLD $BACK_BLUE $WHITE Precommit:\t $BACK_RED $WHITE $ERR_MSG $BACK_BLUE $HELP_MSG $UNSET"
}

function echo_status {
  STATUS_MSG=$1
  echo -e "$BOLD $BACK_BLUE $WHITE Precommit:\t $STATUS_MSG $UNSET"
}

function echo_success {
  echo -e "$BOLD $BACK_BLUE $WHITE Precommit:\t $BACK_GREEN $WHITE SUCCESS. $UNSET All checks passed!"
}

function header_check_preparation {
  echo_status "Setting up license check environment"
  export GOPATH=$(go env GOPATH)
  if [ $? -ne 0 ];
  then
      echo_status "Please install Go first, instructions can be found here: https://golang.org/doc/install."
  else
      export ENV_PATH=$(echo $PATH)
      if [[ $ENV_PATH != *$GOPATH* ]];
      then
        echo_status "GOPATH is not in the system path, adding it now."
        export PATH=$GOPATH/bin:$PATH
      fi
      which addlicense
      if [ $? -ne 0 ];
      then
        echo_status "addlicense tool is not yet installed, downloading it now."
        go install github.com/google/addlicense@latest
      fi
  fi
}

function buildifier_preparation {
  echo_status "Setting up tool to fix Bazel format"
  export GOPATH=$(go env GOPATH)
  if [ $? -ne 0 ];
  then
      echo_status "Please install Go first, instructions can be found here: https://golang.org/doc/install."
  else
      export ENV_PATH=$(echo $PATH)
      if [[ $ENV_PATH != *$GOPATH* ]];
      then
        echo_status "GOPATH is not in the system path, adding it now."
        export PATH=$GOPATH/bin:$PATH
      fi
      which addlicense
      if [ $? -ne 0 ];
      then
        echo_status "buildifier tool is not yet installed, downloading it now."
        go install github.com/bazelbuild/buildtools/buildifier@latest
      fi
  fi
}

# Disk cache.
BAZEL_CACHE_DIR=/tmp/bazel_cache_gapic_generator_java
if [ ! -d $BAZEL_CACHE_DIR ]
then
  mkdir $BAZEL_CACHE_DIR
fi

# Check only the staged files.
NUM_TOTAL_FILES_CHANGED=$(git diff --cached --name-only | wc -l)
NUM_JAVA_FILES_CHANGED=$(git diff --cached --name-only "*.java" | wc -l)
NUM_UNIT_GOLDEN_FILES_CHANGED=$(git diff --cached --name-only "src/test/*/*.golden" | wc -l)
NUM_INTEGRATION_GOLDEN_FILES_CHANGED=$(git diff --cached --name-only "test/integration/goldens/*/*.golden" | wc -l)
NUM_INTEGRATION_BAZEL_FILES_CHANGED=$(git diff --cached --name-only "test/integration/*/BUILD.bazel" | wc -l)
NUM_BAZEL_FILES_CHANGED=$(git diff --cached --name-only "*BUILD.bazel" | wc -l)

if [ $NUM_TOTAL_FILES_CHANGED -le 0 ]
then
  echo_error "No new files to commit." ""
  exit 1
fi


if [ -x /usr/lib/git-core/google_hook ]; then
  /usr/lib/git-core/google_hook pre-commit "$@"
fi

# Check Java format.
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ]
then
  echo_status "Running Java linter..."
  mvn fmt:check
  FORMAT_STATUS=$?
  if [ $FORMAT_STATUS != 0 ]
  then
    echo_error "Linting failed." "Please run mvn fmt:format and try again."
    exit 1
  fi
fi

# Check unit tests.
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] || [ $NUM_UNIT_GOLDEN_FILES_CHANGED -gt 0 ]
then
  echo_status "Checking unit tests..."
  mvn install --batch-mode --no-transfer-progress -Dcheckstyle.skip -Dfmt.skip
  TEST_STATUS=$?
  if [ $TEST_STATUS != 0 ]
  then
    echo_error "Tests failed." "Please fix them and try again."
    exit 1
  fi
fi

# Check integration tests.
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] \
  || [ $NUM_INTEGRATION_GOLDEN_FILES_CHANGED -gt 0 ] \
  || [ $NUM_INTEGRATION_BAZEL_FILES_CHANGED -gt 0 ]
then
  echo_status "Checking integration tests..."
  bazelisk --batch test --disk_cache="$BAZEL_CACHE_DIR" //test/integration/...
  TEST_STATUS=$?
  if [ $TEST_STATUS != 0 ]
  then
    echo_error "Tests failed." "Please fix them and try again."
    exit 1
  fi
fi

# Check and fix Bazel format.
if [ $NUM_BAZEL_FILES_CHANGED -gt 0 ]
then
  buildifier_preparation
  for FILE in $(find ./ -name BUILD.bazel)
  do
    buildifier --lint=fix $FILE
  done
fi

# Check Apache License header for source files.
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ]
then
  echo_status "Checking Apache License Header ..."
  header_check_preparation
  addlicense -c "Google LLC" -l apache -check $(find $PWD/src -type f -name '*.java' ! -iname '*PlaceholderFile.java')
  CHECK_STATUS=$?
  if [ $CHECK_STATUS != 0 ]
  then
    echo_error "License header check failed." "Please ensure that all source files have a license header."
    exit 1
  fi
fi

echo_success
