Skip to content

Add Save suppressions checkbox to auto-fix workflow#40

Merged
edmofro merged 2 commits into
mainfrom
workhorse/b1
May 3, 2026
Merged

Add Save suppressions checkbox to auto-fix workflow#40
edmofro merged 2 commits into
mainfrom
workhorse/b1

Conversation

@edmofro

@edmofro edmofro commented May 3, 2026

Copy link
Copy Markdown
Member

🦸 Review Hero

  • Run Review Hero
  • Auto-fix review suggestions
  • Auto-fix CI failures
  • Save suppressions

Summary

  • Add a new Save suppressions checkbox (<!-- #save-suppressions -->) to the PR template and auto-fix workflow so the suppressions-from-feedback step can be triggered on its own — useful when there's nothing to auto-fix but 👎 reactions need to be captured.
  • Extract the thumbs-down learning logic from the bottom of main() into a dedicated runSaveSuppressions() function in scripts/auto-fix.mjs. The function is called from the new "nothing to fix" branch (when the checkbox is ticked alone) and unconditionally at the end of every auto-fix run, preserving prior automatic behaviour.
  • Update README "Learning from feedback" to document the new on-demand path alongside the existing automatic-during-auto-fix path.

Test plan

  • Tick only Save suppressions on a PR with 👎 reactions — verify the workflow runs, posts the Saved N suppression(s) comment, commits to .github/review-hero/suppressions.yml, and unchecks the box
  • Tick only Save suppressions on a PR with no 👎 reactions — verify the workflow runs and posts No new suppressions to save.
  • Tick Auto-fix review suggestions (without Save suppressions) on a PR that has both unresolved comments and 👎 reactions — verify auto-fix still saves suppressions automatically at the end of the run
  • Tick Save suppressions alongside Auto-fix review suggestions — verify both checkboxes are unchecked after completion
  • Open a PR with no checkboxes ticked — verify the workflow does not run

🤖 Generated with Claude Code

Comment thread scripts/auto-fix.mjs
try {
execFileSync(commitHelperPath, [
"-m",
`chore: add ${newSuppressions.length} suppression(s) from developer feedback`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Bugs & Correctness] suggestion

In runSaveSuppressions(), resolveThread() is called for all rejected findings unconditionally — even when generateSuppressions() returns an empty array (no suppressions generated). If the LLM returns empty output, thumbs-downed threads are marked resolved and won't be re-processed on subsequent runs, silently losing the developer's feedback. The original code had the same structure, but now that this function is also called standalone via the checkbox, the impact is more visible. Consider only resolving threads when at least one suppression was actually committed.

@review-hero

review-hero Bot commented May 3, 2026

Copy link
Copy Markdown

🦸 Review Hero Summary
3 agents reviewed this PR | 0 critical | 1 suggestion | 0 nitpicks | Filtering: consensus 3 voters, 2 below threshold

Below consensus threshold (2 unique issues not confirmed by majority)
Location Agent Severity Comment
scripts/auto-fix.mjs:344 Bugs & Correctness suggestion When ANTHROPIC_API_KEY is missing, runSaveSuppressions() silently returns 0, causing the early-exit path (lines 451-454) to post '🦸 Review Hero — No new suppressions to save.' on the PR. A...
scripts/auto-fix.mjs:706 Bugs & Correctness suggestion When runSaveSuppressions() throws at the end of a successful auto-fix run, the error is silently swallowed (console.warn only) and the user gets no PR comment. The early-exit path (line 441-448) co...
Local fix prompt (copy to your coding agent)

Fix these issues identified on the pull request. One commit per issue fixed.


scripts/auto-fix.mjs:385: In runSaveSuppressions(), resolveThread() is called for all rejected findings unconditionally — even when generateSuppressions() returns an empty array (no suppressions generated). If the LLM returns empty output, thumbs-downed threads are marked resolved and won't be re-processed on subsequent runs, silently losing the developer's feedback. The original code had the same structure, but now that this function is also called standalone via the checkbox, the impact is more visible. Consider only resolving threads when at least one suppression was actually committed.

@edmofro edmofro merged commit 60476df into main May 3, 2026
12 checks passed
@edmofro edmofro deleted the workhorse/b1 branch May 3, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant