test: allow hidden pages in SDK documentation links (#4869)

The SDK documentation-link test fails on `DocLink::BranchDiff` after the
branching page is hidden from navigation. [Mintlify serves hidden MDX
pages by their URL](https://www.mintlify.com/docs/guides/hidden-pages),
so navigation membership is not a route-validity requirement. Remove
that assertion while retaining the file, `.mintignore`, redirect-target,
and anchor checks.

Validated on the development EC2 with `cargo test --profile ci
--features remote --locked --lib
docs::tests::test_all_doc_links_resolve_in_repo_docs -- --exact
--nocapture`: the unchanged base fails on `tables/branching`; this fix
passes. The identical patch also passes against the exact #4867 head,
checking all 14 `DocLink::ALL` entries. Formatting passes. This repairs
the shared docs-test blocker for #4867; its separate `cargo deny`
dependency finding is unchanged.
This commit is contained in:
Xuanwo
2026-11-05 18:52:40 +08:00
committed by GitHub
parent fa4b14a9d6
commit e2a859f6a3
+2 -6
View File
@@ -519,6 +519,8 @@ mod tests {
"DocLink::{link:?} points to a .mintignore'd page: {rel_page}"
);
// Mintlify serves MDX pages even when they are intentionally omitted
// from navigation, so docs.json membership is not required.
let mdx_path = if docs_web.join(&direct_mdx).is_file() {
docs_web.join(&direct_mdx)
} else if docs_web.join(&index_mdx).is_file() {
@@ -527,12 +529,6 @@ mod tests {
panic!("DocLink::{link:?} target page does not exist under docs/web: {rel_page}");
};
assert!(
docs_json.contains(&format!("\"{rel_page}\""))
|| docs_json.contains(&format!("\"{rel_page}/index\"")),
"DocLink::{link:?} target page is not routed in docs/web/docs.json: {rel_page}"
);
if let Some(anchor) = link.anchor() {
let raw_mdx = std::fs::read_to_string(&mdx_path)
.unwrap_or_else(|e| panic!("failed to read {}: {e}", mdx_path.display()));