Skip to content

Fix warning level for links to excluded pages#4119

Open
Sean-Kenneth-Doherty wants to merge 1 commit into
mkdocs:masterfrom
Sean-Kenneth-Doherty:fix/included-excluded-link-level
Open

Fix warning level for links to excluded pages#4119
Sean-Kenneth-Doherty wants to merge 1 commit into
mkdocs:masterfrom
Sean-Kenneth-Doherty:fix/included-excluded-link-level

Conversation

@Sean-Kenneth-Doherty

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty commented May 17, 2026

Copy link
Copy Markdown

Fixes #3900.

Summary

  • Stop capping the warning level at INFO when an included page links to an excluded/draft page.
  • Keep excluded-source pages quiet by leaving their excluded-target warnings at DEBUG.
  • Update build expectations and add a focused page rendering regression test for the included-page case.
  • Dedent the multiline draft_docs fixture so the full matrix keeps matching the intended user guide example.

Tests

  • PYTHONPATH=/home/sean/Projects/_upstream/mkdocs-3900 /home/sean/Projects/_upstream/mkdocs/.venv/bin/python -m unittest mkdocs.tests.structure.page_tests.RelativePathExtensionTests
  • PYTHONPATH=/home/sean/Projects/_upstream/mkdocs-3900 /home/sean/Projects/_upstream/mkdocs/.venv/bin/python -m unittest mkdocs.tests.build_tests.BuildTests.test_draft_pages_with_invalid_links
  • PYTHONPATH=/home/sean/Projects/_upstream/mkdocs-3900 /home/sean/Projects/_upstream/mkdocs/.venv/bin/python -m unittest mkdocs.tests.structure.page_tests mkdocs.tests.build_tests.BuildTests.test_draft_pages_with_invalid_links
  • PYTHONPATH=/home/sean/Projects/_upstream/mkdocs-3900 /home/sean/Projects/_upstream/mkdocs/.venv/bin/python -m unittest discover -s mkdocs -p "*tests.py"
  • uvx --from hatch --with pip hatch run +py=3.10 test:test passed for test.py3.10-default and test.py3.10-min-req, 726 tests each.
  • /home/sean/Projects/_upstream/mkdocs/.venv/bin/black --check --diff mkdocs/structure/pages.py mkdocs/tests/structure/page_tests.py mkdocs/tests/build_tests.py
  • /home/sean/Projects/_upstream/mkdocs/.venv/bin/isort --check-only --diff mkdocs/structure/pages.py mkdocs/tests/structure/page_tests.py mkdocs/tests/build_tests.py
  • /home/sean/Projects/_upstream/mkdocs/.venv/bin/ruff check mkdocs/structure/pages.py mkdocs/tests/structure/page_tests.py mkdocs/tests/build_tests.py
  • git diff --check

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty force-pushed the fix/included-excluded-link-level branch from 92cbefa to cd69831 Compare May 17, 2026 02:29
@Sean-Kenneth-Doherty

Copy link
Copy Markdown
Author

I refreshed the branch after the matrix showed failures in the full build suite. The original CPython failures were from an indented multiline draft_docs fixture, which is now dedented; the refreshed CPython 3.10, 3.11, and 3.12 CI jobs are green.

The two remaining red jobs fail before MkDocs tests run, during python -m pip install --upgrade hatch on PyPy 3.9. Ubuntu fails building cryptography because current PyO3 requires PyPy 3.11 or newer, and Windows fails building zstandard because the runner PyPy lacks the distutils module CFFI expects. Those look like CI bootstrap/dependency issues rather than failures from this change.

@Sean-Kenneth-Doherty

Copy link
Copy Markdown
Author

The two failing PyPy 3.9 jobs here are from CI bootstrap dependency drift, not this excluded-link change. I opened #4121 as a separate CI-only fix to move the PyPy leg to 3.11; its full matrix is green, including all three PyPy 3.11 jobs.

@Sean-Kenneth-Doherty

Copy link
Copy Markdown
Author

CI note: I checked the two red PyPy 3.9 jobs. Both fail before the MkDocs tests start, during python -m pip install --upgrade hatch.

  • Ubuntu/PyPy 3.9: cryptography builds from source and fails in PyO3 with the configured PyPy interpreter version (3.9) is lower than PyO3's minimum supported version (3.11).
  • Windows/PyPy 3.9: zstandard builds from source and fails through CFFI with ModuleNotFoundError: No module named 'distutils.msvc9compiler' / This CFFI feature requires distutils.\n\nPyPy macOS and all CPython jobs passed, so I do not see evidence that this branch regressed MkDocs behavior; this looks like CI dependency/tooling drift in the PyPy 3.9 install step.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validation.links.not_found is always reported as INFO

1 participant