Skip to content
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

Will add/remove PR label thousands of times when using fail/pass in the same time #643

Closed
zhongjiajie opened this issue Jun 27, 2022 · 5 comments

Comments

@zhongjiajie
Copy link

Hi team, I have a question about my mergeable configuration.

In DolphinScheduler, we try to add dependent validate to test whether PR changes database DDL simultaneously, this test will add a comment and label when the validator can not fail, and remove the label once the validator passes again. You could see a more detailed configuration in https://github.com/apache/dolphinscheduler/pull/10638/files#diff-3fb64bc6b9fe11934106ee173470a523781e604cf938226f766e104e748e1a9f.

usually, it works fine, but sometime the bot will get mad and keep trying to remove and delete the label that which maintainer add to PR, and it will do that a thousand times. I try to fix it by changing the config in apache/dolphinscheduler#7099 but it seems that it does not work, so I finally remove all label or comment actions in apache/dolphinscheduler#10638

You could see the add/delete label behavior in PR comment apache/dolphinscheduler#10638 (comment)

@shine2lay
Copy link
Member

@zhongjiajie I believe this behavior is occurring because of you specified when: pull_request.* and when a label is added to an issue, we received pull_request.labeled event, and does the normal flow of validating and doing action based on result. This unfortunately also includes when mergeable bot modify a label. Currently the way mergeable is doing labeling is by fetching existing labels, calculate new set of labels it should be and call setLabels.

From your use case, I think if you remove pull_request.labled event, it should be okay

@shine2lay
Copy link
Member

Alternatively I think we should check if fetched set of label is the same as new set of label and only call setLabel if they are different

@zhongjiajie
Copy link
Author

Alternatively I think we should check if fetched set of label is the same as new set of label and only call setLabel if they are different

Yeah, I think do some check before set label is necessary

@zhongjiajie
Copy link
Author

zhongjiajie commented Jun 28, 2022

@zhongjiajie I believe this behavior is occurring because of you specified when: pull_request.* and when a label is added to an issue, we received pull_request.labeled event, and does the normal flow of validating and doing action based on result. This unfortunately also includes when mergeable bot modify a label. Currently the way mergeable is doing labeling is by fetching existing labels, calculate new set of labels it should be and call setLabels.

From your use case, I think if you remove pull_request.labled event, it should be okay

Thanks for your help ❤️ I will verify it, and will close it if we pass

@zhongjiajie
Copy link
Author

After I modify according to your advice, it work well and the bad behavior not occur anymore, thanks @shine2lay and I will close this issue

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

No branches or pull requests

2 participants