Skip to content

docs: ApiLink generates correct URL for versioned docs#1870

Merged
barjin merged 2 commits intomasterfrom
copilot/fix-apilink-versioned-urls
May 5, 2026
Merged

docs: ApiLink generates correct URL for versioned docs#1870
barjin merged 2 commits intomasterfrom
copilot/fix-apilink-versioned-urls

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

ApiLink always resolved to /api/<ClassName> regardless of the active Docusaurus version, causing broken-link CI failures for PRs that introduce new public classes (which only exist in the unreleased next API docs).

Changes

  • website/src/components/ApiLink.jsx
    • Replaced static /api/${to} link with version-aware routing using useDocsVersion (mirrors the approach in the JS Crawlee sister project)
    • Updated import from deprecated @docusaurus/theme-common/internal@docusaurus/plugin-content-docs/client (correct Docusaurus 3.x API)
    • Routing logic:
      • Versioning disabled or latest stable (version.isLast) → /api/${to}
      • current/unreleased version → /api/next/${to}
      • Older versions → /api/${version}/${to}

Issues

Testing

Verified routing logic covers all version states. No unit test infrastructure exists for the website components.

Checklist

  • CI passed

Copilot AI linked an issue May 5, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] fix: ApiLink generates correct URL for versioned docs fix: ApiLink generates correct URL for versioned docs May 5, 2026
Copilot finished work on behalf of barjin May 5, 2026 09:31
Copilot AI requested a review from barjin May 5, 2026 09:31
@barjin barjin changed the title fix: ApiLink generates correct URL for versioned docs docs: ApiLink generates correct URL for versioned docs May 5, 2026
@github-actions github-actions Bot added this to the 140th sprint - Tooling team milestone May 5, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label May 5, 2026
@barjin barjin marked this pull request as ready for review May 5, 2026 10:05
@barjin barjin requested a review from vdusek May 5, 2026 10:06
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.53%. Comparing base (6b91edc) to head (89d30b7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1870   +/-   ##
=======================================
  Coverage   92.53%   92.53%           
=======================================
  Files         158      158           
  Lines       11078    11078           
=======================================
  Hits        10251    10251           
  Misses        827      827           
Flag Coverage Δ
unit 92.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, and do it also for SDK and client please

@barjin barjin merged commit 65e5d18 into master May 5, 2026
32 checks passed
@barjin barjin deleted the copilot/fix-apilink-versioned-urls branch May 5, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ApiLink generates incorrect URL for versioned docs

4 participants