refactor(#6767): route status notifications through tracker.Client - #6770
refactor(#6767): route status notifications through tracker.Client#6770fullsend-ai-coder[bot] wants to merge 4 commits into
Conversation
Status comments and reactions were coupled to forge.Client with owner/repo/number addressing. When a Jira issue triggers a run, the Jira issue number was passed to the forge as a GitHub issue number, producing a 404 because no such GitHub issue exists. Refactor statuscomment.Notifier and ReconcileOrphaned to accept tracker.Client instead of forge.Client. This routes status notifications to whichever tracker originated the run (GitHub, GitLab, or Jira) independently of the forge used for code output. Key changes: - Add DeleteComment to tracker.Client for start-comment cleanup - Add tracker.Reactor interface for optional emoji reactions; ForgeClient implements it, JiraClient does not - Notifier uses (project, number) addressing instead of (owner, repo, number) to match tracker.Client's model - ClientFactory returns tracker.Client instead of forge.Client - SetTriggerCommentID accepts string (tracker comment IDs are strings for JSON round-tripping safety) - Callers wrap forge.Client in tracker.NewForgeClient() - Add jira.LiveClient.DeleteComment for Jira comment deletion - Add ADR 0093 recording the provenance-based routing decision Pre-commit hooks could not be run in-sandbox (network-restricted); gofmt, go vet, ADR lints, and link checks were run directly. Closes #6767
Site previewPreview: https://30193f52-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 8:35 PM UTC · Completed 8:51 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.72 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsMedium-sized refactor (1138 lines, 15 files) routing status notifications through tracker.Client; zero protected paths, zero security-sensitive files, no CI or dependency changes, bot author; elevated git history churn on core files (run.go, statuscomment.go) but well-scoped refactor aligned with linked issue #6767; score unchanged from prior assessment as signals remain stable. Previous runRisk Assessment: moderate (2/5) DetailsMedium-sized refactor (1093 lines, 15 files) routing status notifications through tracker.Client; zero protected paths, zero security-sensitive files, no CI or dependency changes, bot author; elevated git history churn on core files (run.go, statuscomment.go) but well-scoped refactor aligned with linked issue #6767; score unchanged from prior assessment as signals remain stable. Previous run (2)Risk Assessment: moderate (2/5) DetailsMedium-sized refactor (827 lines, 13 files) routing status notifications through tracker.Client; zero protected paths, zero security-sensitive files, no CI or dependency changes, bot author; elevated git history churn on core files (statuscomment.go, run.go) but well-scoped refactor aligned with linked issue #6767. Previous run (3)Risk Assessment: moderate (2/5) DetailsMedium-sized refactor (827 lines, 13 files) routing status notifications through tracker.Client; zero protected paths, zero security-sensitive files, no CI or dependency changes, bot author; elevated git history churn on core files (statuscomment.go, run.go) but well-scoped refactor aligned with linked issue #6767. |
ReviewFindingsLow
Previous runLooks good to me Previous run (2)ReviewFindingsLow
Previous run (3)ReviewFindingsLow
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 8:53 PM UTC · Completed 9:01 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.70 |
- Update stale package doc in internal/tracker/tracker.go: replace "Nothing calls tracker.Client yet" with current consumers (statuscomment and reconcilestatus) - Restore five test comments that explain non-obvious edge-case reasoning removed during the API surface refactoring: outcome-neutral synthesized label (#5736), script-controlled text must not forge markers, reaction consistency on comment failure, paragraph break for GitLab CommonMark, and crash-before-post synthesis (#3635) Addresses review feedback on #6770
🔧 Fix agent — iteration 1 (bot-triggered)Addressed both review findings. Updated stale package doc in tracker.go and restored 5 valuable test comments that explain non-obvious edge-case reasoning. Fixed (2):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:02 PM UTC · Completed 9:17 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.27 |
Superseded by updated review
|
/fs-fix improve code coverage to satisfy codecov |
|
🤖 Finished Fix · ✅ Success · Started 3:32 PM UTC · Completed 3:41 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.57 |
Cover ForgeClient.DeleteComment, AddIssueReaction, DeleteIssueReaction, AddCommentReaction, DeleteCommentReaction; JiraClient.DeleteComment; FakeJiraClient via NewFakeJiraClient; and jira.LiveClient.DeleteComment. Raises tracker package coverage from 67% to 92%, satisfying the 80% codecov/patch threshold. Addresses review feedback on #6770
🔧 Fix agent — iteration 2 (human-triggered)Added 20 test functions across 3 test files to cover all new methods introduced in this PR. Tracker package coverage rose from 67% to 92%, jira package from 89% to 89%, all new functions now at 100%. All tests pass, go vet clean, gofmt clean. Fixed (4):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 3:43 PM UTC · Completed 3:57 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.26 |
|
/fs-fix two corrections - for one, JIRA cloud actually does support reactions for comments, but not for issues. Clarify this in the ADR. It can still be optional for now. Second thing to fix -> the event source wiring (dynamic routing) is not emphasized in the ADR like I think it should be. Switching from the forge client to the tracker client is a small potatoes internal refactoring detail. The idea that we dynamically choose which tracker to use based on the event is a bigger idea though. Update the ADR to make that clear. THe move to the tracker interface away from the forge interface is a side effect of this more central idea. Once you update the ADR, make sure to reflect the new structure to the rest of the PR. |
|
🤖 Finished Fix · ✅ Success · Started 6:36 PM UTC · Completed 6:46 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.48 |
…t in ADR 0093 Restructure ADR 0093 to lead with dynamic event-source routing as the central architectural idea — the notification destination is determined by which tracker originated the event, not by the code-output forge. The forge.Client → tracker.Client refactoring is presented as a consequence of this routing decision rather than the headline. Correct the claim that Jira has no emoji-reaction support: Jira Cloud supports reactions on comments but not on issues. The Reactor interface remains optional because Jira's partial support doesn't fit the interface which includes issue-level reactions. Update architecture.md cross-reference, tracker.Reactor doc comment, statuscomment package/Notifier docs, and test comments to reflect the new framing consistently. Addresses #6770
🔧 Fix agent — iteration 3 (human-triggered)Restructured ADR 0093 to emphasize dynamic event-source routing as the central idea (not the forge-to-tracker interface refactoring). Corrected Jira reaction claims across ADR, tracker.Reactor doc, statuscomment docs, and test comments. Updated architecture.md cross-reference to match. Fixed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 6:48 PM UTC · Completed 7:04 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.14 |
Summary
Route run-status notifications (comments, reactions, orphan reconciliation) through
tracker.Clientinstead offorge.Client, so the notification destination is determined by event provenance rather than the code-output forge.tracker.ClientwithDeleteComment; addtracker.Reactoras an optional interface for emoji reactionsstatuscomment.NotifierandReconcileOrphanedto usetracker.Clientwith(project, number)addressingsetupStatusNotifierGitHub,setupStatusNotifierGitLab,reconcile-status) to wrapforge.Clientintracker.NewForgeClient()jira.LiveClient.DeleteCommentfor Jira comment deletion supportChanges
internal/tracker/tracker.go— AddDeleteCommenttoClient, addReactorinterfaceinternal/tracker/forge_client.go— ImplementDeleteCommentand allReactormethodsinternal/tracker/jira_client.go— ImplementDeleteCommentinternal/tracker/fake_jira.go— AddDeleteCommentto test fakeinternal/forge/jira/client.go— AddLiveClient.DeleteCommentinternal/statuscomment/statuscomment.go— Replaceforge.Clientwithtracker.Client; reactions via optionalReactortype assertioninternal/cli/run.go— Wrap forge clients intracker.NewForgeClient();ClientFactoryreturnstracker.Clientinternal/cli/reconcilestatus.go— Wrap forge client forReconcileOrphaneddocs/ADRs/0093-tracker-routed-status-notifications.md— New ADRdocs/architecture.md— Cross-reference ADR 0093Testing
statuscommenttests updated and passing (94% coverage)trackertests passingreconcile-statusCLI tests updated and passingTestNotifier_ReactionsSkippedForNonReactorTracker— verifies Jira-backed trackers silently skip reactionsgo vet,gofmt, ADR lints, link checks passCloses #6767
Post-script verification
agent/6767-tracker-status-routing)0195363fd5399191a2df4f0f66b9a18e9c25a903..HEAD)