openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

`openlibrary-bot` comments trigger "Needs: Response" labeling

Open jimchamp opened this issue 4 months ago • 1 comments

Problem

The new @openlibrary-bot account comments on issues and PRs in this repository. Whenever it makes a new comment, a Needs: Response label is added to the issue in error -- staff does not need to respond to such comments.

Reproducing the bug

  1. Go to ...
  2. Do ...
  • Expected behavior:
  • Actual behavior:

Context

  • Browser (Chrome, Safari, Firefox, etc):
  • OS (Windows, Mac, etc):
  • Logged in (Y/N):
  • Environment (prod, dev, local): prod

Breakdown

Implementation Details (for maintainers)

Requirements Checklist

  • [ ]

Related files

Stakeholders


Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

jimchamp avatar Jul 09 '26 00:07 jimchamp

Status Overview

⚠️ Contributors, hold off picking this one up — it's already in the pipeline:

  • [ ] Needs: Staff Decision — two open PRs independently fix this; a maintainer needs to pick one (or merge both) before either lands.

Context

  • Root cause: filter_issues() in scripts/gh_scripts/issue_comment_bot.py only excludes configured leads from counting as "someone who already responded" (last_commenter not in [lead["githubUsername"] for lead in leads]). It has never excluded bot accounts, so any @openlibrary-bot comment is treated as "needs a reply" by the next new_comment_digest cron run (.github/workflows/new_comment_digest.yml, daily 08:30).
  • This has happened before: #10487 reported the same root cause against Codecov's bot and was closed NOT_PLANNED because Codecov stopped commenting — the underlying filter_issues() gap was never patched, so it resurfaced with openlibrary-bot.
  • Two independent fixes already exist, both touching filter_issues():
    • #13139 (jimchamp, non-draft, MERGEABLE, Closes #13138) — adds a bots array to .github/workflows/config/new_comment_digest.json (config-driven allowlist) and a should_label_issue() helper.
    • #13119 (openlibrary-bot, opened 5 days before this issue, still draft, CI green) — broader: hardcoded EXEMPT_COMMENTER_LOGINS + user.type check, plus a new needs_response_triage.yml workflow that reacts to Needs: Response being applied and strips it if the last commenter turns out to be a bot (backstop).
    • These overlap on the same function with different designs and will conflict if both are merged as written.
  • Unrelated, spotted incidentally in the same file (pre-existing, not introduced by either PR): except OSError, json.JSONDecodeError: in start_job() is Python 2 exception syntax — a SyntaxError under Python 3.12+. Flagging for awareness; out of scope here.

Issue Assessment

Open questions

  • Which PR should land — #13139 (narrower, ready now) or #13119 (broader, includes the needs_response_triage.yml addition, still draft)?
  • Is the needs_response_triage.yml workflow in #13119 in scope for this issue, or should it be tracked separately from the bot-exclusion fix?

Action items

  • [ ] Reconcile #13119 and #13139 — decide which lands, or merge the config-driven exemption approach with the triage-workflow backstop.
Full triage checklist (maintainers / Richy)
  • [x] Triage — correct labels applied or removed
  • [x] Problem / opportunity — problem is clear, audience identified, actionable
  • [x] Scope — issue is well-scoped; does not try to do too many things
  • [x] Justification — reasoning and impact stated; sufficient for leads to prioritize
  • [x] Success & testing criteria — defines what "done" looks like, verifiable by a contributor
  • [x] Proposal & breakdown — concrete plan present; checklist actionable for a contributor
  • [ ] If bug: environment & repro steps — browser, version, local vs prod; steps to reproduce
  • [x] Risks, concerns, open questions — identified and surfaced (any security or privacy implications?)
  • [x] Richy context — relevant code, commits, PRs reviewed; no duplicate issue found
  • [x] References — screenshots, designs, docs, and links present where needed

[!NOTE] This comment was automatically generated by Richy, via PAM, Open Library's Project AI Manager, on behalf of @mekarpeles. Richy is designed to provide status visibility, perform basic project management functions and relevant codebase research, and provide actionable feedback so contributors aren't left waiting.

openlibrary-bot avatar Jul 09 '26 00:07 openlibrary-bot