AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
dx(skills): stop publishing dev test creds in /pr-test SKILL.md (#13201)
Zamil Majdy37554accf762
diff --git a/.claude/skills/pr-test/SKILL.md b/.claude/skills/pr-test/SKILL.mdindex 0bea79ee03..66bcc7bc7e 100644--- a/.claude/skills/pr-test/SKILL.md+++ b/.claude/skills/pr-test/SKILL.md@@ -58,9 +58,9 @@ When testing features that depend on specific states (rate limits, credits, quot# Set a key with expirydocker exec $REDIS_CONTAINER redis-cli SET key value EX ttl# Example: Set rate limit counter to near-limit- docker exec $REDIS_CONTAINER redis-cli SET "rate_limit:user:[email protected]" 99 EX 3600+ docker exec $REDIS_CONTAINER redis-cli SET "rate_limit:user:$PR_TEST_USER_EMAIL" 99 EX 3600# Example: Check current value- docker exec $REDIS_CONTAINER redis-cli GET "rate_limit:user:[email protected]"+ docker exec $REDIS_CONTAINER redis-cli GET "rate_limit:user:$PR_TEST_USER_EMAIL"```2. **Use API calls to check before/after state:**@@ -126,9 +126,39 @@ RESULTS_DIR="$REPO_ROOT/test-results/PR-${PR_NUMBER}-${PR_TITLE}"mkdir -p $RESULTS_DIR```-**Test user credentials** (for logging into the UI or verifying results manually):-- Email: `[email protected]`-- Password: `testtest123`+**Test user credentials** — required to log into the UI or call authenticated APIs.++NEVER hardcode these in this SKILL, a PR comment, a screenshot, or any committed file. Sources, in priority order:++1. **Env vars** (CI / preconfigured local shell): `$PR_TEST_USER_EMAIL` + `$PR_TEST_USER_PASSWORD`. If both are set, use them.+2. **Interactive prompt** (everything else, including dev-preview runs): if the env vars are not set, ASK the user at the start of the run — e.g. "I need test-user credentials for this run; paste the email and password." Hold them in shell vars only for the duration of the run. Do not echo, log, or write them to disk.++Acquire the variables — env first, prompt if missing — and only then lock them in:++```bash+# 1. Prefer env vars (CI / preconfigured shell). Prompt only for the+# specific var that is unset so an already-exported credential is+# not overwritten by the prompt when only the other one is missing.+if [ -z "${PR_TEST_USER_EMAIL:-}" ] || [ -z "${PR_TEST_USER_PASSWORD:-}" ]; then+ echo "Test user credentials required for this run."+ if [ -z "${PR_TEST_USER_EMAIL:-}" ]; then+ read -r -p "Email: " PR_TEST_USER_EMAIL+ fi+ if [ -z "${PR_TEST_USER_PASSWORD:-}" ]; then+ read -r -s -p "Password: " PR_TEST_USER_PASSWORD+ echo+ fi+ export PR_TEST_USER_EMAIL PR_TEST_USER_PASSWORD+fi++# 2. Lock them in — fail loudly if either is STILL unset (e.g. the user+# pressed Enter on an empty prompt). The error message names the var so+# the agent / operator knows what to fix.+: "${PR_TEST_USER_EMAIL:?PR_TEST_USER_EMAIL is empty after env+prompt — supply a value before re-running}"+: "${PR_TEST_USER_PASSWORD:?PR_TEST_USER_PASSWORD is empty after env+prompt — supply a value before re-running}"+```++For **local docker-compose** runs, a fresh dev user is created on first call to the signup snippet below. For **dev-preview** runs, the test user lives in the project's Supabase — ask the user for the current valid credentials each session (the previously-shared `[email protected]` test account was disabled on 2026-05-23 after its credentials leaked into this very SKILL — do NOT re-introduce a default).## Step 1: Understand the PR@@ -478,25 +508,28 @@ doneANON_KEY=$(grep "NEXT_PUBLIC_SUPABASE_ANON_KEY=" $FRONTEND_DIR/.env | sed 's/.*NEXT_PUBLIC_SUPABASE_ANON_KEY=//' | tr -d '[:space:]')# Signup (idempotent — returns "User already registered" if exists)+SIGNUP_PAYLOAD=$(jq -nc --arg e "$PR_TEST_USER_EMAIL" --arg p "$PR_TEST_USER_PASSWORD" '{email:$e,password:$p}')RESULT=$(curl -s -X POST 'http://localhost:8000/auth/v1/signup' \-H "apikey: $ANON_KEY" \-H 'Content-Type: application/json' \- -d '{"email":"[email protected]","password":"testtest123"}')+ -d "$SIGNUP_PAYLOAD")-# If "Database error finding user", restart supabase-auth and retry+# If "Database error finding user", restart supabase-auth and retry —+# capture the retry result back into $RESULT so the token step below+# reads the post-retry state, not the original failure.if echo "$RESULT" | grep -q "Database error"; thendocker restart supabase-auth && sleep 5- curl -s -X POST 'http://localhost:8000/auth/v1/signup' \+ RESULT=$(curl -s -X POST 'http://localhost:8000/auth/v1/signup' \-H "apikey: $ANON_KEY" \-H 'Content-Type: application/json' \- -d '{"email":"[email protected]","password":"testtest123"}'+ -d "$SIGNUP_PAYLOAD")fi# Get auth tokenTOKEN=$(curl -s -X POST 'http://localhost:8000/auth/v1/token?grant_type=password' \-H "apikey: $ANON_KEY" \-H 'Content-Type: application/json' \- -d '{"email":"[email protected]","password":"testtest123"}' | jq -r '.access_token // ""')+ -d "$SIGNUP_PAYLOAD" | jq -r '.access_token // ""')```**Use this token for ALL API calls:**@@ -601,9 +634,9 @@ agent-browser --session-name pr-test open 'http://localhost:3000/login' --timeou# Get interactive elementsagent-browser --session-name pr-test snapshot | grep "textbox\|button"-# Login-agent-browser --session-name pr-test fill {email_ref} "[email protected]"-agent-browser --session-name pr-test fill {password_ref} "testtest123"+# Login (read creds from env — set PR_TEST_USER_EMAIL / PR_TEST_USER_PASSWORD or ask the user)+agent-browser --session-name pr-test fill {email_ref} "$PR_TEST_USER_EMAIL"+agent-browser --session-name pr-test fill {password_ref} "$PR_TEST_USER_PASSWORD"agent-browser --session-name pr-test click {login_button_ref}sleep 5