Skip to content

[doc-only] Harden Sphinx inventory rebasing - #3640

Open
rwgk wants to merge 2 commits into
mainfrom
rwgk/harden-sphinx-inventory-rebase
Open

rwgk wants to merge 2 commits into
mainfrom
rwgk/harden-sphinx-inventory-rebase

Conversation

@rwgk

@rwgk rwgk commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

— codex on behalf of Ralf —

Description

Follow up on Rob’s review of #3624.

  • Reject nonblank Sphinx inventory lines that the rebaser cannot parse. The build raises an error before writing the copied inventory. Inventory review comment
  • Set pythonpath = . in the root pytest.ini so the inventory test can use its normal import when launched with bare pytest. Import review comment

Validation

All 429 CI-tool tests passed with bare pytest from both the checkout root and /tmp. The malformed-entry regression failed against the previous copier and passed with the fix. Seven published inventories, including CUDA 12 and CUDA 13 bindings, produced byte-identical rebased output. Repository-wide pre-commit passed.

Checklist

  • I have read the Contributing Guidelines.
  • Tests cover malformed inventory entries and the pytest import.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI/CD CI/CD infrastructure label Nov 27, 2026
@rwgk rwgk added this to the CI milestone Nov 27, 2026 — with ChatGPT Codex Connector
@rwgk rwgk self-assigned this Nov 27, 2026
@rwgk rwgk added the documentation Improvements or additions to documentation label Nov 27, 2026 — with ChatGPT Codex Connector
@rwgk
rwgk marked this pull request as ready for review November 27, 2026 06:05
@rwgk rwgk mentioned this pull request Nov 27, 2026
3 tasks done
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Sphinx inventory rebasing now detects malformed entries and reports how many entries could not be processed. When any entries are invalid, the operation stops without creating a destination inventory, preventing incomplete output.
    • Added coverage for malformed inventory input and verification that no destination file is created when rebasing fails.

The inventory rebase function now checks that every nonempty entry matches the expected format. Tests cover valid rebased output and malformed entries. Pytest now includes the repository root in its import path.

Changes: Inventory rebase validation

Layer / File(s) Summary
Validate and test inventory rebasing
cuda_python/docs/copy_rebased_sphinx_inventory_one_level_up.py, ci/tools/tests/test_rebase_sphinx_inventory.py, pytest.ini
The function raises ValueError when an entry does not match the expected format. Tests check the rebased output, unchanged source, and absence of a destination file for malformed input. Pytest adds the repository root to its import path.

Change: Bug fix

Merge Risk: Minimal · up to 97f19

This change makes the Sphinx inventory rebase step fail with an error instead of silently writing a partial inventory when an entry is malformed. It also lets the inventory test import its helper with bare pytest. No merge-blocking risk is evident.

Security architecture risk: Minimal · up to 97f19

Malformed inventory entries now stop the documentation build before it writes the rebased inventory. The pytest change affects test imports only. Neither change introduces a design-level concern.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a30444c and 97f194a.

Files selected for processing: 3

  • ci/tools/tests/test_rebase_sphinx_inventory.py
  • cuda_python/docs/copy_rebased_sphinx_inventory_one_level_up.py
  • pytest.ini

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@rwgk

rwgk commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 97f194a

@github-actions

Copy link
Copy Markdown
Contributor

@rwgk
rwgk requested a review from rparolin November 27, 2026 06:40

@mdboom mdboom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems fine, if very unlikely to matter. I don't think Sphinx can change their inventory format without breaking a whole lot more folks than us.

This branch has not been deployed

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

Labels

CI/CD CI/CD infrastructure documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants