Azure / Azure/azure-rest-api-specs

[summarize-checks] Multiple NSTM comments race condition

Open
#36,683 2 comments 1 reaction 2 assignees Claimed by @mikeharder View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

https://github.com/Azure/azure-rest-api-specs/pull/36681

Image

Looks like a race condition, where two instances of summarize-checks ran at exactly the same time, saw no existing comment, and added a new one.

https://github.com/Azure/azure-rest-api-specs/actions/runs/16980229351/job/48138479097#step:4:35

https://github.com/Azure/azure-rest-api-specs/actions/runs/16980229254/job/48138478854#step:4:35

Potential fix:

```js
const existingComments = getExistingComments(prNumber);
if (existingComments.contains(NSTM)) {
editComment();
}
else {
addNewComment();

// new code
const afterComments = getExistingComments(prNumber);
if (afterComments.containsMultiple(NSTM)) {
deleteCommentWeAdded();
updateExistingComment();
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.