Defer generic retest guidance to maintainers

This commit is contained in:
pulse-triage[bot]
2026-08-28 16:25:05 +01:00
parent 7f0c548f0d
commit 1d15ab60a3
3 changed files with 56 additions and 4 deletions
+21 -3
View File
@@ -127,16 +127,27 @@ async function ensureLabel(github, context, name, color, description) {
}
}
async function hasRetestComment(github, context, issueNumber) {
const comments = await github.paginate(github.rest.issues.listComments, {
async function getIssueComments(github, context, issueNumber) {
return github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
per_page: 100,
});
}
function hasRetestComment(comments) {
return comments.some((comment) => (comment.body || "").includes(RETEST_COMMENT_MARKER));
}
function hasMaintainerResponse(comments) {
return comments.some((comment) =>
MAINTAINER_AUTHOR_ASSOCIATIONS.has(
String(comment.author_association || "").toUpperCase()
)
);
}
async function getLatestStableVersion(github, context, core) {
try {
const latest = await github.rest.repos.getLatestRelease({
@@ -324,10 +335,17 @@ async function postRetestCommentForIssue({
core.info("Issue is already on the latest stable core or newer. Skipping public retest guidance.");
return false;
}
if (await hasRetestComment(github, context, issue.number)) {
const comments = await getIssueComments(github, context, issue.number);
if (hasRetestComment(comments)) {
core.info("Retest guidance comment already exists.");
return false;
}
if (hasMaintainerResponse(comments)) {
core.info(
"A maintainer has already responded. Skipping generic retest guidance."
);
return false;
}
await github.rest.issues.createComment({
owner: context.repo.owner,