-
Notifications
You must be signed in to change notification settings - Fork 733
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
Concurrency issues when adding labels to an issue/PR #1049
Comments
BTW, |
@gsmet However, just to be confusing you can also set the list of labels from this endpoint using the This is definitely a bug. The You can submit a PR to fix this. Tests will need to be added (looks like these methods are not currently tested). |
If someone fixes this issue, it would be great if they also look at doing #1050 at the same time, but it is not required. |
I started working on that one. https://github.com/hub4j/github-api/blob/master/CONTRIBUTING.md#running-tests-against-your-personal-github-user-account says I need access to the hub4j test org to record the requests/responses. Could you add me there? Thanks! |
@gsmet |
Thanks! I'll try to wrap up this work during the week-end! |
@bitwiseman if it's not too much work, could you release a new version with this fix? It's hitting us pretty bad. Thanks! |
@bitwiseman thanks a ton for the release! |
Hi,
Some context: we are using the Hub4j GitHub API for our Quarkus Bot (it's a GitHub App based on Quarkus and running as a GraalVM native executable).
The bot can automatically add labels based on triage rules but we started seeing concurrency issues when someone adds labels when the bot is also adding some. Believe it or not, this happened in real life.
AFAICS, the issue is that the
GHIssue#addLabels()
method doesn't really add the labels but set them. My understanding is that it should use this method: https://docs.github.com/en/rest/reference/issues#add-labels-to-an-issue and that's not what is done here:github-api/src/main/java/org/kohsuke/github/GHIssue.java
Lines 362 to 374 in 6d86cfb
The issue occurs when a label is added manually in the UI between the call at line 365 and the call at line 373: the labels added in the UI are lost, which is very unfortunate given they are critical to our workflow. You can see an example of this issue here: quarkusio/quarkus#15402 (comment) - Georgios added the
triage/backport?
label in the UI and the bot removed it while our bot is only adding labels.Does it make any sense? Any chance this could be fixed?
Thanks!
The text was updated successfully, but these errors were encountered: