Skip to content

fix(review): closeRepeatedDraftCyclingIfDetected skips the autoCloseExemptLogins allowlist its two siblings honor #6165

Description

@JSONbored

Context

src/queue/review-evasion.ts has three sibling auto-close guards for review-evasion tactics. Two of them — closeReviewEvasionSelfCloseIfReviewed (line 584) and closeReviewEvasionDraftConversionIfReviewed (line 803) — both call if (isAutoCloseExempt(pr.authorLogin, settings.autoCloseExemptLogins)) return; before acting, and the draft-conversion guard's own doc comment (line 766) explicitly says this is "the same shared allowlist the contributor-cap/review-nag guards already honor." The third sibling, closeRepeatedDraftCyclingIfDetected (lines 947-971, added later per its #gaming-tactic-draft-cycle comment), checks isProtectedAutomationAuthor (line 968) but never calls isAutoCloseExempt — so a maintainer-configured trusted-contributor exemption is silently bypassed for this one enforcement path, inconsistent with its two siblings.

Requirements

  • Add the same if (isAutoCloseExempt(pr.authorLogin, settings.autoCloseExemptLogins)) return; check to closeRepeatedDraftCyclingIfDetected, in the same position relative to its other checks that the two sibling guards use.
  • Do not change isProtectedAutomationAuthor's existing check — both checks should coexist, matching the siblings' pattern.
  • Do not change the two correct sibling guards.

Test Coverage Requirements

99%+ Codecov patch coverage on the changed branch; add a regression test proving a PR from an autoCloseExemptLogins-listed author is NOT auto-closed by the repeated-draft-cycling guard, mirroring the equivalent existing test for the other two guards.

Deliverables

  • closeRepeatedDraftCyclingIfDetected honors autoCloseExemptLogins.
  • Regression test for the exemption.

Expected Outcome

A maintainer-configured trusted-contributor exemption is honored consistently across all three review-evasion auto-close guards.

Links & Resources

  • src/queue/review-evasion.ts:584,766,803,947-971 (all three guards, in one file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions