Repository navigation
docs: fail the build on fetch and splice errors in conf.py - #4835
Conversation
requests.get had no status check, so an HTTP error page was written into the downloaded file and the build went on. Add a timeout and raise_for_status. The two asserts that guard the splice do not run under python -O. Replace them with RuntimeError messages that name the missing heading. Signed-off-by: Vitor Bandeira <vvbandeira@precisioninno.com>
If OpenROAD renames '## Creating a branch', str.replace changes nothing. The ORFS forking section then drops out of the GitGuide, and the build passes. Raise RuntimeError when the heading is missing. Also correct two error messages. The Supported Operating Systems pattern fails only when a heading is missing or out of order. The '### Setup' heading lives in docs/index.md, not in the generated index2.md copy. Signed-off-by: Vitor Bandeira <vvbandeira@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request improves error handling in docs/conf.py by adding a timeout and status check to network requests, and by replacing assert statements with explicit RuntimeError exceptions to ensure clearer, more informative failures when expected documentation headings or patterns are missing. I have no feedback to provide.
2272e78
into
The-OpenROAD-Project:master
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
docs/conf.pydownloads three files from OpenROAD master when the docs build starts.requests.gethad no status check and no timeout.On an HTTP error, the build wrote the error page into the docs file and continued.
With no timeout, a stalled connection could block the build.
This change adds a 60 s timeout and
raise_for_status(), so a failed download stops the build with an HTTP error.setup()also splices OpenROAD text into three places, and each splice depends on a heading.Two splices used
assert, which does not run underpython -O.The GitGuide splice had no check, so a renamed upstream heading removed the ORFS forking section and the build still passed.
All three splices now raise
RuntimeErrorwith the file and the missing heading.Test: with stubbed downloads,
setup()splices the good input and raisesRuntimeErrorfor each missing heading, with and withoutpython -O.