Skip to content

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

Merged
M4n0x merged 2 commits into
mainfrom
ci/followup-team-threads
Dec 3, 2026
Merged

M4n0x merged 2 commits into
mainfrom
ci/followup-team-threads

Conversation

@M4n0x

@M4n0x M4n0x commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

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

An unresolved review thread whose newest reply came from anyone but the
author counted against the author. Another contributor could leave a
thread open on someone else's pull request, reply after the author, get
a bot to reply, or comment from an account deleted later, and get the
pull request nudged and then closed, where it would otherwise wait on
maintainers and never close.

Only the author's and the team's comments, and a bot's that opened the
thread, now decide whose court a thread is in.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner December 3, 2026 14:57
@github-actions github-actions Bot added the deep-review CodeRabbit reviews this pull request: big or risky changes label Dec 3, 2026
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The follow-up script now limits recognized bot markers to specified GitHub Actions logins and classifies unresolved review threads using eligible comments. Tests and policy descriptions cover marker recognition, thread ownership, and author follow-up criteria.

Changes: Community PR follow-up

Layer / File(s) Summary
Follow-up marker recognition
.github/scripts/community-pr-followup.mjs, .github/scripts/community-pr-followup.test.mjs
The script accepts bot-authored follow-up markers only from github-actions or github-actions[bot]. Tests cover those logins, rejection of other bots, and the legacy comment shape.
Thread ownership and follow-up criteria
.github/scripts/community-pr-followup.mjs, .github/scripts/community-pr-followup.test.mjs, .github/workflows/community-pr-followup.yml, CONTRIBUTING.md, DECISIONS.md
Thread classification uses the latest author or team-member comment, or a review-bot comment that opened the thread. Other users’ comments and bot replies do not determine ownership. Tests and policy descriptions cover these criteria.

Possibly related PRs

Merge Risk: Minimal · up to e3301

This change narrows which comments can move community pull requests toward closing, and the supplied evidence shows no concrete defect. The change is low-risk and easy to revert, and the author plans a manual dry run after merging.

Security architecture risk: Minimal · up to e3301

Community PR follow-up narrows who can put a pull request on the auto-close path without expanding the workflow’s permissions. Team comments and bot-opened threads can still require an author response, and maintainers can still pause follow-ups with keep-open.

Security review details

Security Blast Radius

  • observed — The changed decision affects labels, follow-up comments, and open community PR state in the repository running the sweep. The evaluated PR supplies data, not executable workflow code.

Trust Boundaries and Controls

  • observed — Reminder text alone is not trusted state. The parser now requires both a bot identity and an accepted GitHub Actions login, consistent with the sweep’s default token. This establishes provenance at the account level, not at the individual workflow-run level.

Dependencies

  • observed — Thread eligibility relies on GitHub’s author login, account type, author association, and timestamps. It is computed from the fetched snapshot, which still requests only the first 20 comments per thread; the evaluator cannot account for replies outside that window.

Data and control flow

  • observed — Thread ownership and activity are tracked separately. An outsider with a live human account can still reset the inactivity clock without assigning work to the author. A missing author resets neither clock nor ownership at the head; it already did not reset the clock at the base.

Resilience and Maintainability Implications

  • observed — A label is not proof that the author was warned. Closure requires a current author-side condition and a recognized nudge for the current head and draft state that has not been superseded by activity. If label changes succeed but the nudge post fails, that label does not authorize closure on retry. The head tightens which comments can serve as that acknowledgment.
  • observed — The unchanged sweep rechecks that the PR is open, that its head is unchanged, and that the same nudge or close action still applies before writing. The check and write are not atomic. Closure also precedes its notice, so an interrupted write sequence can leave a closed PR without a notice, which an open-PR sweep does not repair.

Rollout and rollback

  • inferred — Existing GitHub Actions nudges need no migration. If an open PR loses its only author blocker under the new rule, a later sweep takes the maintainer path and removes the waiting-for-author label. Maintainers can still apply keep-open to pause follow-ups. Rolling back restores broader comment eligibility and marker trust on subsequent sweeps; it does not itself reopen a closed PR.
Pre-merge checks: Passed 3

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is thorough and follows the template. It has Problem, Changes, and Testing sections, plus a Merging section that states the merge method and says any method works. It links the related…
Full details: Description check

Explanation

The description is thorough and follows the template. It has Problem, Changes, and Testing sections, plus a Merging section that states the merge method and says any method works. It links the related port PR (stablebox/stablebar-packages#78), and it explains the bot-thread, marker, and deleted-account changes. The closing line names the model and harness (Claude Opus 5.5 via Claude Code), which the template requires. The Problem section does not link a closed issue number, but it does reference #946 as the follow-up work it changes. The Testing section lists commands run, results, and what was not checked. Those are the required items. Minor gap: the Problem section does not use the template's 'Fixes #' phrasing, so the linked issue relationship is unclear.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a342cb7 and e3301b5.

Files selected for processing: 2

  • .github/scripts/community-pr-followup.mjs
  • .github/scripts/community-pr-followup.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/scripts/community-pr-followup.mjs">

<violation number="1" location=".github/scripts/community-pr-followup.mjs:288">
P2: Deleted-account thread comments still do not delay follow-up: GraphQL represents their author as `null`, which `isBotUser` treats as a bot, so this branch skips `lastHumanThreadAt`. Count a null author as activity for the delay clock while continuing to exclude it from ownership decisions.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Anyone can get a bot such as CodeRabbit to repeat text, and the sweep
read a follow-up marker from any bot's comment, so a repeated check-in
could start the closing countdown. Only GitHub Actions' markers count
now. Outsiders' recent thread comments are also tested to delay a
follow-up.
@M4n0x
M4n0x added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit e3b72d9 Dec 3, 2026
28 checks passed
@M4n0x
M4n0x deleted the ci/followup-team-threads branch December 3, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deep-review CodeRabbit reviews this pull request: big or risky changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant