Skip to content

fix(router): use trigger result workItemId for GitHub ack run link#1036

Merged
zbigniewsobiecki merged 2 commits intodevfrom
fix/ack-run-link-work-item-id
Mar 24, 2026
Merged

fix(router): use trigger result workItemId for GitHub ack run link#1036
zbigniewsobiecki merged 2 commits intodevfrom
fix/ack-run-link-work-item-id

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • GitHub PR ack comments were linking to /work-items/{project}/{prNumber} (e.g. /work-items/cascade/1030) instead of the actual Trello work item ID
  • The dashboard showed "No runs found" because runs are stored under the Trello card ID, not the PR number
  • Fix: use triggerResult?.workItemId ?? event.workItemId — the same pattern already used for PM-focused agent acks on line 320

Root cause

event.workItemId is set to String(pr.number) by parseWebhook(). The GitHub PR ack block used this directly, while the PM ack block already correctly preferred triggerResult.workItemId. One-liner to align them.

Test plan

  • CI passes
  • Trigger a review on a PR with a linked Trello card → ack comment URL should contain the Trello card ID, not the PR number

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The GitHub PR ack comment was linking to /work-items/{project}/{prNumber}
instead of /work-items/{project}/{trelloCardId}, causing "No runs found"
on the dashboard. Use triggerResult.workItemId ?? event.workItemId,
mirroring the existing pattern used for PM-focused agent acks (line 320).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki force-pushed the fix/ack-run-link-work-item-id branch from 494b358 to 452b5b0 Compare March 24, 2026 16:46
The previous test for triggerResult.workItemId run link was a false
positive: isPMFocusedAgent leaked 'true' from the preceding test
(clearMocks only clears call counts, not implementations), so the
function took the PM ack path and called buildWorkItemRunsLink via
withRunLink — never exercising the changed lines 334-347.

Fix: explicitly reset isPMFocusedAgent to false and mock extractPRNumber
so postGitHubPRAck doesn't bail early. Lines 336-347 now confirmed covered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit ac9e029 into dev Mar 24, 2026
9 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/ack-run-link-work-item-id branch March 24, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant