All 5 suggestions from the latest review pass.
## tests/e2e/_extract_token.py (new)
Extracted the 14-line python-in-bash heredoc from _lib.sh into a real
Python file. Easier to edit, fewer escaping traps, same behavior.
Shell helper now just shells out to it.
## tests/e2e/_lib.sh
- Replaced inline python with: python3 "$(dirname "${BASH_SOURCE[0]}")/_extract_token.py"
- Removed redundant sys.exit(0) as part of the extraction
## Shellcheck-clean scripts (new CI job enforces)
- Removed dead captures: BEFORE_COUNT (test_activity_e2e.sh), ORIG_SKILLS,
REIMPORT_SKILLS (test_api.sh), QA_TOKEN (test_comprehensive_e2e.sh)
- Renamed unused loop vars `i`, `j` -> `_` in 4 sites
- Added `# shellcheck disable=SC2046` on the two intentional word-splits
in test_claude_code_e2e.sh (docker stop/rm of multiple container IDs)
- Removed a useless re-register of QA mid-script (was done in Section 2)
## CI (.github/workflows/ci.yml)
- Replaced `sudo apt-get install postgresql-client` + psql with a direct
`docker exec` into the existing postgres:16 service container. Saves
~10-20s per CI run.
- Added new `shellcheck` job that lints tests/e2e/*.sh on every PR.
Local: shellcheck --severity=warning returns 0 across all 5 scripts.
## Verification
- go test -race ./internal/handlers/... : pass
- mcp-server: 96/96 jest
- canvas: 357/357 vitest + clean build
- tests/e2e/test_api.sh: 62/62
- tests/e2e/test_comprehensive_e2e.sh: 67/67
- shellcheck tests/e2e/*.sh : clean
- CI YAML: valid
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
805 B
Python
Executable File
25 lines
805 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Stdin: JSON response from POST /registry/register.
|
|
Stdout: the auth_token value, or empty string.
|
|
Stderr: diagnostic when the response is unparseable or missing a token.
|
|
|
|
Exit code is always 0 — the empty string on stdout is how callers
|
|
distinguish "no token issued" (legitimate on re-registration) from
|
|
success. The warning on stderr surfaces the no-token case so it
|
|
stops masking downstream "missing workspace auth token" 401s.
|
|
"""
|
|
import json
|
|
import sys
|
|
|
|
try:
|
|
data = json.load(sys.stdin)
|
|
except Exception as e:
|
|
sys.stderr.write(f"e2e_extract_token: invalid JSON response ({e})\n")
|
|
print("")
|
|
raise SystemExit(0)
|
|
|
|
token = data.get("auth_token", "")
|
|
if not token:
|
|
sys.stderr.write("e2e_extract_token: response contained no auth_token field\n")
|
|
print(token)
|