跳轉到

Git 協作與 AI 審查規範

本規範定義 Teqais 專案([email protected]:teqais/teqais.git)的分支管理、多遠端推送、AI 輔助 Code Review 與自動化 MkDocs 發布流程。


📌 核心基礎設施位址

服務項目 位址 / 端口 說明
GitHub 源碼庫 [email protected]:teqais/teqais.git 主代碼託管源
內部 Gitea http://34.28.104.222:3000/ 內部協作、PR 審查與 Webhook 觸發中心
Teqais Docs (MkDocs) http://34.28.104.222:8080/ Teqais 最新技術與 API 文檔站
Teqour Team Docs http://34.28.104.222/ 團隊主知識庫入口

🛠️ 本地環境與雙遠端設定 (Dual Remotes)

為了同時保持 GitHub 公共同步,並享受內部 Gitea 的自動化 AI Code Review 與 MkDocs 部署,請配置多重 Push 目標:

cd teqais

# 1. 設置 origin 同時推送到 GitHub 與內部 Gitea
git remote set-url --add --push origin [email protected]:teqais/teqais.git
git remote set-url --add --push origin http://34.28.104.222:3000/teqais/teqais.git

# 2. 驗證遠端設定
git remote -v

設定完成後:每次執行 git push origin <branch>,Git 會自動並行推送到 GitHub 與內部 Gitea。


🌿 分支與 Commit 規範

分支命名

  • main:受保護主分支,禁止直接 Push,必須透過 Pull Request 合併。
  • feat/<issue-id>-<desc>:新功能開發分支。
  • fix/<issue-id>-<desc>:問題修復分支。
  • docs/<issue-id>-<desc>:文件更新分支。

Commit 規範

遵循 Conventional Commits 格式: - feat: 新增功能 - fix: 修復問題 - docs: 文檔變更 - refactor: 代碼重構 - chore: 構建或工具配置變更


🔄 開發與 Code Review 標準工作流

[1. 開新分支] ➔ [2. 本地 Commit] ➔ [3. Push 並在 Gitea 開 PR]
                                            │
                                            ▼
                               [4. Teqais AI 機器人自動審查]
                               - 靜態語法檢核 (MkDocs strict)
                               - LLM 架構、邊界條件與建議分析
                                            │
                                            ▼
                               [5. Review 通過後點擊 Merge]
                                            │
                                            ▼
                           [6. 自動部署至 http://34.28.104.222:8080/]

操作步驟:

  1. 切換功能分支:
    git checkout -b docs/update-onboarding
    
  2. 提交改動並推送:
    git add .
    git commit -m "docs: 更新新人引導與 Git 審查手冊"
    git push origin docs/update-onboarding
    
  3. 在 Gitea 開啟 Pull Request (PR):
  4. 前往 http://34.28.104.222:3000/teqais/teqais/pulls。
  5. 建立由您的分支指向 main 的 PR。
  6. 檢閱 AI Code Review 意見:
  7. 系統約在數秒內由 Teqais Reviewer 自動在 PR 留言。
  8. 包含:文檔構建狀態檢核 與 代碼/架構優化建議。
  9. 若有改善點可繼續 push commit,機器人會自動更新檢視。
  10. 合併 (Merge) 與發布:
  11. 本機制採「建議輔助模式」,確認無重大問題即可點擊 Merge Pull Request。
  12. 伺服器會在 5 秒內自動觸發部署,刷新 http://34.28.104.222:8080/ 即可見到最新發布內容。