Repository navigation
Add a weekly link check and a bridge-config gate - #16
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Weekly external link check and bridge config gate
External links (
.github/workflows/links.yml,lychee.toml)lycheeverse/lychee-action@v2(v2 = v2.9.0) ondocs/**/*.mdandsrc/**/*.tsx.workflow_dispatch. Not on pull requests, so a flaky third-party site never blocks a merge.contents: readonly, so it opens no issues.lychee.toml:/docs/...links resolve to matrixdocs.github.io, which is excluded.*.example.com/.org/.net,alice.example, localhost, 127.0.0.1), single-label Docker service hosts (http://synapse:8008), templated URLs andmatrix.to/#links.docs/deployment/ansible.md, which returned 200 when rechecked, so it was transient. The lychee tarball's sha256 matched the release's.sha256file.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 inscripts/upstream-versions.json. Keys that are only commented out in the example still count.network:is checked against<bridge>/pkg/connector/example-config.yamland the other sections against mautrix/gobridgev2/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.yamlschema.Pins, all checked against the GitHub releases API:
scripts/fetch-upstream.shfetches these files into.upstream/bridges/.It runs as a second step in
snippets.ymlwith the sameSNIPPETS_STRICTbehaviour. 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 checkstill reports 0 andnpm run buildpasses.