Repository navigation
Observability renderer: host loopback port overrides that survive a re-render - #290
Merged
seathatflowsinourveins merged 3 commits intoSep 25, 2026
Merged
Conversation
…e-render All WSL 2 distributions share one network namespace, so the workstation moved five scraped services off their template ports (collector 18889 and 18888, Qdrant 16333, vLLM 8231, the 14333 HTTP check). configure.py had no input for that, so the host's live config was hand-adapted and any re-render would reset those ports; the #284 rollout (#287) had to be applied surgically for that reason. configure.py --port-overrides FILE takes a JSON object of template port to host port and rewrites every 127.0.0.1:<port> address in the configs and units in one pass. It keeps the map as <config-root>/port-overrides.json, which later renders reuse. It refuses the whole render (exit 2, nothing written) for a stale override, for a port that also appears outside a 127.0.0.1:<port> address (Grafana's http_port, Loki's listen ports), for a host port that collides with another rendered address, and for invalid input. The map is validated against the full render before any file is written. Rendering main with the workstation's map into a scratch root reproduces the live files: 14 of 15 byte-identical, and ecosystem-prometheus.yml equal as parsed YAML. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- Medium: the bare-port check scanned the caller's root paths, so a data root such as .../18888-data refused an 18888 override with a misleading cause. The checks now ignore the four root paths, and the refusal names the file that has the bare port. - Low: a non-ASCII digit key (such as U+00B2) passed str.isdigit() and crashed int() with exit 1. Keys must now be ASCII digits (exit 2). - Low: the README lists malformed input among the refusals. - Tests: each template output without overrides equals the template with only its path tokens replaced; a root path containing the port digits renders; a mixed valid and stale map is refused; a non-ASCII digit key is refused. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Collaborator
Author
|
Independent review of
After the fix: 86 passed, 1 skipped, 37 subtests; |
seathatflowsinourveins
enabled auto-merge (squash)
September 25, 2026 21:23
…port-overrides # Conflicts: # manifests/evidence.json
seathatflowsinourveins
deleted the
claude/backends-host-port-overrides
branch
September 25, 2026 22:02
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
observability/backends/configure.pygains--port-overrides FILE.tests/test_observability_backends_configure.py.observability/backends/README.mdand, with a single-line "changed afterv2026.09.25.2" marker, inadoption/platforms/linux-wsl2.md(Listeners and ports).manifests/evidence.json.Behaviour
--port-overrides FILEtakes a JSON object{"template port": host port}. It rewrites every127.0.0.1:<template port>address in the rendered configs and the five unit texts in one regex pass, with no chaining, so a swap works.<config-root>/port-overrides.json, and later renders reuse it without the flag. Deleting that file returns to the template ports.127.0.0.1:<port>address, such as Grafana'shttp_portor Loki's listen ports, which the override does not rewrite;Evidence
test_observability_backends_configure.pycovers no overrides, overrides with persistence and a byte-identical re-render, the swap, and 9 refusal cases. Together with the other backend tests and the docs-consistency, contract and release-pin tests: 85 passed, 1 skipped.scripts/validate.pypassed.ecosystem-prometheus.ymlwas equal as parsed YAML; the live file was re-serialized with different formatting.<config-root>/port-overrides.json(host-local), so the next re-render keeps the ports.🤖 Generated with Claude Code