Repository navigation
feat(ci): add PR gate, daily live canary verification, and fix SOCKS port - #5
Conversation
…t and cleanup repo
…ing procps in image
🔍 QA Gate Report & Edge-Case Discovery (ADR-005)Status: 1. PR CI Pipeline-Status
2. Standards- & ADR-Audit
3. 🚨 Blackbox Discovery: Latenter Breaking Bug in
|
Resolves QA edge-case finding where jq query for .tor.bootstrapped failed against api.py /status schema.
🛠️ Fix Applied: Canary Bootstrap Check AlignedThank you to the QA Engineer for the excellent blackbox and edge-case analysis! Cause & ResolutionThe key The check in
The fix has been pushed to the feature branch |
…rate limits gracefully
…id 429 pull rate limits
🛡️ QA Engineer Sign-off & Verification Report (ADR-005)Status: ✅ QA SIGN-OFF APPROVED (Pre-Merge Quality Gate Passed) 1. Re-Evaluation & Verification of Edge-Case Discoveries
2. Pipeline- & Testmatrix-Ergebnisse
3. QA Verdict gemäß ADR-005Alle Anforderungen gemäß ADR-001 (devenv), ADR-004 (TDD), ADR-005 (QA Gate), ADR-009 (Python Tooling) und ADR-010 (Minimal Dependencies) sind erfüllt. Der PR wird hiermit offiziell für das abschließende Review und den Merge-Gate durch den Code Reviewer (ADR-006) freigegeben. |
hapheus
left a comment
There was a problem hiding this comment.
Senior Code Review & Gatekeeper Approval (ADR-006)
Target PR: hapheus/torproxy#5 (feature/qa-automation-and-bugfixes)
Commit SHA: 056c75be1a30845c1ea0e76ae308d350279de08a
Verdict: APPROVED & CLEARED FOR MERGE 🚀
1. Architectural & Standards Compliance
- ADR-001 (devenv & direnv): Fully implemented with clean hermetic environments (
devenv.nix,devenv.yaml,.envrc). - ADR-003 (SOLID & Single Responsibility): Privoxy template replacement (
__TORPROXY_SOCKS_PORT__) cleanly separates configuration generation from runtime execution. - ADR-004 & ADR-009 (TDD & Python Standards): Hermetic test suite comprising 27 Pytest unit tests in
tests/unit/executing in < 1s with zero network dependencies.pyproject.tomlis modern and well-structured. - ADR-005 (QA Gate): Pre-commit configuration (
.pre-commit-config.yaml) enforces Ruff, ShellCheck, and syntax validations. - ADR-010 (Minimal Dependencies): Container footprint remains lean; process verification runs via host-native
docker topinstead of bloat packages likeprocps. - Repository Hygiene & English-Only Policy: Cache files (
__pycache__) removed,.gitignorehardened, and all code, identifiers, and comments strictly in English.
2. CI Pipeline & Actions Verification
- GitHub Actions Run: #37990290807 — 100% SUCCESS
Lint & Static Analysis: Ruff,bash -n, ShellCheck passed without warnings.Hermetic Unit Tests: 27/27 passed.Docker Build & Container Smoke Test: Non-root UID validation (UID != 0), multi-daemon process tree (tor,privoxy,api.py), and gracefulSIGTERMshutdown (< 5s SLA) verified.
3. Edge-Case & Defect Resolution
- Canary jq Schema Mismatch (Fixed in
8030142): Resolved the latent bug in.github/workflows/daily-image-verification.ymlby aligning the bootstrap check to[ "$STATUS" = "connected" ], preventing false canary alerts. - DockerHub Throttling Resilience (Added in
056c75b): Docker login and retry mechanisms prevent sporadic HTTP 429 rate limits on shared GitHub runners.
4. QA Sign-Off (ADR-005 Gate)
- QA Sign-off Received: Confirmed by QA Engineer in Comment #6089210725.
- All blackbox, multi-daemon, and edge-case requirements verified.
Proceeding with autonomous merge per ADR-006 gatekeeper policy.
Summary
This PR establishes automated CI/CD quality assurance for
hapheus/torproxy, addresses the SOCKS port configuration bug, and brings the repository into full compliance with architectural standards (ADR-001, ADR-004, ADR-005, ADR-009, ADR-010).All CI workflows exclusively use free standard GitHub runners (
runs-on: ubuntu-latest).1. Workflows & CI Architecture
.github/workflows/pr-gate.yml):mainand pushes tomain.tor,privoxy,api.py).SIGTERMshutdown within 5s SLA..github/workflows/daily-image-verification.yml):workflow_dispatchtrigger).hapheus/torproxy:latestimage./statusendpoint (max 180s).:8118) egress & anonymity check (IsTor: true, Anti-Leak Exit IP != Runner Host IP).:9050) remote DNS resolution & egress check.POST /reconnect-> 15s cooldown -> verify circuit refresh).canary-alertupon failure.2. Bug Fixes & Improvements
docker/privoxy.config.template: Replaced hardcoded127.0.0.1:9050with127.0.0.1:__TORPROXY_SOCKS_PORT__.docker/start.sh: Added sed replacement for__TORPROXY_SOCKS_PORT__in privoxy config generation, allowing custom SOCKS ports to route correctly.docker/api.py: Fixedos.environ.getdefault argument types forTORPROXY_API_PORTandTORPROXY_LISTEN_PORT, sorted imports, and added proper shebang execution bit.3. Architecture & Standards Compliance
devenv.nix,devenv.yaml, and.envrc.tests/unit/test_api.pyandtests/unit/test_config.py..pre-commit-config.yaml(Ruff, ShellCheck, trailing whitespace, yaml checks).pyproject.tomlwith project metadata, ruff configuration, and pytest marks.docker/__pycache__/api.cpython-310.pyc..gitignoreanddocker/.dockerignoreto block all Python cache and environment artifacts.