Skip to content

fix(settings): contributorBlacklist login pattern rejects GitHub bot logins ending in [bot] #6190

Description

@JSONbored

Context

src/settings/contributor-blacklist.ts:10 validates entries against GITHUB_LOGIN = /^[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}$/, which rejects any login ending in [bot]. Its sibling src/settings/auto-close-exempt.ts (mirrored from packages/loopover-engine/src/settings/auto-close-exempt.ts) deliberately extends the same base pattern with (?:\[bot\])?, specifically because "a repo-specific bot integration...is exactly the kind of third-party automation identity a maintainer needs to exempt." A maintainer configuring settings.contributorBlacklist: [{login: "evilbot[bot]"}] gets it silently dropped with only a generic "not a valid GitHub login" warning. Bot accounts are a documented abuse vector elsewhere in this codebase (agent-actions.ts's PROTECTED_AUTOCLOSE_AUTHORS), so blacklisting one should be supported.

Requirements

  • Extend contributor-blacklist.ts's GITHUB_LOGIN pattern with the same (?:\[bot\])? suffix auto-close-exempt.ts already uses, so a bot login validates correctly.
  • Verify the blacklist-enforcement code path (wherever contributorBlacklist is actually checked against an incoming PR's author) correctly matches a [bot]-suffixed login end-to-end, not just that the config-parsing regex accepts it.
  • Do not change auto-close-exempt.ts — it's already correct and is the reference pattern.

Test Coverage Requirements

99%+ Codecov patch coverage on the changed regex and its enforcement path; add a regression test blacklisting a something[bot] login and confirming a PR from that author is actually blocked.

Deliverables

  • contributor-blacklist.ts's GITHUB_LOGIN pattern accepts [bot]-suffixed logins.
  • Regression test confirming a blacklisted bot login is actually enforced.

Expected Outcome

A maintainer can blacklist a malicious or unwanted bot account the same way they can already blacklist a human contributor.

Links & Resources

  • src/settings/contributor-blacklist.ts:10
  • src/settings/auto-close-exempt.ts (packages/loopover-engine/src/settings/auto-close-exempt.ts, the correct reference pattern)
  • src/settings/agent-actions.ts (PROTECTED_AUTOCLOSE_AUTHORS, documents bot accounts as a real abuse vector)

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