Files
computer-playbook/docs/contributing/actions/testing/suppression.md
T
kevinveenbirkenbachandClaude Opus 4.7 e729b54a3b test(lint): web-app-* logout, dashboard, oidc, oauth2 integration guards
Two new lint tests under tests/lint/ansible/roles/web-app/integration/
mirroring the existing email-integration pattern:

* test_logout_dashboard.py — every web-app-* role MUST declare
  services.logout AND services.dashboard activated (truthy via
  literal `true` or the dynamic `"{{ '<role>' in group_names }}"`
  form). Per-service opt-out via `# noqa: logout` /
  `# noqa: dashboard` directly above the key, paired with both
  flags `false`. Provider role web-app-dashboard self-exempt.
* test_sso.py — every web-app-* role MUST front its login flow
  with services.oidc OR services.oauth2 activated. If oidc is
  intentionally opted out (`# noqa: oidc` above the key + both
  flags false), then oauth2 must take over. Roles with no login
  flow at all opt out of BOTH (e.g. static-content sites). Provider
  roles web-app-keycloak / web-app-oauth2-proxy self-exempt.

Co-located reorganisation: the existing email lint moves with them
into the new web-app/integration/ subfolder, dropping the redundant
`web_app_` prefix and `_integration` suffix per the new naming
scheme. test_email.py renamed via git mv so blame is preserved.

Suppression catalog (docs/contributing/actions/testing/suppression.md)
gains four new rule keys (`logout`, `dashboard`, `oidc`, `oauth2`),
all with the "line above" placement semantic identical to `email`.

services.yml changes to satisfy the new guards:

* logout opt-out (`# noqa: logout` above + both flags false) added
  to: web-app-keycloak (the IdP itself), and the minimal/no-login
  apps web-app-bridgy-fed, -chess, -hugo, -littlejs, -mig, -mini-qr,
  -navigator, -postmarks, -roulette-wheel, -socialhome, -sphinx.
* dashboard opt-out added to: web-app-bigbluebutton, -espocrm,
  -matomo, -oauth2-proxy, -phpmyadmin (with explicit shared: false
  added where missing), and full block created for -fusiondirectory.
* SSO opt-out (oidc + oauth2 both `# noqa`'d, both flags false)
  added to roles without a login flow (the same 11 minimal apps)
  and to roles where Keycloak SSO isn't wired up: -confluence, -jira,
  -magento, -matomo, -shopware. matomo's existing TODO comment about
  enabling oauth2 is preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 23:25:58 +02:00

11 KiB

Suppression Markers 🚫

The unified # noqa / # nocheck syntax that suppresses individual checks across the infinito-nexus test suite.

You MUST use these markers only when the check genuinely does not apply. You MUST NOT use them to silence legitimate issues.

Grammar 📐

A suppression marker is a comment carrying one or more rule keys:

<comment-prefix> (noqa|nocheck): <rule>(, <rule>)*

Rules:

  • noqa and nocheck are synonyms. By convention, use noqa for code-level lints (analogous to flake8 / ruff) and nocheck for repository-content checks (URLs, image versions, file size, run-once schema). Either keyword works for any rule; the test does not enforce which one is used.
  • The keyword is matched case-insensitively.
  • <rule> is a kebab-case identifier from the catalog below.
  • Multiple rules MAY be combined on one comment, comma-separated: # noqa: shared, email.

Accepted comment prefixes (so the marker fits any file format that the test scans):

Prefix Use in
# Python, YAML, shell, conf, INI, …
// JS, JSONC, …
{# … #} Jinja2 templates
<!-- … --> HTML, Markdown

Implementation: utils/annotations/suppress.py.

Position semantics 📍

The placement rule is per check. The catalog column "Position" uses these labels:

  • same line: the marker MUST be on the same line as the construct it suppresses.
  • line above: the marker MUST be on the immediately preceding non-empty line. Blank lines between the marker and the construct break the association.
  • same or above: either of the above is accepted.
  • comment block above: the marker may sit on any line in a contiguous comment block above the construct (no blank line between marker and construct).
  • head (first 30 lines): the marker MAY appear anywhere in the first 30 lines of the file. Used for file-level opt-outs that should stay visible at the top of the file.
  • anywhere: the marker may appear on any line of the file. Used for whole-file opt-outs whose semantics legitimately apply to the entire file.

Catalog 📚

Rule Position Affected test Effect
url same or above test_urls_reachable.py Skips probing the literal HTTP(S) URL. Use for CDN roots and API base URLs that return 4xx without a path.
docker-version line above test_image_versions.py Skips the live version-update warning for that image's version: key.
direct-yaml same line / span test_no_direct_yaml_calls.py Allows the marked yaml.safe_load / safe_dump call to bypass utils.cache.yaml.
shared comment block above test_service_shared_consistency.py Marks a service whose enabled: true legitimately does not require shared: true.
email line above test_email.py Suppresses the missing-email-integration warning when paired with enabled: false and shared: false.
logout line above test_logout_dashboard.py Opts a web-app-* role out of the universal-logout integration. Marker MUST be on the line directly above logout:, paired with enabled: false and shared: false.
dashboard line above test_logout_dashboard.py Opts a web-app-* role out of the dashboard tile integration. Same shape as logout.
oidc line above test_sso.py Opts the role's native OIDC path out (so that oauth2 must take over, OR — if oauth2 is also opted out — the role legitimately has no login flow). Same shape as email.
oauth2 line above test_sso.py Opts the role's oauth2-proxy path out. In combination with # noqa: oidc it declares "this role has no login flow at all". Same shape as email.
file-size head (first 30 lines) test_python_file_size.py Opts the entire .py file out of the 500-line cap.
run-once anywhere test_run_once_tags.py, test_schema.py Marks a role's tasks/main.yml as intentionally re-runnable; skips both the run-once tag check and the suffix check.
run-once-suffix same line test_schema.py Allows a single when: item to reference a run_once_<other> flag whose suffix differs from the current role.
raw-docker same or above; head (first 30 lines) test_no_raw_docker.py Marks a single line or a whole file under roles/ as legitimately calling docker / docker compose / docker-compose directly. The check is scoped to roles/; bootstrap scripts and CI workflows outside roles/ are not scanned and need no marker.
hardcoded-dns-resolver same or above test_no_hardcoded_dns_resolvers.py Marks a line that legitimately needs a literal IP from NETWORK_PUBLIC_DNS_RESOLVERS at the substitution point (CoreDNS forward directives that don't run through Jinja, host-bootstrap shell scripts, documentation examples). The variable in group_vars/all/08_networks.yml is the SPOT for these IPs everywhere else.
dynamic-flag same line (per-flag) OR comment block above key (whole block) test_services_dynamic_flags.py Marks a roles/*/meta/services.yml flag whose value legitimately stays literal. Per-flag (same line) is the typical shape for databases (enabled: true literal, shared still dynamic). Block-level (comment block above the service key) is for entries where both flags stay literal (e.g. css).

Examples 💡

url, on the line carrying the literal URL or on the line above it:

ensure_proxy_repo raw raw-packagist "$(... https://repo.packagist.org/ ...)"  # nocheck: url
# nocheck: url
api_base_url: "https://example.org/v1"

docker-version, directly above a version: key:

service_x:
  # nocheck: docker-version
  version: "4.5"

direct-yaml, anywhere on the call's physical line or on any line spanned by the multi-line call:

data = yaml.safe_load(text)  # noqa: direct-yaml

shared, somewhere in the comment block immediately above a service key:

# This service is inherently role-local.
# noqa: shared
my_local_service:
  enabled: true

email, directly above the email: block, paired with both flags false:

# noqa: email
email:
  enabled: false
  shared: false

file-size, at the top of a long Python file:

"""Module docstring."""
# nocheck: file-size  (single-host orchestration script ships as one file)

run-once, at the top of a role's tasks/main.yml:

# nocheck: run-once

- name: ...

run-once-suffix, on the exact when: list-item line:

when:
  - run_once_svc_db_openldap is not defined   # noqa: run-once-suffix

raw-docker, per-line on a single role-task line that legitimately calls docker directly (e.g. a bootstrap step that runs before the container wrapper is on the path):

- name: "Bootstrap engine before the wrapper exists"
  ansible.builtin.command: docker info  # noqa: raw-docker

raw-docker, file-level at the top of a role's bundled shell script that legitimately drives the engine directly:

#!/usr/bin/env bash
# nocheck: raw-docker. Runs from sys-svc-container's installer before the wrapper symlink lands.
docker buildx build ...

dynamic-flag, two placements depending on scope:

Per-flag (same line) — for databases where enabled: true reflects a static fact about the role's needs but shared still resolves dynamically:

mariadb:
  enabled: true  # nocheck: dynamic-flag
  shared: "{{ 'svc-db-mariadb' in group_names }}"

Block-level (comment block above the service key) — for service entries whose both flags legitimately stay literal (e.g. css, javascript):

# nocheck: dynamic-flag
css:
  enabled: true
  shared: true

hardcoded-dns-resolver, on the line that emits the literal IP, when the substitution point cannot consume NETWORK_PUBLIC_DNS_RESOLVERS (e.g. a CoreDNS forward directive in a non-Jinja template):

forward . 1.1.1.1 8.8.8.8  # noqa: hardcoded-dns-resolver

Adding a new rule 🆕

  1. Pick a kebab-case <rule> identifier.
  2. Decide which position semantic from the list above fits the check.
  3. Use the is_suppressed_at / is_suppressed_in_head / is_suppressed_anywhere helpers from utils/annotations/suppress.py in your test. Do NOT roll a new regex.
  4. Add the rule to the catalog table on this page.