Skip to content

Multiple backport attempts #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Mariatta opened this issue Oct 17, 2017 · 4 comments
Closed

Multiple backport attempts #35

Mariatta opened this issue Oct 17, 2017 · 4 comments
Assignees
Labels

Comments

@Mariatta
Copy link
Member

In python/cpython#4003, miss-islington made multiple backport attempts. It should only be done once.

@Mariatta Mariatta added the bug label Oct 17, 2017
@Mariatta
Copy link
Member Author

We received several PR "labeled" events from GitHub for adding the labels: type-bugfix, needs backport to 2.7, and needs backport to 3.6.

It shouldn't have tried to do the backport when type-bugfix label was added.

@pablogsal
Copy link
Member

pablogsal commented Oct 17, 2017

think the issue is in these lines:

  pr_labels = await gh.getitem(gh_issue['labels_url'])
        branches = [label['name'].split()[-1]
                    for label in pr_labels
                        if label['name'].startswith("needs backport to")]

The reason is that each time the webhook is triggered, we go to the issue and grab the labels, disregarding of the label that triggered the webhook is one of the ones we care about. If we label the PR very fast with 3 labels, the webhook will be fired 3 times and we will go the the issue three times, we will find three times that two of the labels in the issue should trigger a backport and therefore the backport will be triggered three times for each of the relevant labels.

I can make a PR trying to fix this if that's ok :)

@Mariatta
Copy link
Member Author

Yep, that is right. I have started working on the fix, and will have a PR later today. Thanks :)

@vstinner
Copy link
Member

In python/cpython#4003, miss-islington made multiple backport attempts. It should only be done once.

I tried to [Merge] this PR whereas @serhiy-storchaka already merged it while I tried to merge it. Then GitHub proposed me to [Try Again], I tried again, before seeing the small notification that the PR was already merged.

It can explain why the bot was called 3 times (x 2, since two backports were requested, total: 6 times) instead of only once (twice if we count both Python versions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants