Skip to content

flightcheck: offline URL host hygiene gate (catch typo'd/hallucinated link hosts)#209

Open
daeunJe0ng wants to merge 1 commit into
microsoft:mainfrom
daeunJe0ng:dawnjeong/flightcheck-doc-link-host-gate
Open

flightcheck: offline URL host hygiene gate (catch typo'd/hallucinated link hosts)#209
daeunJe0ng wants to merge 1 commit into
microsoft:mainfrom
daeunJe0ng:dawnjeong/flightcheck-doc-link-host-gate

Conversation

@daeunJe0ng

Copy link
Copy Markdown
Contributor

Summary

Adds a deterministic, offline gate that catches a whole class of broken links in the FlightCheck report before merge: URLs pointing at a host that is a typo or a hallucination.

FlightCheck emits three kinds of URLs (user-facing portal/doc links, backend API hosts, and XML namespace/example URIs), but today nothing checks that the hosts are real and intended. A single wrong character (learn.microsft.com, admin.powerplatfrom.microsoft.com) or an http:// portal link renders as a clickable link that sends the operator nowhere, and it ships silently.

What this does

  • tests/flightcheck/url_registry.py: a curated allowlist of every host FlightCheck is allowed to emit, split into three categories (portal/doc, API, namespace/example) plus a per-tenant suffix rule for *.crm.dynamics.com.
  • tests/flightcheck/test_url_hygiene.py: scans FlightCheck source (stdlib only, no imports of check modules, no network) for every http(s) URL and asserts:
    • every static host is registered in exactly one category, and
    • every fetchable host (portal/doc/API) uses https.
  • .github/workflows/ci.yml: wires the test in as a fast, no-network job so it gates every PR. (The FlightCheck pytest suite is otherwise not run in CI, so a test alone would enforce nothing.)

Adding or misspelling a host now turns into a review signal: the test fails until the host is deliberately categorized in url_registry.py.

Scope and honest limits

This is a host-level gate. It catches typo'd/unapproved domains and http-on-a-portal.

It does not verify that a path is live. A well-formed https://learn.microsoft.com/<moved-article> that now 404s or redirects to the docs home still passes. That "stale path" problem needs a live, networked checker, which is intentionally kept out of the deterministic suite and can reuse url_registry.py.

Testing

  • python -m pytest tests/flightcheck/test_url_hygiene.py -q → 7 passed.
  • ruff check on both new files → clean.
  • ci.yml parses as valid YAML.

Relationship to #208

Complementary, not overlapping. #208 makes bare URLs clickable; this PR makes sure the host a link points at is real.

…ated link hosts before merge)

FlightCheck emits portal, doc, and API URLs but nothing verifies the hosts are real and intended. A typo'd or hallucinated host (learn.microsft.com) or an http portal link sends the operator nowhere, and today that ships silently. Add a deterministic, offline test that scans FlightCheck source for every http(s) URL and asserts each static host is registered in a curated allowlist and that fetchable hosts use https. Wire it into ci.yml as a fast no-network job so it gates every PR. This is a host-level gate only; it does not verify a path is live (stale-path/404 detection is a separate networked concern that can reuse url_registry.py).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fb19ec0-cad9-41c2-8064-2208b3844ede
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant