Skip to content

Commit 5b2b5c0

Browse files
committed
Trigger Dosu from PR triage comments
The PR triage workflow mentioned Dosu inside inline-code formatting and before the final footer, which did not reliably wake the bot. Move the handoff so the last non-empty comment line is a plain-text @dosubot request, matching the working PR template pattern. Constraint: GitHub bot mentions can be sensitive to markdown formatting and comment placement. Rejected: Leave the mention as a copy-paste hint | it does not satisfy the maintainer need for automatic bot triggering. Confidence: high Scope-risk: narrow Directive: Keep the generated triage comment's final non-empty line as a plain-text @dosubot request. Tested: bun run check:policy Tested: git diff --check Tested: bun run check:pr
1 parent 7a5f813 commit 5b2b5c0

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

‎.github/workflows/pr-triage.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ jobs:
227227
'**Risk notes:**',
228228
riskNotes.map((note) => `- ${note}`).join('\n'),
229229
'',
230-
'**Dosu handoff:** Dosu can be used as the AI reviewer for risk explanation, missing-test prompts, and maintainer Q&A. If it does not comment automatically from the PR template, ask:',
230+
'Hard merge gates still come from GitHub Actions, not AI review.',
231231
'',
232-
'`@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.`',
232+
'**Dosu handoff:** Dosu can be used as the AI reviewer for risk explanation, missing-test prompts, and maintainer Q&A. If it does not comment automatically from the PR template, ask:',
233233
'',
234-
'Hard merge gates still come from GitHub Actions, not AI review.',
234+
'@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.',
235235
].join('\n')
236236
237237
const comments = await github.paginate(github.rest.issues.listComments, {

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "bun run ./bin/claude-haha",
1212
"check:pr": "bun run scripts/pr/check-pr.ts",
1313
"check:impact": "bun run scripts/pr/impact-report.ts",
14-
"check:policy": "bun test scripts/pr/change-policy.test.ts",
14+
"check:policy": "bun test scripts/pr/change-policy.test.ts scripts/pr/pr-triage-workflow.test.ts",
1515
"check:server": "bun run scripts/pr/run-server-tests.ts",
1616
"check:desktop": "cd desktop && bun run lint && bun run test -- --run && bun run build",
1717
"check:adapters": "cd adapters && bun test",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { describe, expect, test } from 'bun:test'
2+
import { readFileSync } from 'node:fs'
3+
4+
const DOSU_PROMPT = '@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.'
5+
6+
function extractCommentBodyEntries(workflow: string) {
7+
const match = workflow.match(/const body = \[([\s\S]*?)\n\s*\]\.join\('\\n'\)/)
8+
if (!match) {
9+
throw new Error('Could not find PR triage comment body array')
10+
}
11+
12+
return match[1]
13+
.split('\n')
14+
.map((line) => line.trim())
15+
.filter((line) => line.startsWith("'") || line.startsWith('`'))
16+
}
17+
18+
describe('PR triage workflow comment', () => {
19+
test('ends with a plain-text Dosu mention so the bot is triggered', () => {
20+
const workflow = readFileSync('.github/workflows/pr-triage.yml', 'utf8')
21+
const entries = extractCommentBodyEntries(workflow)
22+
const nonEmptyEntries = entries.filter((entry) => !/^['`]['`],?$/.test(entry))
23+
const lastEntry = nonEmptyEntries.at(-1)
24+
25+
expect(lastEntry).toBe(`'${DOSU_PROMPT}',`)
26+
expect(workflow).not.toContain(`\`${DOSU_PROMPT}\``)
27+
})
28+
})

0 commit comments

Comments
 (0)