fix(infra): reach Objecten by service name in the register-record check (refs #149)
CI / build (pull_request) Successful in 1m8s
CI / lint (pull_request) Successful in 1m23s
CI / unit (pull_request) Successful in 1m23s
CI / frontend (pull_request) Successful in 2m59s
CI / mutation (pull_request) Successful in 6m8s
CI / verify-stack (pull_request) Failing after 7m24s
CI / build (pull_request) Successful in 1m8s
CI / lint (pull_request) Successful in 1m23s
CI / unit (pull_request) Successful in 1m23s
CI / frontend (pull_request) Successful in 2m59s
CI / mutation (pull_request) Successful in 6m8s
CI / verify-stack (pull_request) Failing after 7m24s
CI caught my own check falling into the constraint ADR-0028 documents: it looked Objecttypen up by container IP, so the objecttype URL came back IP-addressed and Objecten rejected it as "not one of the available choices". Reach both by service name — compose DNS resolves them, and neither request has OpenZaak's URL-validity constraint that made IPs necessary elsewhere in this script. The 400 also spent the full 60s timeout disguised as "transport:" because HTTPError is a URLError subclass. Handle it separately: a 4xx now fails immediately with the response body, which is where the real reason was. Verified both ways against a live Objecten: absent record → exit 1 with the reason, present record → exit 0.
This commit is contained in:
@@ -77,6 +77,14 @@ def main():
|
||||
if ok:
|
||||
print(f"OK — approval wrote the register record to Objecten: {detail}")
|
||||
return 0
|
||||
except urllib.error.HTTPError as e:
|
||||
# A 4xx is us, not a cold start — retrying just hides the reason until the deadline.
|
||||
# (A rejected objecttype URL shows up here as a 400 with a very specific body.)
|
||||
body = e.read().decode(errors="replace")[:400]
|
||||
if e.code < 500:
|
||||
print(f"FAIL — HTTP {e.code} from {e.url}: {body}", file=sys.stderr)
|
||||
return 1
|
||||
detail = f"HTTP {e.code}: {body}"
|
||||
except (urllib.error.URLError, ConnectionError, TimeoutError) as e:
|
||||
detail = f"transport: {e}"
|
||||
time.sleep(3)
|
||||
|
||||
Reference in New Issue
Block a user