Skip to content

Add a weekly link check and a bridge-config gate - #16

Merged
melvincarvalho merged 1 commit into
mainfrom
tooling/links-bridges
Oct 18, 2026
Merged

melvincarvalho merged 1 commit into
mainfrom
tooling/links-bridges

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Weekly external link check and bridge config gate

External links (.github/workflows/links.yml, lychee.toml)

  • Runs lychee v0.24.2 via lycheeverse/lychee-action@v2 (v2 = v2.9.0) on docs/**/*.md and src/**/*.tsx.
  • Weekly (Mondays 06:17 UTC) and on workflow_dispatch. Not on pull requests, so a flaky third-party site never blocks a merge.
  • Report goes to the job summary. The job fails on broken links. contents: read only, so it opens no issues.
  • lychee.toml:
    • http(s) only; internal links and anchors are left to the Docusaurus build. /docs/... links resolve to matrixdocs.github.io, which is excluded.
    • Excludes placeholder hosts (*.example.com/.org/.net, alice.example, localhost, 127.0.0.1), single-label Docker service hosts (http://synapse:8008), templated URLs and matrix.to/# links.
    • Accepts 429. Sends a browser user agent (for crates.io and gitlab.gnome.org). 3 retries, 30 s timeout.
  • Local run, 2026-10-18: 590 unique links, 718 OK, 263 excluded and 1 error. The error was a 503 from a GitHub blob page in docs/deployment/ansible.md, which returned 200 when rechecked, so it was transient. The lychee tarball's sha256 matched the release's .sha256 file.

Bridge config gate (scripts/check-bridge-configs.mjs, npm run check:bridges)

  • For each YAML block that is a bridge config.yaml, it checks that every key path exists in that bridge's example config at the tag pinned in scripts/upstream-versions.json. Keys that are only commented out in the example still count.

    • For bridgev2 bridges, network: is checked against <bridge>/pkg/connector/example-config.yaml and the other sections against mautrix/go bridgev2/matrix/mxmain/example-config.yaml.
  • The bridge is taken from a mautrix/<name> comment in the block, then from the page.

  • Appservice registration blocks (Heisenbridge has no config file, plus the Hookshot and bot registrations) are checked against the spec v1.19 registration.yaml schema.

  • Pins, all checked against the GitHub releases API:

    Project Tag
    mautrix/go v0.32.0
    mautrix/discord (legacy) v0.7.7
    whatsapp, signal, slack, telegram, meta, gmessages v0.2610.0
    matrix-appservice-irc 4.0.0
    matrix-hookshot 7.5.0
  • scripts/fetch-upstream.sh fetches these files into .upstream/bridges/.

  • It runs as a second step in snippets.yml with the same SNIPPETS_STRICT behaviour. It runs even if the first step fails, so both reports appear.

  • To skip one block, put {/* snippet:skip: reason */} on the line before it.

  • Current docs: 13 blocks, 0 findings. A mutation test that injected 8 bad keys (unknown keys, a bridgev2 section in the legacy Discord config, a bad registration field, a scalar used as a map) caught all 8 with the right line numbers.

npm run check still reports 0 and npm run build passes.

- links.yml: lychee (lychee-action v2, lychee v0.24.2) on docs/**/*.md and
  src/**/*.tsx, weekly and on workflow_dispatch only; report in the job
  summary, read-only permissions. Settings in lychee.toml.
- check-bridge-configs.mjs: checks key paths in bridge config.yaml blocks
  against each bridge's example config at the tag pinned in
  upstream-versions.json, and appservice registration blocks against the
  spec's registration schema. Run with `npm run check:bridges`; a second step
  in snippets.yml with the same SNIPPETS_STRICT behaviour.
- fetch-upstream.sh fetches the pinned example configs into .upstream/bridges.
@melvincarvalho
melvincarvalho merged commit 2edce0c into main Oct 18, 2026
1 check passed
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