mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 20:26:33 +00:00
Resolves 68 conflicted files. The governing rule was our structure with their
network semantics: the tor boolean becomes a network mode (clearnet | tor |
multi) throughout the variant layer, while this branch's architecture and mesh
axes, its extracted modules and its i18n content stay.
Where the two sides covered different ground, both are kept rather than one
picked:
- ca_injected answers a ca_client on the deployment's TLS mode OR on an SSO
issuer that resolves self-signed. 3a3e9ed2c9 records why: an issuer is not
an object store, so keeping only one side drops the other's coverage.
- get_merged_domains keeps the loud refusal when svc-net-tor is deployed
without a provisioned node, now gated on their tor_serves_host; their
node_onion_of returns an empty string there, which would have served every
onion-exclusive app on clearnet in silence.
- sso_cookie_domains stays the single source for oauth2-proxy's cookie scope.
Their per-network branch omitted the issuer domain on the onion arm, which
breaks the callback leg.
- The clearnet CSP batch carries --clearnet-timeout again; their batch dict
hardcoded zero while the role still passes the flag.
- The dashboard keeps its i18n content dir, image, version and design
resolution; their side reduced the logo sources to the bare service
provider values.
Their side wins where it is measurably better: the onion mirror rewrite is
gated per vhost rather than per app, the Playwright onion decision reads the
pass's own domain instead of the role's canonical one, and the matomo
reinjection and dashboard config render per network sibling.
Eight files were broken by the merge without ever carrying a conflict marker,
because git marks only the lines both sides touched:
- utils/cache/domains.py lost the onionize block that sat between two hunks
- roles/sys-front-inj-all/templates/body_filter.lua.j2 called it
- web-app-bluesky, keycloak sso_proxy: the get_entity_name filter was renamed
- trigger/__main__.py, playwright_coverage.py and its test: the deleted tor
module
- cli/administration/deploy/ci/timings.py read Label.tor
- plugins/filter/csp_filters.py called _aligned_url with four of six arguments
- tests/unit/python/utils/cache/test_domains.py referenced a renamed class
- tests/.../sys-ctl-hlth-csp/files/test_script.py mocked a function main no
longer calls
Verified: the variant layer (155 tests, 65 subtests), ca_injected (18),
the CI layer (175), the domains cache including the restored guard (32),
retrigger inputs (9), timings and the CSP health script (53). make
quality-high clears autoformat; its remaining findings are tracked separately.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
102 lines
3.4 KiB
Python
102 lines
3.4 KiB
Python
"""Report which sweep row first triggers each Playwright spec.
|
|
|
|
The classification lives in :mod:`utils.roles.playwright_coverage`, shared
|
|
with the integration test that holds the line; this renders it.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import sys
|
|
|
|
from cli.meta.ci import matrix, query
|
|
from cli.meta.roles.applications.complexity.render import _dwidth
|
|
from utils import PROJECT_ROOT
|
|
from utils.github.variant import axes, network, pools, vpn
|
|
from utils.roles.display import display_names
|
|
from utils.roles.playwright_coverage import (
|
|
Coverage,
|
|
chunk_index,
|
|
classify,
|
|
first_rows,
|
|
specs_by_role,
|
|
)
|
|
|
|
_HEADERS = ("Role", "Spec", "Variant", "Mode", "Chunk")
|
|
|
|
|
|
def sweep_entries(args: argparse.Namespace) -> list[dict[str, str]]:
|
|
codec = display_names()
|
|
return matrix.entries_of(
|
|
modes=query.resolve_modes(args.modes),
|
|
whitelist=codec.decode_list(""),
|
|
priority=codec.decode_list(""),
|
|
lifecycles="",
|
|
sweep=axes.resolve_sweep() if args.sweep is None else args.sweep,
|
|
network_input=network.resolve_network_input(args.network),
|
|
vpn_mode=vpn.resolve_vpn_mode(args.vpn),
|
|
distros=pools.resolve_distros(args.distros),
|
|
filesystems=pools.resolve_filesystems(args.filesystem),
|
|
architectures=pools.resolve_architectures(args.architectures),
|
|
)
|
|
|
|
|
|
def render(coverage: Coverage) -> str:
|
|
rows = [tuple(row) for row in coverage.triggered]
|
|
widths = [
|
|
max(_dwidth(cell) for cell in column)
|
|
for column in zip(_HEADERS, *rows, strict=False)
|
|
]
|
|
|
|
def line(cells: tuple[str, ...]) -> str:
|
|
return " ".join(
|
|
cell + " " * (width - _dwidth(cell))
|
|
for cell, width in zip(cells, widths, strict=True)
|
|
)
|
|
|
|
lines = [line(_HEADERS), " ".join("-" * width for width in widths)]
|
|
lines.extend(line(row) for row in rows)
|
|
total = len(rows) + len(coverage.uncovered) + len(coverage.excluded)
|
|
lines.append("")
|
|
lines.append(
|
|
f"specs: {total}, triggered: {len(rows)}, "
|
|
f"never triggered: {len(coverage.uncovered)}, "
|
|
f"outside the tested lifecycles: {len(coverage.excluded)}"
|
|
)
|
|
lines.extend(
|
|
f" never triggered: {role}: {spec}" for role, spec in coverage.uncovered
|
|
)
|
|
lines.extend(
|
|
f" lifecycle {entry.lifecycle}: {entry.role}: {entry.spec}"
|
|
for entry in coverage.excluded
|
|
)
|
|
return "\n".join(lines)
|
|
|
|
|
|
def main(argv: list[str] | None = None) -> int:
|
|
parser = argparse.ArgumentParser(
|
|
description="Show the first row that triggers each Playwright spec."
|
|
)
|
|
parser.add_argument("--distros", default="")
|
|
parser.add_argument("--modes", default=query.ALL_MODES)
|
|
parser.add_argument("--sweep", type=int, default=None)
|
|
parser.add_argument("--network", default=None)
|
|
parser.add_argument("--vpn", default=None)
|
|
parser.add_argument("--filesystem", default="")
|
|
parser.add_argument("--architectures", default="")
|
|
parser.add_argument("--offset", default=None)
|
|
args = parser.parse_args(argv)
|
|
|
|
entries = sweep_entries(args)
|
|
plan = matrix.chunks_of(entries, matrix.resolve_offset(args.offset))
|
|
roles_dir = PROJECT_ROOT / "roles"
|
|
coverage = classify(
|
|
specs_by_role(roles_dir), first_rows(entries), chunk_index(plan), roles_dir
|
|
)
|
|
print(render(coverage))
|
|
return 1 if coverage.uncovered else 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|