Issue validator bot comment goes stale when needs-info label is already present
Description
When an issue already carries triage/needs-info and the reporter edits it to fill some (but not all) required sections, the bot comment listing missing sections is never refreshed. The reporter sees stale guidance listing sections they have already filled in.
Steps to Reproduce / How to Trigger
- Open an issue from the bug template, leaving multiple required sections empty
- The bot applies
triage/needs-infoand posts a comment listing all missing sections - Edit the issue to fill in some (but not all) of the missing sections
- Observe: the bot comment still lists the sections that were just filled in
Expected Behavior
The bot comment should refresh on each edit to reflect only the sections that are still missing.
Actual Behavior
The comment is never updated. It continues showing the original list of missing sections.
Root Cause: In evaluateIssue(), when triage/needs-info is already present, addNeedsInfo returns false (label already there) and removeNeedsInfo returns false (still incomplete). The run() function only updates the comment inside the addNeedsInfo branch, so when the label is already present, neither the comment-update nor comment-delete branches execute.
Proposed Fix: Separate the comment-update logic from the label-add logic in run(). Update the existing bot comment whenever needsInfo is true, regardless of whether the label was just added or was already present.
Affected Files:
.github/scripts/validate-issue.js
Related PRs:
- #8377 (extract validator into JS module)
- #8378 (deterministic guards)
Logs / Screenshots
N/A — logic bug, no runtime error.
Environment
- Cadence server version: N/A (GitHub Actions workflow)
Source: cadence-workflow/cadence