Skip to content

[CI] Abort builds/tests for 10+ deep ghstacks - #185290

Closed
malfet wants to merge 3 commits into
gh/malfet/919/basefrom
gh/malfet/919/head
Closed

malfet wants to merge 3 commits into
gh/malfet/919/basefrom
gh/malfet/919/head

Conversation

@malfet

@malfet malfet commented May 26, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing filter_test_configs.py by parsing ghstack breadcrumb PR description and abort filter_test_configs if there are more than 10 PRs underneath current one

Test Plan: python -m unittest test_filter_test_configs

[ghstack-poisoned]
@malfet
malfet requested a review from a team as a code owner May 26, 2026 22:37
@pytorch-bot

pytorch-bot Bot commented May 26, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/185290

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 47b4031 with merge base 536474e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
malfet added a commit that referenced this pull request May 26, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumbs from PR body and emit empty test matrix for PRs deeper than 10

Test Plan: python -m unittest test_filter_test_configs


ghstack-source-id: b894f5e
Pull-Request: #185290
@malfet
malfet requested a review from albanD May 26, 2026 22:38
Comment thread .github/scripts/filter_test_configs.py Resolved
@huydhn

huydhn commented May 26, 2026

Copy link
Copy Markdown
Contributor

A small caveat to call out that filter-test-config doesn't touch binaries workflows, so this mechanism won't apply there.

Comment thread .github/scripts/filter_test_configs.py Resolved
[ghstack-poisoned]
malfet added a commit that referenced this pull request May 26, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumbs from PR body and emit empty test matrix for PRs deeper than 10

Test Plan: python -m unittest test_filter_test_configs

ghstack-source-id: 6f212f2
Pull-Request: #185290

@huydhn huydhn 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.

LGTM!

@malfet malfet changed the title [CI] Skip tests for PRs sitting on top of a deep ghstack [CI] Abort builds/tests for 10+ deep ghstacks May 27, 2026
@malfet

malfet commented May 27, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge -f "Lint is green, let's see how bad it'll get"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit to khushi-411/pytorch that referenced this pull request May 27, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumb PR description and abort filter_test_configs if there are more than 10 PRs underneath current one

Test Plan: python -m unittest test_filter_test_configs
Pull Request resolved: pytorch#185290
Approved by: https://github.com/huydhn
tinglvv pushed a commit that referenced this pull request May 28, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumb PR description and abort filter_test_configs if there are more than 10 PRs underneath current one

Test Plan: python -m unittest test_filter_test_configs
Pull Request resolved: #185290
Approved by: https://github.com/huydhn
khushi-411 pushed a commit to khushi-411/pytorch that referenced this pull request Jun 1, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumb PR description and abort filter_test_configs if there are more than 10 PRs underneath current one

Test Plan: python -m unittest test_filter_test_configs
Pull Request resolved: pytorch#185290
Approved by: https://github.com/huydhn
@github-actions
github-actions Bot deleted the gh/malfet/919/head branch June 26, 2026 02:29
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumb PR description and abort filter_test_configs if there are more than 10 PRs underneath current one

Test Plan: python -m unittest test_filter_test_configs
Pull Request resolved: pytorch#185290
Approved by: https://github.com/huydhn
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
PRs at the top of a deep ghstack will likely needs to be retested once everything underneath lands, so running full CI on each push wastes resources.
Reuse existing `filter_test_configs.py` by parsing ghstack breadcrumb PR description and abort filter_test_configs if there are more than 10 PRs underneath current one

Test Plan: python -m unittest test_filter_test_configs
Pull Request resolved: pytorch#185290
Approved by: https://github.com/huydhn
pytorchmergebot pushed a commit that referenced this pull request Nov 4, 2026
## Summary (human written only)

Propose that agent keeps its stack size under 10 and highlight the tradeoff of having a large stack

## Agent details (if applicable)

> **CONTRIBUTING.md** gets a short "Keep PR stacks small" section: stacks of PRs must have fewer than 10 PRs, because every PR in a stack runs CI on each push; land the bottom first and use `[no-ci]` on PRs that don't need CI yet. For ghstack stacks, the automated review requests changes from the 10th PR up, and CI fails with 10 or more PRs below unless the PR has `ciflow/trunk` (#185290). `CLAUDE.md` (`AGENTS.md`) links to it from the ghstack rules.
>
> **Hardened PR review** enforces it in `scripts/pr_review/extract_verdict.py`, deterministically rather than by the model. It reads the ghstack list from the PR body in `/tmp/pr-comments.json` (already written by the job; `hardened-pr-review-run.yml` passes `--pr-comments-file`), counting only the entries directly below the PR's `__->__` line. From the 10th PR up, the verdict becomes `changes_requested`, with a fixed sentence at the start of the summary and as one `major` finding. Two guards keep the output valid: a model objection without a major finding has its findings promoted to major so they stay blocking, and a diff with no line to anchor the finding on is left unchanged. Failed reviews and unreadable PR bodies are also left unchanged.
>
> Testing: 20 new tests (19 in `test_extract_verdict.py`, 1 workflow contract test pinning the flag); `python3 -m unittest discover -s scripts/pr_review -t .` shows the same 6 pre-existing macOS-only failures (`sha256sum`, BSD `realpath`) with and without this change.
>
> Drafted with Claude Code.

Pull Request resolved: #202800
Approved by: https://github.com/jeanschmidt, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
## Summary (human written only)

Propose that agent keeps its stack size under 10 and highlight the tradeoff of having a large stack

## Agent details (if applicable)

> **CONTRIBUTING.md** gets a short "Keep PR stacks small" section: stacks of PRs must have fewer than 10 PRs, because every PR in a stack runs CI on each push; land the bottom first and use `[no-ci]` on PRs that don't need CI yet. For ghstack stacks, the automated review requests changes from the 10th PR up, and CI fails with 10 or more PRs below unless the PR has `ciflow/trunk` (pytorch#185290). `CLAUDE.md` (`AGENTS.md`) links to it from the ghstack rules.
>
> **Hardened PR review** enforces it in `scripts/pr_review/extract_verdict.py`, deterministically rather than by the model. It reads the ghstack list from the PR body in `/tmp/pr-comments.json` (already written by the job; `hardened-pr-review-run.yml` passes `--pr-comments-file`), counting only the entries directly below the PR's `__->__` line. From the 10th PR up, the verdict becomes `changes_requested`, with a fixed sentence at the start of the summary and as one `major` finding. Two guards keep the output valid: a model objection without a major finding has its findings promoted to major so they stay blocking, and a diff with no line to anchor the finding on is left unchanged. Failed reviews and unreadable PR bodies are also left unchanged.
>
> Testing: 20 new tests (19 in `test_extract_verdict.py`, 1 workflow contract test pinning the flag); `python3 -m unittest discover -s scripts/pr_review -t .` shows the same 6 pre-existing macOS-only failures (`sha256sum`, BSD `realpath`) with and without this change.
>
> Drafted with Claude Code.

Pull Request resolved: pytorch#202800
Approved by: https://github.com/jeanschmidt, https://github.com/albanD
Microve pushed a commit to Microve/pytorch that referenced this pull request Nov 5, 2026
…" (pytorch#203699)

This reverts commit 862c6c4.

Reverted pytorch#185290 on behalf of https://github.com/jeanschmidt due to we have better tools to handle deep ghstacks that we are landing, so this change is not necessary anymore. Reverting with `@pytorchbot revert` was not possible anymore, as later changes to the same files make the revert conflict, so this revert was made locally.

Test Plan:

```
cd .github/scripts && python3 test_filter_test_configs.py
```

This revert was prepared with an AI assistant (Claude Code).

Please open this PR as a draft and mark it ready for review once the description and code are ready to be looked at.

Before submitting, please review:
- [PR lifecycle](https://github.com/pytorch/pytorch/blob/main/CONTRIBUTING.md#pr-lifecycle) in the contributing guide
- [AI-Assisted Development](https://github.com/pytorch/pytorch/blob/main/AI_POLICY.md) policy

Go through the following checklist
- [ ] Passes lint (`spin fixlint`)
- [ ] Added/updated tests
- [ ] Updated documentation (if applicable)
- [ ] Included benchmark results (for PRs impacting perf)

---
<!-- Delete this line and everything above it once you've gone through the checklist. -->

## Linked issue or supporting maintainer

<!-- Keep the one line that applies and delete the others. Link an issue labeled "actionable", or name the maintainer who agreed to this change beforehand. PRs with neither will be automatically closed, unless the author has write access to the repo. -->

Fixes #<!-- Issue number -->
Part of #<!-- Issue number -->
Supported by @<!-- Handle of the maintainer who agreed to this PR -->

## BC-breaking?

<!-- If this change breaks backward compatibility, describe the impact and migration path. Otherwise, write "No". -->

## Summary (human written only)

<!-- Point to the issue for relevant design discussion. If not discussed there (rare), add up to one paragraph. Overly verbose descriptions will be considered spam. -->

## Agent details (if applicable)

<!-- You can add here the details from your agent related to this PR. -->

Pull Request resolved: pytorch#203699
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
## Summary (human written only)

Propose that agent keeps its stack size under 10 and highlight the tradeoff of having a large stack

## Agent details (if applicable)

> **CONTRIBUTING.md** gets a short "Keep PR stacks small" section: stacks of PRs must have fewer than 10 PRs, because every PR in a stack runs CI on each push; land the bottom first and use `[no-ci]` on PRs that don't need CI yet. For ghstack stacks, the automated review requests changes from the 10th PR up, and CI fails with 10 or more PRs below unless the PR has `ciflow/trunk` (pytorch#185290). `CLAUDE.md` (`AGENTS.md`) links to it from the ghstack rules.
>
> **Hardened PR review** enforces it in `scripts/pr_review/extract_verdict.py`, deterministically rather than by the model. It reads the ghstack list from the PR body in `/tmp/pr-comments.json` (already written by the job; `hardened-pr-review-run.yml` passes `--pr-comments-file`), counting only the entries directly below the PR's `__->__` line. From the 10th PR up, the verdict becomes `changes_requested`, with a fixed sentence at the start of the summary and as one `major` finding. Two guards keep the output valid: a model objection without a major finding has its findings promoted to major so they stay blocking, and a diff with no line to anchor the finding on is left unchanged. Failed reviews and unreadable PR bodies are also left unchanged.
>
> Testing: 20 new tests (19 in `test_extract_verdict.py`, 1 workflow contract test pinning the flag); `python3 -m unittest discover -s scripts/pr_review -t .` shows the same 6 pre-existing macOS-only failures (`sha256sum`, BSD `realpath`) with and without this change.
>
> Drafted with Claude Code.

Pull Request resolved: pytorch#202800
Approved by: https://github.com/jeanschmidt, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
…" (pytorch#203699)

This reverts commit 862c6c4.

Reverted pytorch#185290 on behalf of https://github.com/jeanschmidt due to we have better tools to handle deep ghstacks that we are landing, so this change is not necessary anymore. Reverting with `@pytorchbot revert` was not possible anymore, as later changes to the same files make the revert conflict, so this revert was made locally.

Test Plan:

```
cd .github/scripts && python3 test_filter_test_configs.py
```

This revert was prepared with an AI assistant (Claude Code).

Please open this PR as a draft and mark it ready for review once the description and code are ready to be looked at.

Before submitting, please review:
- [PR lifecycle](https://github.com/pytorch/pytorch/blob/main/CONTRIBUTING.md#pr-lifecycle) in the contributing guide
- [AI-Assisted Development](https://github.com/pytorch/pytorch/blob/main/AI_POLICY.md) policy

Go through the following checklist
- [ ] Passes lint (`spin fixlint`)
- [ ] Added/updated tests
- [ ] Updated documentation (if applicable)
- [ ] Included benchmark results (for PRs impacting perf)

---
<!-- Delete this line and everything above it once you've gone through the checklist. -->

## Linked issue or supporting maintainer

<!-- Keep the one line that applies and delete the others. Link an issue labeled "actionable", or name the maintainer who agreed to this change beforehand. PRs with neither will be automatically closed, unless the author has write access to the repo. -->

Fixes #<!-- Issue number -->
Part of #<!-- Issue number -->
Supported by @<!-- Handle of the maintainer who agreed to this PR -->

## BC-breaking?

<!-- If this change breaks backward compatibility, describe the impact and migration path. Otherwise, write "No". -->

## Summary (human written only)

<!-- Point to the issue for relevant design discussion. If not discussed there (rare), add up to one paragraph. Overly verbose descriptions will be considered spam. -->

## Agent details (if applicable)

<!-- You can add here the details from your agent related to this PR. -->

Pull Request resolved: pytorch#203699
Approved by: https://github.com/huydhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants