feat: surface reproducibility in review summaries
This commit is contained in:
parent
72b2396576
commit
fb7b809e1e
@ -42,7 +42,8 @@ The body should include the strongest actionable, non-overlapping sections the
|
||||
report has:
|
||||
|
||||
- `**Summary**` from the typed `changeSummary` field, not from the
|
||||
merge verdict or maintainer follow-up summary
|
||||
merge verdict or maintainer follow-up summary; when `reproductionAssessment`
|
||||
is present, this section also includes a compact `Reproducibility:` line
|
||||
- `**Next step before merge**` for PRs, or `**Next step**` for issues, from the
|
||||
work-candidate reason or next action
|
||||
- `**Security**` from the typed `securityReview` field, so supply-chain,
|
||||
|
||||
@ -4155,6 +4155,22 @@ function appendPublicSection(lines: string[], heading: string, body: string): vo
|
||||
lines.push(`**${heading}**`, body, "");
|
||||
}
|
||||
|
||||
function publicReproducibilityLine(reproductionAssessment: string): string {
|
||||
const assessmentLine = sentence(reproductionAssessment);
|
||||
if (!assessmentLine) return "";
|
||||
const match = assessmentLine.match(/^(yes|no|unclear|not applicable)\b/i);
|
||||
if (!match) return `Reproducibility: ${assessmentLine}`;
|
||||
const status = match[1]?.toLowerCase() ?? "";
|
||||
const detail = sentence(assessmentLine.slice(match[0].length).replace(/^[\s,.:;-]+/, ""));
|
||||
return `Reproducibility: ${status}.${detail ? ` ${detail}` : ""}`;
|
||||
}
|
||||
|
||||
function publicSummaryBody(summaryLine: string, reproductionAssessment: string): string {
|
||||
return [summaryLine, publicReproducibilityLine(reproductionAssessment)]
|
||||
.filter(Boolean)
|
||||
.join("\n\n");
|
||||
}
|
||||
|
||||
function appendReviewQuestionDetails(
|
||||
details: string[],
|
||||
reproductionAssessment: string | undefined,
|
||||
@ -4214,9 +4230,13 @@ function renderKeepOpenCommentFromReport(markdown: string): string {
|
||||
"",
|
||||
];
|
||||
if (isPullRequest) {
|
||||
appendPublicSection(lines, "Summary", changeSummaryLine);
|
||||
appendPublicSection(
|
||||
lines,
|
||||
"Summary",
|
||||
publicSummaryBody(changeSummaryLine, reproductionAssessment),
|
||||
);
|
||||
} else {
|
||||
appendPublicSection(lines, "Summary", summaryLine);
|
||||
appendPublicSection(lines, "Summary", publicSummaryBody(summaryLine, reproductionAssessment));
|
||||
}
|
||||
appendPublicSection(lines, isPullRequest ? "Next step before merge" : "Next step", nextStepLine);
|
||||
appendPublicSection(lines, "Security", publicSecurityReviewLine(securityReview));
|
||||
|
||||
@ -1202,6 +1202,50 @@ Reason: Maintainers should review the tests after the targeted lane is green.
|
||||
assert.match(comment, /<!-- clawsweeper-verdict:needs-human item=74265 sha=abc123def456/);
|
||||
});
|
||||
|
||||
test("issue keep-open review comments surface reproducibility in the summary", () => {
|
||||
const comment = renderReviewCommentFromReport(
|
||||
`${reportFrontMatter({
|
||||
type: "issue",
|
||||
number: "75877",
|
||||
decision: "keep_open",
|
||||
close_reason: "none",
|
||||
work_candidate: "queue_fix_pr",
|
||||
})}
|
||||
|
||||
## Summary
|
||||
|
||||
Keep open. Slack typing callbacks are disabled in message-tool-only group replies.
|
||||
|
||||
## Reproduction Assessment
|
||||
|
||||
Yes. A source-level reproduction is clear: set a Slack group turn to message-tool-only and inspect the dispatch typing callbacks.
|
||||
|
||||
## Work Candidate
|
||||
|
||||
Candidate: queue_fix_pr
|
||||
|
||||
Confidence: high
|
||||
|
||||
Priority: medium
|
||||
|
||||
Status: queued
|
||||
|
||||
Reason: The bug is narrow and source-reproducible.
|
||||
`,
|
||||
"none",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
comment,
|
||||
/\*\*Summary\*\*\nKeep open\. Slack typing callbacks are disabled in message-tool-only group replies\.\n\nReproducibility: yes\. A source-level reproduction is clear/,
|
||||
);
|
||||
assert.ok(comment.indexOf("Reproducibility: yes.") < comment.indexOf("**Next step**"));
|
||||
assert.match(
|
||||
comment,
|
||||
/Do we have a high-confidence way to reproduce the issue\?\n\nYes\. A source-level reproduction is clear/,
|
||||
);
|
||||
});
|
||||
|
||||
test("pull request review comments include dedicated security review", () => {
|
||||
const comment = renderReviewCommentFromReport(
|
||||
`${reportFrontMatter({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user