Skip to content

[devX] make labels only count their own occurences - #98551

Closed
PaliC wants to merge 2 commits into
gh/PaliC/150/basefrom
gh/PaliC/150/head
Closed

PaliC wants to merge 2 commits into
gh/PaliC/150/basefrom
gh/PaliC/150/head

Conversation

@PaliC

@PaliC PaliC commented Apr 6, 2023 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Small QoL improvement such that add_numbered_label now works more intuitively. Now if we push different labels instead of having [reverted, mergedX2, revertX3, mergedX4, revertedX5, mergedX6] we have [reverted, merged, revertX2, mergedX2, revertedX3, mergedX3]

@PaliC
PaliC requested a review from a team as a code owner April 6, 2023 22:49
@pytorch-bot

pytorch-bot Bot commented Apr 6, 2023 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit 0ff3afa:
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Apr 6, 2023
Small QoL improvement such that add_numbered_label now works more intuitively. Now if we push different labels instead of having `[reverted, mergedX2, revertX3, mergedX4, revertedX5, mergedX6]` we have `[reverted, merged, revertX2, mergedX2, revertedX3, mergedX3]`


[ghstack-poisoned]
PaliC added a commit that referenced this pull request Apr 6, 2023
ghstack-source-id: e35ee7e
Pull Request resolved: #98551

@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! This is indeed easier to read

@PaliC

PaliC commented Apr 7, 2023

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 7, 2023
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@facebook-github-bot
facebook-github-bot deleted the gh/PaliC/150/head branch June 8, 2023 14:47
pytorchmergebot pushed a commit that referenced this pull request Nov 3, 2026
…2802)

✴️ iz2: `add_numbered_label("merged")` counted every label containing "merged", so a PR carrying the unrelated `mergedog` label landed as `mergedX1` instead of `Merged` (e.g. #202615, #202617; 90 PRs carry `mergedX1`). Anything that checks for `Merged` then reads these lands as closed unmerged. #98551 meant the numbering to count only the label's own repeats.

This change counts only labels equal to the base or fully matching `<base>X<n>`.

Matching stays case-sensitive on purpose. The repo labels are `Merged` and `Reverted`, which `"merged" in "Merged"` never matched, so re-merges have always kept plain `Merged` (no PR carries `Merged` + `mergedX1` without `mergedog`, and none carries `revertedX1`). This keeps that behaviour; only PRs with a substring-matching label change.

Test plan: new `TestAddNumberedLabel` cases (`mergedog`, `mergedX1foo`/`mergedx1`, `Merged`, own repeats) fail on the old condition and pass with the fix. `python -m unittest test_trymerge`: 216 run, all pass except two git end-to-end tests that fail identically on unmodified main in my environment (tmp-dir cleanup `OSError`).
Pull Request resolved: #202802
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
…orch#202802)

✴️ iz2: `add_numbered_label("merged")` counted every label containing "merged", so a PR carrying the unrelated `mergedog` label landed as `mergedX1` instead of `Merged` (e.g. pytorch#202615, pytorch#202617; 90 PRs carry `mergedX1`). Anything that checks for `Merged` then reads these lands as closed unmerged. pytorch#98551 meant the numbering to count only the label's own repeats.

This change counts only labels equal to the base or fully matching `<base>X<n>`.

Matching stays case-sensitive on purpose. The repo labels are `Merged` and `Reverted`, which `"merged" in "Merged"` never matched, so re-merges have always kept plain `Merged` (no PR carries `Merged` + `mergedX1` without `mergedog`, and none carries `revertedX1`). This keeps that behaviour; only PRs with a substring-matching label change.

Test plan: new `TestAddNumberedLabel` cases (`mergedog`, `mergedX1foo`/`mergedx1`, `Merged`, own repeats) fail on the old condition and pass with the fix. `python -m unittest test_trymerge`: 216 run, all pass except two git end-to-end tests that fail identically on unmodified main in my environment (tmp-dir cleanup `OSError`).
Pull Request resolved: pytorch#202802
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
…orch#202802)

✴️ iz2: `add_numbered_label("merged")` counted every label containing "merged", so a PR carrying the unrelated `mergedog` label landed as `mergedX1` instead of `Merged` (e.g. pytorch#202615, pytorch#202617; 90 PRs carry `mergedX1`). Anything that checks for `Merged` then reads these lands as closed unmerged. pytorch#98551 meant the numbering to count only the label's own repeats.

This change counts only labels equal to the base or fully matching `<base>X<n>`.

Matching stays case-sensitive on purpose. The repo labels are `Merged` and `Reverted`, which `"merged" in "Merged"` never matched, so re-merges have always kept plain `Merged` (no PR carries `Merged` + `mergedX1` without `mergedog`, and none carries `revertedX1`). This keeps that behaviour; only PRs with a substring-matching label change.

Test plan: new `TestAddNumberedLabel` cases (`mergedog`, `mergedX1foo`/`mergedx1`, `Merged`, own repeats) fail on the old condition and pass with the fix. `python -m unittest test_trymerge`: 216 run, all pass except two git end-to-end tests that fail identically on unmodified main in my environment (tmp-dir cleanup `OSError`).
Pull Request resolved: pytorch#202802
Approved by: https://github.com/huydhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants