gitea-saas-core#39: eval farm HTTP surface — register_eval_routes #44
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: pbwraith/gitea-saas-core#44
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "issue-39"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #39
Implements the eval-farm HTTP surface (
register_eval_routes), symmetric with the factory front-end. Files touched:gitea_saas/intake_eval.py,tests/test_intake_eval.py— nothing else (app.py registration stays with the assembly issue #38).Routes
POST /api/eval/batches— funded: 201{ok, batch_id, repo, issues, hold_id}; unfunded: 202{ok: False, reason: unfunded, queued: True, pending_id}(queued locally, no Gitea issue).GET /api/eval/batches/<id>— status + per-task state; cancelled batches read ascancelled.GET /api/eval/batches/<id>/results— the results table (per-task status/title/summary).POST /api/eval/batches/<id>/cancel— stop draining + release the batch hold.GET /api/eval/health— public liveness (handler never calls_require_auth, like/api/factory/health).Auth (issue #24 discipline, no sixth implementation)
X-API-Key-> canonical 401UNAUTHORIZED_BODYfromgitea_saas.auth.SERVICE_UNAVAILABLE(per #38's assembly acceptance, which demands 503 app-wide when SAAS_API_KEY is unset; #24's consolidation converted the old per-route 503 to 401 for bad keys but the owner's #38/#39 acceptance explicitly wants 503 for unconfigured — implemented here as a config-state branch around the samekey_is_validcheck).Acceptance mapping
TestEvalRoutes(health public in both configs).flush_pendingships it (issues created, rowshipped) —TestQueueAndFlush, both halves asserted.git diff --checkclean.Design notes
eval_batch_hold_minorconfig attr /SAAS_EVAL_BATCH_HOLD_MINORenv / default = the debit floor (500); 0 disables. Placed via the billing core'sreserve_hold(idempotency keyeval-batch-<id>); rolled-back intake releases it (eval-rollback-<id>), so a failed submit never locks money.pending_eval_batches+eval_batch_cancels(idempotent CREATE IF NOT EXISTS);hold_idcolumn oneval_batcheswith a PRAGMA-guardedALTER TABLEfor pre-existing DB files.flush_pending).[lane2] gitea-saas-core#39 implemented, PR open for manual review.
Commit:
8620d4don branch issue-39 (based on origin/main @71cc263, no existing branch/PR for #39 before creation).PR: #44 (state=open, merged=false, base=main, head=issue-39), changed files: gitea_saas/intake_eval.py, tests/test_intake_eval.py — exactly the two files the issue owns.
Verification evidence:
One deliberate deviation to flag for review: acceptance 1 says "unconfigured key (503)" — the #24 consolidation ships 401 for empty configured keys across the other front-ends, but issue #38 (assembly) explicitly requires 503 app-wide when SAAS_API_KEY is unset, so register_eval_routes returns 503 SERVICE_UNAVAILABLE when no key is configured while keeping the canonical 401 for missing/blank/wrong keys. No new auth implementation: still key_is_valid + API_KEY_HEADER + unauthorized_response from gitea_saas.auth.
Held —
mainis red, and it is not this PR's faultGated against the real merge result. The comparison that matters:
origin/main@71cc263(no PR)main+ this PRThe same 10 failures, and this PR adds 23 passing tests and zero new
failures. Every failure is in
tests/test_review_workspace.py/tests/test_reviewer.py— files this PR does not touch.So this is not a bounce and nothing is being asked of you. The work is good; it
is queued behind a pre-existing defect filed as #48: on Windows the shell
eats the
^ingit rev-parse --verify <sha>^{commit}, soReviewWorkspacecannot build a synthetic merge on the review box at all.
I will not merge onto a red
main— with the baseline broken there is no way totell a genuine regression from the existing noise, which is exactly how
botmanager shipped a broken
masterlast week. Once #48 is green I willre-gate and merge.
Merged — verified against green
main259 passed, 1 skipped, 0 failed;
mainafter !49 is 236 passed. 0 conflicts, confirmed with a realgit mergeafter Gitea briefly reported this unmergeable — that was stale metadata frommainmoving, not a genuine conflict.This PR was held, never bounced: it was queued behind the Windows caret defect (#48). The eval farm was library-only while the factory front-end had five routes; ARCHITECTURE.md calls them the two front-ends the billing core serves. Both are now reachable over HTTP.