Repository navigation
[trymerge] Revive test_merge_ghstack_into, delete dead test_gql_retrieve_checksuites - #203140
izaitsevfb wants to merge 7 commits into
Conversation
…eve_checksuites ✴️ iz2: Both tests have been `@skip`-ped for over a year, so they cover nothing. `test_merge_ghstack_into` is revived. It is the only test of how `merge_ghstack_into` lands a ghstack: merged PRs are skipped but listed as dependencies, open PRs are cherry-picked bottom-up with amended messages, and only the open PRs are returned. It broke because the stack in its fixtures has since merged, so all four PRs read as closed and nothing was cherry-picked. The test now mocks `is_closed` to the state it describes, and mocks `find_matching_merge_rule`, whose real check needs check-run pages the fixtures lack (the three tests after it cover that gate). Expected messages match the fixtures' current text. Eight mutations of `merge_ghstack_into` each make it fail. `test_gql_retrieve_checksuites` is deleted. GitHub no longer returns check suites for its PR (the fixture has none), and the bug it was added for in #95333 is still caught: reverting that fix makes `test_get_classifications_similar_failures` and `test_get_classifications_wrong_workflow_name` fail. Meta's internal CI runs this file too and has had both tests stuck as disabled since the target briefly failed to import in October: a test that only skips never passes enough to be re-enabled. Test plan: `python -m unittest test_trymerge.TestGitHubPRGhstackDependencies` passes; internal `trymerge_test` (fbcode and xplat) goes from 275 pass, 2 skip to 276 pass, 0 skip.
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (1): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/203140
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 9e47ae9 with merge base b2f99f7 ( 🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:
reason: BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…ory_checks values
|
✴️ iz2: Replied in-thread to the latest blocking finding (the waivers test pins what |
…hstack-test # Conflicts: # .github/scripts/test_trymerge.py
#203691 routes merge_ghstack_into's lower-PR gate through check_stacked_pr_merge_rule, which unpacks the rule check's 4-tuple, forwards classification_wait and reads the lower PR's checks unless skip_mandatory_checks. Return a 4-tuple from the mocked rule check, pin classification_wait=None in both full-call assertions, and stub get_checkrun_conclusions in test_merge_ghstack_into as main's sibling test does.
There was a problem hiding this comment.
Automated review of 9e47ae9: nothing blocking; ready for human review.
The PR brings back the skipped test_merge_ghstack_into, mocks the lower PR's check runs, pins classification_wait=None, and deletes the skipped test_gql_retrieve_checksuites. Recommendation: Approve. Only a non-blocking wording point on the new comment remains.
⚪ 1 non-blocking finding
pytorch/.github/scripts/test_trymerge.py
Line 1546 in 9e47ae9
Non-blocking: the new comment says "the tests below cover how their errors and waivers are handled". The tests below it in this class do cover merge-rule errors, waiver forwarding and a failing job. They do not cover the startup-failure branch, which is the only branch that reads the get_checkrun_conclusions mocked here. Its test is test_a_startup_failure_refuses_even_when_dr_ci_excuses_it in TestStackedPrChecks (around line 4232). They also do not cover the pending-job branch, whose test is test_a_pending_ciflow_job_waits (around line 4225) in the same class. Consider pointing the comment at TestStackedPrChecks for those two cases.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
Withdrawn: the automated review of 9e47ae9 found nothing blocking.
Withdrawn: the automated review of 9e47ae9 found nothing blocking.
|
✴️ iz2: (AI-generated) Merging on Ivan's request. |
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 |
…p PR (#205625) ✴️ iz2: `merge_into` runs `check_stacked_pr_merge_rule` on each lower stacked PR, but no test checked that it forwards `skip_mandatory_checks` and `skip_internal_checks`. Hardcoding either to `False` in that loop left `test_trymerge.py` green. The `-i` waivers in the same call were already covered by `test_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 of `test_merge_ghstack_into_gates_lower_prs_with_the_waivers`: that test covers `merge_ghstack_into`'s own gate, which production skips (every caller passes `skip_all_rule_checks=True` since #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 to `False` in `merge_into`'s loop, with the two flags swapped, with the internal skip dropped only when both are set, or with `can_skip_internal_checks` called per lower PR. lintrunner (FLAKE8, PYFMT) clean. Pull Request resolved: #205625 Approved by: https://github.com/pytorchgreenlight, https://github.com/jeanschmidt
✴️ iz2: Both tests have been
@skip-ped for over a year, so they cover nothing.test_merge_ghstack_intois revived. It is the only test of howmerge_ghstack_intolands a ghstack: merged PRs are skipped but listed as dependencies, each open PR is cherry-picked and then its message amended, bottom-up, and only the open PRs are returned. It broke because the stack in its fixtures has since merged, so all four PRs read as closed and nothing was cherry-picked. The test now mocksis_closedto the state it describes, and mocksfind_matching_merge_ruleand the lower PR's check runs (the real ones need check-run pages the fixtures lack) while asserting the arguments the lower PR is checked with; the waivers test now asserts its whole rule-check call. Expected messages match the fixtures' current text. Sixteen mutations ofmerge_ghstack_intoeach make the ghstack tests fail.test_gql_retrieve_checksuitesis deleted. GitHub no longer returns check suites for its PR (the fixture has none), and the bug it was added for in #95333 is still caught: reverting that fix makestest_get_classifications_similar_failuresandtest_get_classifications_wrong_workflow_namefail.Meta's internal CI runs this file too and has had both tests stuck as disabled since the target briefly failed to import in October: a test that only skips never passes enough to be re-enabled.
Test plan:
python -m unittest test_trymergepasses (277 tests); internaltrymerge_test(fbcode and xplat) goes from 275 pass, 2 skip to 276 pass, 0 skip.