Sync from deal-sage/deal-sage@83bb6f4c19
This commit is contained in:
@@ -7,6 +7,8 @@ like the real functions would:
|
||||
promote -> promoted per STUB_POLICY (auto|manual)
|
||||
fail -> ok
|
||||
POST /record-app-check -> {"id": "..."}
|
||||
POST /record-app-build start -> {"buildId": "bld-1"}; finish -> echo;
|
||||
steps -> {"buildId": ..., "steps": <count>}
|
||||
PUT /__upload/<app>/<v>/<path> -> 204
|
||||
"""
|
||||
import json, os, sys
|
||||
@@ -52,6 +54,17 @@ class H(BaseHTTPRequestHandler):
|
||||
if self.path.endswith("/record-app-check"):
|
||||
seq["n"] += 1
|
||||
return self._json(200, {"id": f"chk-{seq['n']}"})
|
||||
if self.path.endswith("/record-app-build"):
|
||||
if body.get("action") == "start":
|
||||
return self._json(200, {"buildId": "bld-1"})
|
||||
if body.get("action") == "finish":
|
||||
return self._json(200, {"buildId": body.get("buildId"), "outcome": body.get("outcome")})
|
||||
if body.get("action") == "steps":
|
||||
steps = body.get("steps")
|
||||
if not isinstance(steps, list) or not steps:
|
||||
return self._json(400, {"error": "steps must be a non-empty array"})
|
||||
return self._json(200, {"buildId": body.get("buildId"), "steps": len(steps)})
|
||||
return self._json(400, {"error": "bad action"})
|
||||
self._json(404, {"error": "no route"})
|
||||
|
||||
def do_PUT(self):
|
||||
|
||||
Reference in New Issue
Block a user