Repository navigation
[AMORO-4447][CI] Prevent multiple assignees from take comments - #4448
sivakumar-mahalingam wants to merge 2 commits into
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 |
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