Repository navigation
[AMORO-4447][CI] Prevent multiple assignees from take comments - #4448
Conversation
|
take |
|
@sivakumar-mahalingam Thanks for the improvement! Does this mean
And another question, could you please share some pic anywhere, so that we can confirm the behavior? if you need someone else to comment another |
|
Hi @klion26 thanks for reviewing this and for pointing out the unassignment case.
This pr raised, as this happened in #4268 |
| }) | ||
| const firstTakeComment = comments.find(comment => comment.body === 'take') | ||
|
|
||
| if (firstTakeComment?.id !== context.payload.comment.id) { |
There was a problem hiding this comment.
What will happen for the following case?
- Alice
takethe issue` - Alice was unassigned because some reason(maybe she doesn't have time for now)
- Now the issue has no assignees
- What would happen if Bob comment
takehappen?
Seems the take in step 4 would not assign the issue to Bob? We search the previous comment here, as the take comment left by Alice is still there
There was a problem hiding this comment.
Thanks, you are correct. With the previous implementation, Bob would not be assigned because Alice's old take comment would remain the first take comment in the issue history.
I have updated the workflow to use the issue timeline. The latest unassigned event now starts a new claim period, so the behavior is:
- Alice comments
takeand is assigned. - Alice is unassigned.
- Bob comments
take. - Bob is assigned because his comment is the first
takeafter the latest unassignment.
If multiple users comment take during the same unassigned period, the first comment wins. If the issue already has an assignee, later take comments have no effect.
#4447 defines the expected first-comment-wins behavior, and #4268 is the issue where multiple assignees exposed the original problem.
I also updated CONTRIBUTING.md and tested initial assignment, existing assignment, re-claiming after unassignment, and concurrent claims.
|
@sivakumar-mahalingam Thanks for the reply, I added a inline comment, please take a look at it. For the question in my last comment, just want to verify the change here is what we want, could you please give an issue link which shows that the change logic here is what we want. thanks |
klion26
left a comment
There was a problem hiding this comment.
@sivakumar-mahalingam Thanks for update, The change LGTM.
Currenty, there is still some little probability that the logic will go wrong when there are more then two users comment take on the same issue, but this is a rare case and fix it will add some more complexity. so let's go with the current solution.
For the concurrency of workflows we can ref to control-workflow-concurrency
Thanks @klion26 for the review and approval! Agreed, the remaining concurrency edge case is rare, and the current implementation addresses the original issue without introducing unnecessary complexity. Thanks also for pointing out GitHub Actions workflow concurrency controls. We can consider further improvements in a separate follow-up if needed. |
|
Hi @klion26, thanks again for reviewing and approving this PR. As this PR modifies the GitHub Actions workflow and requires a manual merge, could a maintainer please help merge it when convenient? @j1wonpark @zhoujinsong @xxubai @czy006 Thanks! |
|
@sivakumar-mahalingam Thanks again, merging! |
Why are the changes needed?
The issue-assignment workflow used the additive
addAssigneesAPI for everytakecomment. As a result, multiple users could be assigned when they commentedtakeon the same issue.The workflow should assign only the first user who claims an unassigned issue. Subsequent
takecomments must not change its assignees.Close #4447.
Brief change log
takecomments when the issue is already assigned.takecomment and assign only its author.CONTRIBUTING.mdto document the first-claim behavior.How was this patch tested?
actionlint .github/workflows/take.yml.git diff --check../mvnw validatesuccessfully for all 33 modules.Documentation