refactor: remove dead subdomain routing path#205
Merged
Conversation
The multi-level mDNS subdomain approach is gone — halos-mdns-publisher
is archived, no live system discovers subdomain hostnames, and the
deployed reverse proxy in halos-core-containers routes by path under
${HALOS_DOMAIN} (expanded across configured hostnames by prestart).
Deletes the parts of c-p-t that were still generating that extinct
routing surface. Pure dead-code removal — no behavior change for any
live deployment.
src/generate_container_packages/traefik.py
- delete generate_traefik_labels (only called by its own tests)
- delete _build_host_rule and _extract_container_port helpers
(the latter is duplicated in routing.py for the live path)
- keep inject_traefik_network / inject_proxy_network — still
called by builder.py and unrelated to the dead label path
src/generate_container_packages/oidc_snippet.py
- stop prepending {subdomain}. to the redirect URIs
- keep both http:// and https:// entries unchanged so the
Authelia client allow-list shape stays identical
src/schemas/metadata.py
- drop the subdomain field from TraefikConfig and RoutingConfig.
Both models default to extra='ignore', so any leftover
'subdomain:' in a metadata.yaml is silently dropped instead of
raising — verified zero apps in the workspace actually set it.
Tests:
- tests/test_traefik_labels.py → renamed to test_traefik_network.py,
collapsed to the proxy-network suite (TestExtractContainerPort
coverage already lives in tests/test_routing.py, plus a new
test_container_port_integer_format pins the integer-port branch)
- test_oidc_snippet, test_traefik_schema, test_routing_schema:
drop subdomain assertions and fixtures
- test_middleware, test_templates_oidc: strip dead subdomain keys
from fixtures (Pydantic was ignoring them)
- test_routing: rename test_routing_without_subdomain to
test_generated_routing_omits_subdomain_key as a regression guard
- test_routing_schema: add test_legacy_subdomain_field_silently_ignored
pinning the backward-compat contract for RoutingConfig
878 tests pass; ruff clean.
Refs #204
be288ee to
624de36
Compare
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.
Summary
Pure dead-code removal. The multi-level mDNS subdomain approach is gone —
halos-mdns-publisheris archived, no live system discovers subdomain hostnames, and the deployed reverse proxy inhalos-core-containersroutes by path under${HALOS_DOMAIN}(expanded across configured hostnames byhalos_expand_oidc_redirect_uriinlib-hostnames.sh).No behavior change for any live deployment. The OIDC redirect URI list shape (
http://+https://entries) is preserved; only the dead{subdomain}.prefix is dropped.Changes
src/generate_container_packages/traefik.py— deletegenerate_traefik_labels(only called by its own tests;builder.pyonly callsinject_traefik_network, whose docstring already says "Traefik labels are NOT injected here — they're generated at runtime by the Traefik container based on routing.yml declarations"). Also delete_build_host_rule(only called by deleted function) and_extract_container_port(live copy lives inrouting.py). Keepinject_traefik_network/inject_proxy_network/_detect_host_networking.src/generate_container_packages/oidc_snippet.py— stop prepending{subdomain}.to the redirect URIs. Keep bothhttp://andhttps://entries unchanged so the Authelia client allow-list shape is identical to before.src/schemas/metadata.py— drop thesubdomainfield fromTraefikConfigandRoutingConfig. Both default toextra="ignore", so any leftoversubdomain:in ametadata.yamlis silently dropped instead of raising. Audited the workspace — zero live apps set the field.Tests —
tests/test_traefik_labels.pyrenamed totests/test_traefik_network.pyand collapsed to the proxy-network suite.TestExtractContainerPortcoverage already lives intests/test_routing.py::TestContainerPortExtraction(with a newtest_container_port_integer_formatpinning theisinstance(int)branch that was previously only covered in the deleted file). Newtest_legacy_subdomain_field_silently_ignoredintest_routing_schema.pypins the backward-compat contract forRoutingConfig. Subdomain assertions / dead fixtures dropped elsewhere; regression-guard test renamed intest_routing.py.Note on the "subtree cleanup" half of the issue
There is no
container-packaging-tools/halos-core-containers/subtree in this repo's git history (git log --all -- halos-core-containers/is empty). What exists at that path in some checkouts is a separately clonedhatlabs/halos-core-containersworking tree with its own.gitandorigin. Nothing in this repo to delete for that half of the scope — it's a personal working-tree artifact, not a c-p-t concern. Recommend closing that sub-scope as not-applicable.Verification
uv run pytest tests/ -m "not install and not docker and not slow"→ 878 passed, 2 skipped, 16 deselecteduv run ruff check src/ tests/→ All checks passedgrep -rn "subdomain" src/ tests/→ only the intentional regression-guard test intests/test_routing.pygrep -rn "halos\.subdomain"workspace-wide → only the archivedhalos-mdns-publisherand the stale personal cloneredirect_urisshape: still[http://${HALOS_DOMAIN}{path}, https://${HALOS_DOMAIN}{path}]— identical to before, minus the (always-dead) subdomain prefixNet change
11 files changed, 128 insertions, 721 deletions(refactor) + bump to 0.6.1 + uv.lock sync. Three commits total.Refs #204
Parent issue: halos-org/halos#111