openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Issue Enrichment does not exclude openlibrary-bot (account type is User, not Bot)

Open mekarpeles opened this issue 4 months ago • 1 comments

Problem

.github/workflows/issue_enrichment.yml's trigger condition (github.event.issue.user.type != 'Bot') and issue_enrichment.md's skip list (author login ends in [bot]) both rely on signals that do not actually catch openlibrary-bot. Its account type is "User", not "Bot" (confirmed via gh api users/openlibrary-bot -q '.type'), and its login doesn't end in [bot]. As a rule, openlibrary-bot should be excluded from our own automations — no issue enrichment on an issue it opens, no PR auto-responder on a PR it opens, etc.

This is the same underlying account-type quirk discovered while investigating #13161 (write-permission checks also fail to recognize it correctly, in the opposite direction — openlibrary-bot has write access, unlike most User-type contributors).

Fix

Add an explicit login check (user.login != 'openlibrary-bot') alongside the existing type/[bot]-suffix checks, in both the workflow if: condition and the prompt's documented skip conditions. Applied here to issue_enrichment.yml/.md; the same fix was applied to the not-yet-merged PR auto-responder (#13164) before it merged.

Related

  • #13160 — Epic: AI Workflows (parent)
  • #13161 — separate bug found in the same investigation (write-permission bypass, opposite-direction failure of the same account-type assumption)
  • #13138 — prior instance of the general "ignore openlibrary-bot's own actions" problem class

mekarpeles avatar Jul 15 '26 22:07 mekarpeles

Context

  • The bug is confirmed in the current file state. The if: gate still checks only account type and the agentic-workflows label — no explicit openlibrary-bot login check: https://github.com/internetarchive/openlibrary/blob/8404a0c009e28edeae3638b210d7178c954e26cb/.github/workflows/issue_enrichment.yml#L25-L28
  • Same gap in the documented skip conditions: https://github.com/internetarchive/openlibrary/blob/8404a0c009e28edeae3638b210d7178c954e26cb/.github/workflows/issue_enrichment.md#L25-L28
  • git blame on both ranges traces every line to a single commit, 8404a0c (merge of #13154, authored by @mekarpeles) — no other contributor has touched this trigger logic.
  • A fix already exists: PR #13166 ("fix(agentic): exclude openlibrary-bot from issue enrichment"), opened by @mekarpeles 27 seconds after this issue, adds github.event.issue.user.login != 'openlibrary-bot' to the if: condition and an equivalent line to the .md skip list — exactly the change described here. Its own description flags one open gap: the fix is verified via pre-commit and logic review but not independently exercised against a live issue opened by openlibrary-bot (would require the bot to actually open one).
  • The identical pattern was applied in the (still-open, unmerged) PR #13164 for pr_autoresponder.yml/.md, which this issue's body also references — confirms the fix approach is consistent across the two sibling workflows rather than a one-off.
  • No duplicate issue found. Related: #13160 (epic parent), #13161 (opposite-direction failure of the same account-type assumption, opened same investigation), #13138 (closed, prior instance of the general "ignore openlibrary-bot's own actions" problem class).

Issue Assessment

Open questions

  • [x] ~~Does a fix exist yet?~~ (Answer: yes — PR #13166, already open, matches this issue's proposed fix line-for-line.)
  • [ ] PR #13166 itself notes its if:-gate change hasn't been exercised against a real openlibrary-bot-opened issue. Confirming that end-to-end (or accepting the logic-review-only verification as sufficient) is a maintainer call.
Full triage checklist
  • [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
  • [ ] Success & testing criteria — the fix's logic is verifiable by review, but there's no defined way to confirm the trigger actually skips a live openlibrary-bot-opened issue (same gap PR #13166 itself flags)
  • [x] Proposal & breakdown — concrete plan present; checklist actionable for a contributor
  • [x] If bug: environment & repro steps — root cause confirmed via gh api users/openlibrary-bot -q '.type', no browser/env repro applicable (static workflow-logic bug)
  • [ ] Risks, concerns, open questions — the "unverified against a live event" gap wasn't surfaced in the issue body itself (found via PR research, see Context)
  • [x] Richy context — relevant code, commits, PRs reviewed; no duplicate found
  • [x] References — screenshots, designs, docs, and links present where needed

[!NOTE] This comment was automatically generated by Richy, Open Library's issue enrichment assistant, on behalf of @mekarpeles. This is NOT a sign-off. This issue needs lead review before work begins.

openlibrary-bot avatar Jul 15 '26 22:07 openlibrary-bot