Mailglass.Installer.Doctor (Mailglass v1.9.0)

Copy Markdown View Source

Static webhook-wiring check for the host app's endpoint.

Reads endpoint.ex off disk (via File.read!) and checks whether the Mailglass CachingBodyReader body reader is wired. No app boot, no runtime reflection — the scan runs inside the install-fixture harness in CI.

Exit-code mapping (three-state)

  • summary.cannot_diagnose > 0 — endpoint.ex missing / app not detectable → exit 2
  • summary.fail > 0 — CachingBodyReader absent → exit 1
  • else — wired correctly → exit 0

Usage

Mailglass.Installer.Doctor.run([])
# => %{summary: %{pass: 1, warn: 0, fail: 0, cannot_diagnose: 0}, findings: [...]}

Summary

Functions

Runs the static endpoint-wiring scan and returns a result map.

Types

finding()

@type finding() :: %{
  check: atom(),
  status: :pass | :warn | :fail,
  title: String.t(),
  observed: String.t(),
  remediation: String.t(),
  evidence: map()
}

result()

@type result() :: %{summary: map(), findings: [finding()]}

Functions

run(opts \\ [])

@spec run(keyword()) :: result()

Runs the static endpoint-wiring scan and returns a result map.

Options are accepted for API symmetry with the inbound doctor but are not currently used — the scan is static and unconditional.