Skip to content

fix(settings): point telemetry help link at the real docs slug + anchor (#1474) - #1478

Merged
rumblefrog merged 1 commit into
mainfrom
fix/1474-telemetry-docs-link
May 27, 2026
Merged

rumblefrog merged 1 commit into
mainfrom
fix/1474-telemetry-docs-link

Conversation

@rumblefrog

Copy link
Copy Markdown
Member

Summary

Fixes #1474.

The Anonymous telemetry help paragraph in
?p=admin&c=settings&section=features ships a "See the full payload"
link pointing at https://sbpp.github.io/updating/1.8-to-2.0/#telemetry,
which 404s. Two things are wrong:

  1. Slug 1.8-to-2.0 — Astro derives slugs from filenames, and the
    docs source file on disk is docs/src/content/docs/updating/1-8-to-2-0.mdx
    (dots become dashes). The deployed URL is /updating/1-8-to-2-0/.
  2. Anchor #telemetry — the heading in that file is ## Anonymous telemetry, which Starlight auto-slugs to #anonymous-telemetry.
    #telemetry matches no heading.

Three sibling sites carried the same broken URL or the matching
source-file path drift, all swept here:

  • web/themes/default/page_admin_settings_features.tpl — the actual
    user-reported broken link.
  • AGENTS.md "Build / extend the anonymous opt-out daily telemetry
    payload" row pointed at the wrong source file path
    (docs/src/content/docs/updating/1.8-to-2.0.mdx, which doesn't exist).
  • CHANGELOG.md 2.0.0 Privacy subsection — same broken URL.

Regression guard

New web/tests/integration/DocsUpgradeLinkRegressionTest.php pins
four contracts:

  1. testCanonicalDocsFileExistsAtFixedSlugPath — the docs source
    file at 1-8-to-2-0.mdx exists. A rename silently re-breaks every
    panel-side link pointing at the slug; pinning the canonical
    filename here makes a future "let's clean up the slug" PR fail
    the gate first.
  2. testCanonicalDocsFileCarriesTheAnonymousTelemetryHeading —
    that file carries the ## Anonymous telemetry heading. A rename
    to ## Telemetry would silently 404 every deep-link to
    #anonymous-telemetry.
  3. testNoPanelOrDocSourcesUseTheBrokenUpgradeSlug — no file
    under the documented scan roots (templates, page handlers,
    includes, scripts, API handlers, AGENTS.md, CHANGELOG.md)
    carries the literal 1.8-to-2.0 substring. Catches both broken
    URLs (/updating/1.8-to-2.0/) and broken source-file path
    references (docs/src/content/docs/updating/1.8-to-2.0.mdx)
    with one assertion.
  4. testTelemetryHelpLinkUsesCorrectUrlAndAnchor — the specific
    template line uses the fully corrected URL. A half-fix that gets
    one half right but the other wrong (slug right, anchor wrong, or
    vice-versa) still fails.

Pure file scanning — no DB / session / Smarty bring-up. Extends
PHPUnit\Framework\TestCase directly (same shape as
DeadJsCallSitesTest, IframeChromeAntiFoucBootloaderTest,
ButtonClassChainTest).

Dev-stack symmetry

docker-compose.yml now mounts ./docs, AGENTS.md, and
CHANGELOG.md read-only into the web container. This mirrors the
existing ./docker:/var/www/html/docker:ro pattern (added for
ProdApacheConfigTest so the dev container could read production
configs the runtime panel never touches). Without these mounts the
new gate would fail under ./sbpp.sh test locally even though CI
passes — CI's actions/checkout@v4 sees the full repo on the
runner. docker/README.md updated to describe the new mounts.

Test plan

  • ./sbpp.sh phpstan — OK (252 files, no errors)
  • ./sbpp.sh test --filter=DocsUpgradeLinkRegressionTest — OK (4 tests, 13 assertions)
  • ./sbpp.sh test — 1075 tests pass; 6 pre-existing errors in PluginVersionResolveTest (dev container doesn't bind-mount game/, same on main)
  • ./sbpp.sh ts-check — clean
  • ./sbpp.sh composer api-contract — no diff
  • Negative control: reintroduced the broken slug in the template and confirmed the test fails (2 of 4 assertions caught it — testTelemetryHelpLinkUsesCorrectUrlAndAnchor AND testNoPanelOrDocSourcesUseTheBrokenUpgradeSlug)

I have read the CLA Document and I hereby sign the CLA

…or (#1474)

The "See the full payload" link in the in-panel Anonymous telemetry
help paragraph (?p=admin&c=settings&section=features) was pointing at
`https://sbpp.github.io/updating/1.8-to-2.0/#telemetry`, which 404s.
Two things were wrong:

  1. Slug `1.8-to-2.0` — Astro derives slugs from filenames, and the
     docs file on disk is `docs/src/content/docs/updating/1-8-to-2-0.mdx`
     (dots become dashes). Deployed URL is `/updating/1-8-to-2-0/`.
  2. Anchor `#telemetry` — the heading in that file is
     `## Anonymous telemetry`, which Starlight auto-slugs to
     `#anonymous-telemetry`. `#telemetry` matches no heading.

Three sibling sites carried the same broken URL / matching source-file
path drift:

  - `web/themes/default/page_admin_settings_features.tpl` (the
    user-reported link)
  - `AGENTS.md` "Build / extend the anonymous opt-out daily telemetry
    payload" row pointed at the wrong source-file path
    (`docs/src/content/docs/updating/1.8-to-2.0.mdx`, which doesn't
    exist)
  - `CHANGELOG.md` 2.0.0 Privacy subsection carried the same broken URL

Regression guard
----------------

New `web/tests/integration/DocsUpgradeLinkRegressionTest.php` pins
four contracts:

  1. The canonical docs source file at `1-8-to-2-0.mdx` exists (a
     rename silently re-breaks every link).
  2. That file carries the `## Anonymous telemetry` heading (a
     rename silently 404s every deep-link to `#anonymous-telemetry`).
  3. No file under the documented scan roots (templates, page
     handlers, includes, scripts, API handlers, AGENTS.md,
     CHANGELOG.md) carries the literal `1.8-to-2.0` substring —
     catches both broken URLs AND broken source-file path refs in
     one sweep.
  4. The specific template line uses the full corrected URL — a
     half-fix that gets one half right still fails.

Pure file scanning, no DB/session/Smarty bring-up; same shape as
`DeadJsCallSitesTest` / `ButtonClassChainTest`.

Dev-stack symmetry
------------------

`docker-compose.yml` now mounts `./docs`, `AGENTS.md`, and
`CHANGELOG.md` read-only into the web container (mirrors the
existing `./docker:/var/www/html/docker:ro` pattern that lets
`ProdApacheConfigTest` read production configs from inside the dev
container). Without this, `./sbpp.sh test` would fail the new
gate locally even though CI passes (CI's `actions/checkout@v4`
sees the full repo on the runner). `docker/README.md` updated to
describe the new mounts.
@rumblefrog
rumblefrog force-pushed the fix/1474-telemetry-docs-link branch from c2468f6 to b6575b6 Compare May 27, 2026 21:26
@rumblefrog
rumblefrog added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit 5870271 May 27, 2026
7 checks passed
@rumblefrog
rumblefrog deleted the fix/1474-telemetry-docs-link branch May 27, 2026 21:27
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link in 'Anonymous telemetry' gives 404

1 participant