mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 08:10:26 +00:00
Defer generic retest guidance to maintainers
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user