Add pr-reviewer module: Gitea webhooks, Spring AI structured output, quote-checked inline comments, de-duplication across pushes and live tests against Gitea 1.27.3 on Spring AI 2.1.0
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4HkWoC7hLzk61vZa8
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# Starts a throwaway Gitea 1.27.3 for the live tests and writes scripts/.gitea.env. Never point the tests at a real server.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
IMAGE=${GITEA_IMAGE:-gitea/gitea:1.27.3}
|
||||
docker rm -f pr-reviewer-gitea >/dev/null 2>&1 || true
|
||||
docker run -d --name pr-reviewer-gitea -p 127.0.0.1:3118:3000 \
|
||||
-e GITEA__security__INSTALL_LOCK=true \
|
||||
-e GITEA__security__ALLOWED_HOST_LIST=private \
|
||||
-e GITEA__database__DB_TYPE=sqlite3 \
|
||||
-e GITEA__server__ROOT_URL=http://localhost:3118/ "$IMAGE" >/dev/null
|
||||
until curl -sf --noproxy '*' http://127.0.0.1:3118/api/v1/version >/dev/null; do sleep 2; done
|
||||
PASS="Local-$(head -c 12 /dev/urandom | od -An -tx1 | tr -d ' \n')"
|
||||
for user in dev reviewbot; do
|
||||
extra=""; [ "$user" = dev ] && extra="--admin"
|
||||
docker exec -u git pr-reviewer-gitea gitea admin user create --username "$user" --password "$PASS" \
|
||||
--email "$user@example.com" --must-change-password=false $extra >/dev/null
|
||||
done
|
||||
token() { docker exec -u git pr-reviewer-gitea gitea admin user generate-access-token --username "$1" --scopes all --token-name t --raw; }
|
||||
{
|
||||
echo "GITEA_DEV_TOKEN=$(token dev)"
|
||||
echo "GITEA_BOT_TOKEN=$(token reviewbot)"
|
||||
# the address under which the container reaches the machine running the tests
|
||||
echo "WEBHOOK_HOST=$(docker network inspect bridge -f '{{(index .IPAM.Config 0).Gateway}}')"
|
||||
} > .gitea.env
|
||||
echo "Gitea is up on http://127.0.0.1:3118"
|
||||
Reference in New Issue
Block a user