ISEP#47:側門閘測試的網路案例改看「token 解不解得出」,不再看 remote 有沒有 @

remote URL 清乾淨之後,舊判準會讓 Arcrun#100 重演那條在每台機器上永遠 SKIP,
等於沒有這條測試。改用 scripts/lib/gitea-token.sh 的 gitea_token()。

實跑:有 token → 這條真的跑(目前 23/24,失敗那條在 main 上同樣失敗,
是既有的排序問題,與本分支無關,已記在票上);沒 token → SKIP、23/23。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
isep-hand
2026-09-19 11:36:18 +08:00
parent daa84b583f
commit ad10159dfe
+5 -2
View File
@@ -68,7 +68,10 @@ echo " 裸引號的 python dict 寫法,跟 2026-08-27 那 13 張票實際的
echo " curl -d 那種「JSON 被跳脫成字串塞進另一層引號」的寫法,本閘的猜題功能"
echo " 刻意不支援,見 hook 檔頭「只認雙引號」那段註解,訊息裡不會列候選舊票,"
echo " 但擋下來這件事不受影響,另有獨立案例覆蓋。)"
if git remote -v 2>/dev/null | grep 'git\.uncle6\.me' | grep -q '@'; then
# 能不能打網路:看 token 解不解得出來(inkstone/ISEP#47 之後 remote URL 乾淨、不再帶憑證,
# 舊判準「remote 有沒有 @」會讓這條在每台機器上永遠 SKIP ⇒ 等於沒有這條測試)
_GT_TOK=""; . "$(dirname "$0")/lib/gitea-token.sh" 2>/dev/null && _GT_TOK=$(gitea_token 2>/dev/null || true)
if [ -n "$_GT_TOK" ]; then
OUT=$(printf '%s' "{\"tool_name\":\"Bash\",\"tool_input\":{\"command\":$(python3 -c 'import json,sys;print(json.dumps(sys.argv[1]))' 'req("POST", f"{API}/repos/{REPO}/issues", {"title":"總圖說我一條關聯都沒有,三元組 graph 全部消失"})')}}" \
| bash "$H" 2>&1 >/dev/null)
RC=$?
@@ -79,7 +82,7 @@ if git remote -v 2>/dev/null | grep 'git\.uncle6\.me' | grep -q '@'; then
printf '%s\n' "$OUT"
fi
else
echo " ⏭️ SKIP這台機器的 git remote 沒帶 git.uncle6.me 的憑證,連不上就不算數)"
echo " ⏭️ SKIP解不出 Gitea token:沒有 \$GITEA_TOKEN_CLAUDE_CODE、\$CLAUDE_PROJECT_DIR/.env 也沒有,連不上就不算數)"
fi
[ -n "$SAVED" ] && printf '%s' "$SAVED" > /tmp/.ticket-where-ok