#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PROJECT_ROOT=$(cd "${SCRIPT_DIR}/../.." && pwd)

SYNC_ROOT=${SYNC_ROOT:-/data1/dongying/Mono3d/G1Q3/feishu_project}
INPUT_JSON=${INPUT_JSON:-"${SYNC_ROOT}/exports/dongying_g1q3_issue_list.json"}
OUTPUT_DIR=${OUTPUT_DIR:-"${SYNC_ROOT}/reports/issue_tag_profile"}
REPORT_NAME=${REPORT_NAME:-dongying_g1q3_issue_tag_profile}
PYTHON_BIN=${PYTHON_BIN:-/deeplearning_team/ydong/dongying/miniconda/envs/dev/bin/python}
TOP_LIMIT=${TOP_LIMIT:-15}

CMD=(
  "${PYTHON_BIN}" "${PROJECT_ROOT}/tools/feishu_project/analyze_issue_tag_profile.py"
  --input-json "${INPUT_JSON}"
  --output-dir "${OUTPUT_DIR}"
  --report-name "${REPORT_NAME}"
  --top-limit "${TOP_LIMIT}"
)

CMD+=("$@")
"${CMD[@]}"
