Catch deprecated API warnings from tutorial builds#3810
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3810
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4a1896e with merge base a793306 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
f5997b5 to
9c7d7db
Compare
|
Claude finished @svekars's task in 2m 49s —— View job PR Review: #3810 — Catch deprecated API warnings from tutorial buildsSummaryThis PR adds a deprecation warning detection system that parses Sphinx Gallery build logs for Code CorrectnessBug: Build log may not escape the Docker container (workers) — In
Structure & FormattingNo tests — This is a parseable, deterministic tool with clear input/output. Even a small unit test with a synthetic log snippet would help prevent regressions and validate the regex patterns. Consider adding Dual log-merge strategies — The build logs are merged in two different ways:
The S3 upload in Worker also generates report — Build Compatibility
Issue creation on PRs — The run: |
python3 -m tools.deprecation_checker.api_report \
--build-log _build/build.log \
-o _build/api_report.md \
${{ github.ref == 'refs/heads/main' && '--create-issue' || '' }}Permissions broadened at workflow level — Security
RecommendationRequest Changes The concept is good and the code is clean and well-structured. The main issues to address are:
| |
|
Hi @svekars! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
When tutorials use deprecated PyTorch APIs, Python fires
DeprecationWarningandFutureWarningat runtime — but these warnings are currently silently ignored during the Sphinx Gallery build. We do not notice them until a user tries to run a tutorial and hits a broken API.This PR attempts two capture those during the CI build, parses them, and automatically creates/updates a GitHub Issue listing the deprecated API usage by tutorial file.
Changes
tools/deprecation_checker/(new) — parses build log forDeprecationWarning/FutureWarning, generates Markdown report, optionally creates/updates a GitHub Issue.jenkins/build.sh— add a function to capture make docs output to _build/build.log via tee, generates report per worker, merges logs and files issue in manager. Guarded with || true..github/workflows/_build-tutorials-base.yml— added an entry to upload report as build artifactHow it works
Test Plan