Skip to content

fix(cli): fix false "page was moved" warnings for versioned docs pages#16036

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1779345264-fix-missing-redirects-versioned-pages
Open

fix(cli): fix false "page was moved" warnings for versioned docs pages#16036
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1779345264-fix-missing-redirects-versioned-pages

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Description

Fixes false "page was moved" warnings in fern check and fern docs dev when the same .mdx file is intentionally referenced across multiple doc versions.

Changes Made

  • buildPageIdToSlugMap: Changed return type from Map<string, string> to Map<string, Set<string>> so that all slugs are tracked per pageId (instead of the last one overwriting earlier entries)
  • findRemovedSlugs: Updated to accept the new multi-slug map type. The activeSlugs set now correctly contains all slugs from all navigation entries, preventing false positives when the same file appears under multiple version slugs
  • Tests: Updated all existing tests for the new type and added two new test cases covering the versioned-page scenario (single and multi-version)
  • Changelog: Added unreleased changelog entry

Root Cause

buildPageIdToSlugMap returned Map<string, string>, so when the same file appeared in multiple version navigation entries (e.g., safety-notices.mdx under both v2-2-77 and v2-3-2), only the last slug survived. findRemovedSlugs then saw the published slug didn't match the single local slug and wasn't in activeSlugs, incorrectly flagging it as "moved".

Testing

  • Unit tests added/updated (34 tests all passing, including 2 new versioned-page tests)
  • Lint/format checks pass (biome, format)

Link to Devin session: https://app.devin.ai/sessions/9be668fc08984ce4ad8967a0bcde10d9

Co-Authored-By: will.kendall@buildwithfern.com <wpk235@gmail.com>
@devin-ai-integration devin-ai-integration Bot requested a review from amckinney as a code owner May 21, 2026 06:35
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants