chore(observability): wire UI guard into quick review
Some checks failed
CD Pipeline / deploy (push) Failing after 1m57s

This commit is contained in:
OoO
2026-05-05 15:31:04 +08:00
parent 07c9e200d0
commit 62276f8b0c
2 changed files with 36 additions and 12 deletions

View File

@@ -44,6 +44,12 @@ AI 觀測台是「AI 中樞控制室」,不是 Bootstrap 報表頁。任何新
python3 scripts/check_observability_ui.py
```
或透過既有 quick review 選單執行第 6 項:
```bash
./scripts/quick_review.sh
```
Guard 會檢查:
- Times / Georgia 等非規範標題字型。

View File

@@ -15,6 +15,7 @@ NC='\033[0m' # No Color
# 獲取專案根目錄
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CODE_REVIEW_SCRIPT="$PROJECT_ROOT/scripts/code_review.py"
OBSERVABILITY_UI_GUARD="$PROJECT_ROOT/scripts/check_observability_ui.py"
# 顯示標題
echo -e "${BLUE}========================================${NC}"
@@ -33,11 +34,24 @@ if ! command -v python3 &> /dev/null; then
exit 1
fi
# 檢查Aider
if ! command -v aider &> /dev/null; then
echo -e "${RED}❌ Aider未安裝或不在PATH中${NC}"
exit 1
fi
run_code_review() {
if ! command -v aider &> /dev/null; then
echo -e "${RED}❌ Aider未安裝或不在PATH中${NC}"
exit 1
fi
python3 "$CODE_REVIEW_SCRIPT" "$@"
}
run_observability_ui_guard() {
if [ ! -f "$OBSERVABILITY_UI_GUARD" ]; then
echo -e "${RED}❌ AI觀測台 UI guard 不存在: $OBSERVABILITY_UI_GUARD${NC}"
exit 1
fi
echo -e "${GREEN}🎛️ 開始 AI觀測台 UI/UX 防回歸檢查...${NC}"
python3 "$OBSERVABILITY_UI_GUARD"
}
# 顯示選單
if [ $# -eq 0 ]; then
@@ -47,24 +61,25 @@ if [ $# -eq 0 ]; then
echo "3) 指定檔案Review"
echo "4) 安全檢查 (Security Review)"
echo "5) 效能檢查 (Performance Review)"
echo "6) AI觀測台 UI/UX 防回歸檢查"
echo ""
read -p "請輸入選項 (1-5): " choice
read -p "請輸入選項 (1-6): " choice
case $choice in
1)
echo -e "${GREEN}🚀 開始自動Review暫存檔案...${NC}"
python3 "$CODE_REVIEW_SCRIPT" --auto --type basic
run_code_review --auto --type basic
;;
2)
echo -e "${GREEN}🚀 開始Review所有變更檔案...${NC}"
python3 "$CODE_REVIEW_SCRIPT" --type basic
run_code_review --type basic
;;
3)
echo -e "${YELLOW}請輸入要Review的檔案路徑 (用空格分隔)${NC}"
read -r files_input
if [ -n "$files_input" ]; then
echo -e "${GREEN}🚀 開始Review指定檔案...${NC}"
python3 "$CODE_REVIEW_SCRIPT" --files $files_input --type basic
run_code_review --files $files_input --type basic
else
echo -e "${RED}❌ 未指定檔案${NC}"
exit 1
@@ -72,11 +87,14 @@ if [ $# -eq 0 ]; then
;;
4)
echo -e "${GREEN}🛡️ 開始安全檢查...${NC}"
python3 "$CODE_REVIEW_SCRIPT" --auto --type security
run_code_review --auto --type security
;;
5)
echo -e "${GREEN}⚡ 開始效能檢查...${NC}"
python3 "$CODE_REVIEW_SCRIPT" --auto --type performance
run_code_review --auto --type performance
;;
6)
run_observability_ui_guard
;;
*)
echo -e "${RED}❌ 無效選項${NC}"
@@ -87,7 +105,7 @@ else
# 有指定檔案直接Review
echo -e "${GREEN}🚀 開始Review指定檔案...${NC}"
echo -e "${BLUE}檔案:$@${NC}"
python3 "$CODE_REVIEW_SCRIPT" --files "$@" --type basic
run_code_review --files "$@" --type basic
fi
# 檢查執行結果