Repository navigation
[trymerge] Test that lower stacked PRs skip the same checks as the top PR - #205625
izaitsevfb wants to merge 3 commits into
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ⚪ AUTOMATED REVIEW - Review did not complete:
reason: Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/205625
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a30b173 with merge base 10ae82b ( 🟢 GREEN LIGHT - PR approved to be merged without human review:
reason: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Swapping skip_mandatory_checks and skip_internal_checks in merge_into's lower-PR loop passed the old test, which set both True. Also assert the internal-skip answer comes from the top PR's merge comment.
There was a problem hiding this comment.
⏳ Automated review in progress for a30b173 (run); its result will replace this review.
Previous automated review of 8652186
Automated review of 8652186: nothing blocking; ready for human review.
The PR adds test_lower_prs_skip_the_same_checks_as_the_top_pr, which checks that merge_into passes the top PR's skip_mandatory_checks and skip_internal_checks through to the rule check on each lower stacked PR, and it rewords one docstring. Recommendation: Approve. Nothing blocks; the only remaining point is a non-blocking test gap.
⚪ 1 non-blocking finding
pytorch/.github/scripts/test_trymerge.py
Line 3984 in 8652186
Non-blocking: the rewrite dropped the case where both flags are True. The earlier version ran only (True, True); the new loop runs (True, False) and (False, True), and test_gates_lower_prs_before_landing covers (False, False). No test in the file now checks (True, True) on merge_into's lower-PR call (trymerge.py:1711-1720). A mutation like changing trymerge.py:1717 to skip_internal_checks=skip_internal_checks and not skip_mandatory_checks matches today's behaviour in the three tested combinations, differs only at (True, True), and the whole file still passes. test_merge_into_hands_the_guard_the_gate_it_just_ran sets both flags True but merges a single PR, so the lower-PR loop never runs; the end-to-end classes return False from can_skip_internal_checks and never pass skip_mandatory_checks. Production impact: in a forced merge whose comment also qualifies for the internal skip, the lower PRs would lose the internal skip. Fix: use ((True, False), (False, True), (True, True)).
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
|
✴️ iz2: (AI-generated) Merging on Ivan's behalf. |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
✴️ iz2:
merge_intorunscheck_stacked_pr_merge_ruleon each lower stacked PR, but no test checked that it forwardsskip_mandatory_checksandskip_internal_checks. Hardcoding either toFalsein that loop lefttest_trymerge.pygreen. The-iwaivers in the same call were already covered bytest_gates_lower_prs_before_landing.This adds
test_lower_prs_skip_the_same_checks_as_the_top_pr, which sets each flag alone and both together, and checks the internal-skip answer comes from the top PR's merge comment. It also rewords the docstring oftest_merge_ghstack_into_gates_lower_prs_with_the_waivers: that test coversmerge_ghstack_into's own gate, which production skips (every caller passesskip_all_rule_checks=Truesince #203462).Follow-up to #203140's review. Test-only.
Test plan:
python -m unittest test_trymerge: the new test passes; it fails with either flag hardcoded toFalseinmerge_into's loop, with the two flags swapped, with the internal skip dropped only when both are set, or withcan_skip_internal_checkscalled per lower PR. lintrunner (FLAKE8, PYFMT) clean.