feat(port-forward): default to control-plane transport#212
Conversation
Review PromptPlease review this pull request and provide feedback on:
Be constructive and helpful in your feedback. Specific rules for this codebase: General rules
PII in Logs - HIGH PRIORITYFlag any code that logs user PII (Personally Identifiable Information). This is a critical security and compliance issue. Check for and reject:
Require instead:
Example violations to flag: logger.info(f"User {user.email} logged in") # BAD
logging.warning(f"Failed for {body.email}") # BAD
print(f"Contact sent: {data}") # BAD if data contains email
discord_message += f"Email: {user.email}" # BADCorrect patterns: logger.info(f"User auth_id={user.auth_id} logged in") # GOOD
logger.warning("Failed login", {"auth_id": user.auth_id}) # GOODi18n rules
|
|
Implemented the control-plane What changed:
Validation run on the current branch head:
Review notes:
PR: #212 |
⭐ GitRank PR AnalysisScore: 50 points
Eligibility Checks
Impact SummaryThis PR transforms Analysis DetailsComponent Classification: This PR implements a new feature (port-forward over WebSocket) rather than fixing a specific categorized component. It spans API, CLI, and infrastructure layers without fitting neatly into predefined categories. Severity Justification: This is a high-impact feature addition that introduces a new authenticated transport mechanism for port forwarding, changes default behavior from SSH to WebSocket, and includes comprehensive fallback logic. The scope (1566 lines across 10 files) and architectural significance warrant P1 classification. Eligibility Notes: Tests are required and present: 332 lines of API tests covering WebSocket lifecycle, EOF framing, dropped connections, and 402 lines of CLI tests covering WebSocket proxying, EOF preservation, tunnel drops, and SSH fallback. The PR is well-documented with architecture decision document. No specific issue is referenced, but this is a planned feature implementation. Fix_implementation is true as code changes align with the feature description. Analyzed by GitRank 🤖 |
TL;DR
This turns
spz port-forwardinto a control-plane feature: it now prefers authenticated WebSocket transport over the Spritz API on443, keeps SSH as an explicit fallback, and hardens the new tunnel path for mixed-rollout and dropped-connection cases.Summary
GET /api/spritzes/:name/port-forwardin the API and reuse pod port-forwarding for both SSH and control-plane transportsspz port-forwardprefer WebSocket transport, while automatically falling back to legacy SSH when the control-plane endpoint is unavailableReview focus
Validation
cd /Users/onur/repos/spritz/api && go test ./...pnpm --dir /Users/onur/repos/spritz/cli test -- test/help.test.ts test/port-forward.test.tspnpm --dir /Users/onur/repos/spritz/cli test -- test/port-forward.test.tspnpm --dir /Users/onur/repos/spritz/cli testpnpm --dir /Users/onur/repos/spritz/cli buildcd /Users/onur/repos/spritz && npx -y @simpledoc/simpledoc checktcodex review --base mainon earlier heads surfaced and drove fixes for startup validation, rollout fallback, EOF handling, and dropped-tunnel cleanup; the final rerun hit a local Codex client transport failure (http://127.0.0.1:8787/responses) before completion, so I also triggered PR-side AI reviewtcx pr review --pr 212 --repo textcortex/spritz --watchtimed out without Codex/Claude replies on the latest headtcx pr can-merge --pr 212 --repo textcortex/spritz