Skip to content

[BUG] Broken relative links across docs #2168

Description

@JasonTame

Describe the bug
The docs site has widespread broken internal links caused by incorrect relative path depth. Astro/Starlight renders each markdown file as a directory-style URL (e.g. enterprise/apm-policy.md serves at /apm/enterprise/apm-policy/), so relative links resolve one level deeper than the source file's filesystem directory. Many links were written with too few ../ segments.

Examples:

  • ./governance-guide/ on /apm/enterprise/apm-policy/ resolves to /apm/enterprise/apm-policy/governance-guide/ (404) — should be ../governance-guide/
  • ../reference/targets-matrix/ on /apm/integrations/ide-tool-integration/ resolves to /apm/integrations/reference/targets-matrix/ (404) — should be ../../reference/targets-matrix/

Scale
A link checker script against the source markdown found:

  • 462 broken relative links across 54 files (out of 890 relative links in 123 files)
  • Affects cross-section links (../reference/, ../enterprise/, ../consumer/, etc.) and same-section sibling links (./sibling-page/)

Root cause
Every .md file at section/page.md renders at /section/page/, adding an extra URL segment. ./sibling/ from there resolves as /section/page/sibling/ (wrong) instead of /section/sibling/ (correct). The same off-by-one applies to all deeper ../ chains.

Why the build doesn't catch it
The starlight-links-validator plugin is configured with errorOnRelativeLinks: false, which skips validation of relative links entirely. It only validates absolute internal links (starting with /).

To reproduce

  1. Visit https://microsoft.github.io/apm/enterprise/apm-policy/
  2. Click "Governance Guide" → 404
  3. Or visit https://microsoft.github.io/apm/integrations/ide-tool-integration/ → click "Targets matrix" → 404

Affected files (54 total)

Full file list with broken link counts
File Broken links
consumer/deploy-a-bundle.md 8
consumer/drift-and-secure-by-default.md 3
consumer/governance-on-the-consumer-ramp.md 1
consumer/update-and-refresh.mdx 4
enterprise/adoption-playbook.md 17
enterprise/apm-policy.md 13
enterprise/drift-detection.md 5
enterprise/enforce-in-ci.md 8
enterprise/github-rulesets.md 7
enterprise/governance-guide.md 22
enterprise/lifecycle-scripts.md 1
enterprise/making-the-case.md 16
enterprise/policy-pilot.md 6
enterprise/policy-reference.md 6
enterprise/registry-proxy.md 11
enterprise/security.md 17
getting-started/authentication.md 6
getting-started/first-package.md 2
getting-started/installation.md 1
getting-started/migration.md 3
guides/registries.md 18
integrations/ide-tool-integration.md 26
producer/author-primitives/hooks-and-commands.md 5
producer/author-primitives/instructions-and-agents.md 4
producer/author-primitives/mcp-as-primitive.md 12
producer/author-primitives/prompts.md 4
producer/author-primitives/skills.md 4
producer/compile.md 12
producer/pack-a-bundle.md 10
producer/package-relative-links.md 1
producer/preview-and-validate.md 6
producer/publish-to-a-marketplace.md 13
producer/releasing-from-any-ci.md 1
producer/repo-shapes.md 6
producer/versioning-strategies.md 1
reference/baseline-checks.md 9
reference/cli/approve.md 1
reference/cli/pack.md 1
reference/environment-variables.md 7
reference/examples.md 4
reference/experimental.md 5
reference/lockfile-spec.md 8
reference/manifest-schema.md 20
reference/package-types.md 3
reference/policy-schema.md 7
reference/primitive-types.md 1
reference/registry-http-api.md 1
reference/targets-matrix.md 13
troubleshooting/common-errors.md 21
troubleshooting/compile-zero-output-warning.md 9
troubleshooting/install-failures.md 8
troubleshooting/migration.md 10
troubleshooting/policy-debugging.md 11
troubleshooting/ssl-issues.md 4

Expected behavior
All internal doc links resolve to the correct pages.

Environment

  • OS: macOS
  • Python Version: 3.10.20
  • APM Version: 0.24.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docs-sitedocs/src/content (Starlight), README, doc generation.priority/highShips in current or next milestonestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.type/bugSomething does not work as documented.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions