Skip to content

chore: deploy triage-bot.yml + canonical auto-merge.yml#57

Merged
github-actions[bot] merged 1 commit into
mainfrom
chore/triage-bot-and-canonical-auto-merge
May 18, 2026
Merged

chore: deploy triage-bot.yml + canonical auto-merge.yml#57
github-actions[bot] merged 1 commit into
mainfrom
chore/triage-bot-and-canonical-auto-merge

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 18, 2026

Last piece of the triage-gate stack. The branch ruleset on this repo blocks direct workflow-file pushes, so this comes via PR.

Final piece of the triage-gate stack: required_conversation_resolution
is on, TRIAGE_PAT is set, triage-bot.yml classifies threads, canonical
auto-merge.yml removes owner-clause (cooldown lives in pr-heal.yml).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 78efaad7-ae9f-4cee-982b-9174671844af

📥 Commits

Reviewing files that changed from the base of the PR and between be5f97b and c64c33f.

📒 Files selected for processing (2)
  • .github/workflows/auto-merge.yml
  • .github/workflows/triage-bot.yml

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting


Summary by CodeRabbit

  • Chores
    • Updated pull request auto-merge workflow to refine handling criteria
    • Added automated review thread triage to classify and resolve routine review comments

Walkthrough

The PR separates owner PR auto-merge routing to a cron tier by removing the repository-owner condition from the auto-merge workflow, and introduces a new triage-bot workflow that automatically resolves or dismisses low-signal PR review threads (e.g., nits, praise, short Copilot comments, or explicitly marked ones) while preserving threads requiring human resolution.

Changes

Auto-merge Tier Adjustment

Layer / File(s) Summary
Remove owner routing from auto-merge
.github/workflows/auto-merge.yml
Documentation and job logic updated to reflect tiered PR handling: the repository-owner condition is removed from the enable-auto-merge job's if: gate; owner PRs now route exclusively through the cron tier instead. Auto-merge enablement depends only on head-ref patterns (claude/copilot/jules) and approval by coderabbitai[bot].

Triage Bot Workflow

Layer / File(s) Summary
Workflow configuration and setup
.github/workflows/triage-bot.yml
New workflow triggered on PR review comments, reviews, and manual dispatch; grants pull-request write permission; enforces concurrency keying by PR number to prevent overlapping runs; the triage job extracts PR number from event payload or workflow_dispatch input and exits if missing.
Thread classification and resolution
.github/workflows/triage-bot.yml
GraphQL query retrieves up to 100 unresolved review threads; each thread is classified deterministically (dismiss if flagged with [triage:auto-resolve], starts with nit*/praise* prefixes, or authored by Copilot under 200 characters; otherwise needs-human); dismissed threads are resolved via mutation; a summary comment lists each thread's classification status.

🎯 2 (Simple) | ⏱️ ~12 minutes


area:infra


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot merged commit 54466ab into main May 18, 2026
3 of 5 checks passed
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

@codacy-production codacy-production Bot left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

While the PR successfully introduces the triage bot and updates the auto-merge logic, there are two critical implementation issues that should be addressed before merging:

  1. Bot Identity Mismatch: The triage script expects the author login 'Copilot', but the standard GitHub Copilot bot uses 'github-copilot[bot]'. This will prevent automatic resolution of Copilot threads.
  2. Notification Spam: The bot is configured to create a new comment on every trigger (comment or review event), which will flood the PR timeline. The script should be updated to find and update a single persistent status comment.

Additionally, the PR description does not currently mention the functional change to the auto-merge workflow (removing the repository owner's immediate merge privilege), and the complex JavaScript logic embedded in the YAML is currently untested.

About this PR

  • The PR description is missing information regarding the functional change to auto-merge.yml, specifically the removal of the repository owner from the immediate auto-merge condition.

Test suggestions

  • Review thread with 'nit: fix this' is automatically resolved.
  • Review thread with '[triage:auto-resolve]' marker is automatically resolved.
  • Copilot comment under 200 chars is automatically resolved.
  • Human comment (not a nit) remains unresolved.
  • PR from owner does not trigger the 'enable-auto-merge' job.
  • PR approved by 'coderabbitai[bot]' triggers 'enable-auto-merge'.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Review thread with 'nit: fix this' is automatically resolved.
2. Review thread with '[triage:auto-resolve]' marker is automatically resolved.
3. Copilot comment under 200 chars is automatically resolved.
4. Human comment (not a nit) remains unresolved.
5. PR from owner does not trigger the 'enable-auto-merge' job.
6. PR approved by 'coderabbitai[bot]' triggers 'enable-auto-merge'.
Low confidence findings
  • The JavaScript logic for triaging threads is implemented directly via github-script without accompanying unit tests. For logic this complex, consider moving it to a separate script or action that can be tested independently.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

}

if (summary.length > 0) {
await github.rest.issues.createComment({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Suggestion: This logic creates a new issue comment on every run if any unresolved threads remain. This will flood the PR timeline with duplicate 'Triage Bot report' messages whenever a user replies or edits a comment. It is better to find an existing report comment and update it.

Try running the following prompt in your coding agent:

Update the triage script in the 'github-script' block to search for an existing issue comment starting with '## Triage Bot report'. If one exists, update it using github.rest.issues.updateComment; otherwise, create a new one using github.rest.issues.createComment.

} else if (/^\s*(nit:|nitpick:|praise:)/i.test(body)) {
decision = 'dismiss';
reason = 'classified as nit/nitpick/praise — non-blocking';
} else if (author === 'Copilot' && body.length < 200) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

The login for the GitHub Copilot bot is typically github-copilot[bot], not Copilot. Using the incorrect string will prevent the auto-dismissal logic from correctly identifying and resolving Copilot-generated threads.

Suggested change
} else if (author === 'Copilot' && body.length < 200) {
} else if (author === 'github-copilot[bot]' && body.length < 200) {

@ANcpLua
Copy link
Copy Markdown
Owner Author

ANcpLua commented May 18, 2026

Triage Bot report

  • thread Pc6C5GTN from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🔴 HIGH RISK Suggestion: This logic creates a new issue co

  • thread Pc6C5GTY from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🟡 MEDIUM RISK The login for the GitHub Copilot bot is

Threads marked needs-human stay unresolved and block auto-merge.

1 similar comment
@ANcpLua
Copy link
Copy Markdown
Owner Author

ANcpLua commented May 18, 2026

Triage Bot report

  • thread Pc6C5GTN from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🔴 HIGH RISK Suggestion: This logic creates a new issue co

  • thread Pc6C5GTY from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🟡 MEDIUM RISK The login for the GitHub Copilot bot is

Threads marked needs-human stay unresolved and block auto-merge.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c64c33fd9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- name: Triage unresolved review threads
uses: actions/github-script@v7
with:
github-token: ${{ secrets.TRIAGE_PAT }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid secret-based auth on fork-triggered review events

This workflow is triggered by pull_request_review and pull_request_review_comment, but it authenticates actions/github-script with secrets.TRIAGE_PAT. For forked PRs (and Dependabot PRs treated as forks), GitHub does not pass Actions secrets to these events, so the token is unavailable and the triage step cannot resolve threads or post its report. In practice, that leaves unresolved threads unprocessed exactly on external/dependency PRs, which can keep required-conversation-resolution merges blocked.

Useful? React with 👍 / 👎.

} else if (/^\s*(nit:|nitpick:|praise:)/i.test(body)) {
decision = 'dismiss';
reason = 'classified as nit/nitpick/praise — non-blocking';
} else if (author === 'Copilot' && body.length < 200) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match Copilot reviewer bot login when auto-dismissing

The Copilot rule checks author === 'Copilot', but GraphQL author.login for Copilot code reviews is a bot login (for example copilot-pull-request-reviewer[bot]), not the display label “Copilot”. As written, this branch never fires, so short Copilot comments fall through to needs-human and remain unresolved, which undermines the workflow’s stated intent to auto-resolve low-signal Copilot feedback.

Useful? React with 👍 / 👎.

Comment on lines +106 to +107
summary.push(
`- thread ${t.id.slice(-8)} from @${author}: **${decision}** — ${reason}\n > ${snippet}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Report unresolved threads accurately after resolve failures

The report entry is added before attempting resolveReviewThread, so a thread is always reported as dismiss even when the mutation fails (for example when viewerCanResolve is false or the API call errors). That can mislead maintainers into thinking a blocking thread was cleared when it is still unresolved, delaying manual intervention and leaving auto-merge blocked.

Useful? React with 👍 / 👎.

@ANcpLua
Copy link
Copy Markdown
Owner Author

ANcpLua commented May 18, 2026

Triage Bot report

  • thread Pc6C5GTN from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🔴 HIGH RISK Suggestion: This logic creates a new issue co

  • thread Pc6C5GTY from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🟡 MEDIUM RISK The login for the GitHub Copilot bot is

  • thread Pc6C5KRz from @chatgpt-codex-connector: needs-human — no rule matched — keeping blocked for manual review

    **P1 Badge

  • thread Pc6C5KR1 from @chatgpt-codex-connector: needs-human — no rule matched — keeping blocked for manual review

    **P2 Badge

  • thread Pc6C5KR2 from @chatgpt-codex-connector: needs-human — no rule matched — keeping blocked for manual review

    **P2 Badge

Threads marked needs-human stay unresolved and block auto-merge.

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@ANcpLua
Copy link
Copy Markdown
Owner Author

ANcpLua commented May 18, 2026

Triage Bot report

  • thread Pc6C5GTN from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🔴 HIGH RISK Suggestion: This logic creates a new issue co

  • thread Pc6C5GTY from @codacy-production: needs-human — no rule matched — keeping blocked for manual review

    🟡 MEDIUM RISK The login for the GitHub Copilot bot is

  • thread Pc6C5KRz from @chatgpt-codex-connector: needs-human — no rule matched — keeping blocked for manual review

    **P1 Badge

  • thread Pc6C5KR1 from @chatgpt-codex-connector: needs-human — no rule matched — keeping blocked for manual review

    **P2 Badge

  • thread Pc6C5KR2 from @chatgpt-codex-connector: needs-human — no rule matched — keeping blocked for manual review

    **P2 Badge

Threads marked needs-human stay unresolved and block auto-merge.

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant