ci: keep outsiders' review threads from closing community pull requests

Merged
M4
4h ago
+79-9

Problem

Community PR follow-up (#946) treats an unresolved review thread as waiting on the author whenever its newest reply comes from anyone but the author. Someone outside the team can use that against another contributor's pull request. They can leave a review comment, reply after the author's answer, get CodeRabbit to reply by mentioning it, or comment and then delete their account (GitHub returns no author for that comment, which counted as a bot). The pull request then moves from "waiting on maintainers", which never closes, to "waiting on the author". If the author stays quiet, it gets a check-in after 7 days and is closed 7 days later.

The sweep also reads its check-in marker from any bot's comment. Someone who gets a bot to repeat a check-in, marker included, starts the closing countdown without the bot ever posting a real check-in.

Changes

  • community-pr-followup.mjs: three kinds of comment now decide whose court an unresolved thread is in:

    • the author's comments;
    • the team's (OWNER, MEMBER, COLLABORATOR);
    • a review bot's, but only when the bot opened the thread.

    A thread from cubic or CodeRabbit still waits on the author, as before; this repository requires every thread to be resolved before merging. A bot's later reply, which anyone can trigger, no longer counts. That also stops CodeRabbit's "thanks" after the author's fix from putting the thread back on the author. Comments from other users don't count either. They still delay a follow-up as before, but they can no longer push a pull request towards closing. A deleted account's comment has no author and counts for neither, as before.

  • readFollowupMarker reads a marker only from GitHub Actions, the account the workflow comments as.

  • Tests: one new test covers each thread case: an outsider's thread, a bot's thread, a bot replying after the author, a deleted account, an outsider replying after the author, an outsider's "+1" after a maintainer's request, and outsiders' recent comments still delaying a follow-up. The marker test now also checks that another bot's marker doesn't count.

  • CONTRIBUTING.md, DECISIONS.md and the workflow's header now say the threads are the team's or a review bot's.

The store got the same fix in stablebox/stablebar-packages#78, which ports this workflow.

Testing

  • node --test .github/scripts/community-pr-followup.test.mjs: 15 pass.
  • The thread test and the marker test fail against main's community-pr-followup.mjs and pass with this change.
  • actionlint on the workflow: no findings.
  • app-release.test.mjs didn't run locally because its npm packages weren't installed. This change doesn't touch it.
  • Not checked: a live run. A manual dry run of Community PR follow-up after merging shows the decisions for the open pull requests.

Merging

Two ci: commits, which release nothing. Any merge method works.

Claude Opus 5.5 via Claude Code