feature: group the Forgejo issue-link confirmation comment per issue instead of per linked spec #35

Closed
opened 2026-11-01 18:48:33 +00:00 by Gilles · 0 comments
Owner

Today apps.specs.tasks.sync_confirmation_comment posts/edits one confirmation comment per SpecVersionIssueLink (the comment id is tracked via SpecVersionIssueLink.confirmation_comment_id). When a single Forgejo issue is linked to several specs, this spams the issue with one "🔗 Spec liée" comment per spec instead of a single grouped one.

Fix:

  • Add a ForgejoIssueComment model tracking one comment id per (repo_full_name, issue_number) pair, replacing the per-link confirmation_comment_id field.
  • Rewrite sync_confirmation_comment(repo_full_name, issue_number) to gather every link for that issue and build a single grouped "🔗 Specs liées" comment body, edited in place on later syncs.
  • Update the four dispatch call sites (SpecViewSet.create_issue, SpecVersionIssueLinkViewSet.perform_create, ForgejoIssueWebhookView.post, poll_stale_issue_links) accordingly, deduping to one task dispatch per (repo, issue) pair where several links can share one issue in the same sync.
Today `apps.specs.tasks.sync_confirmation_comment` posts/edits one confirmation comment per `SpecVersionIssueLink` (the comment id is tracked via `SpecVersionIssueLink.confirmation_comment_id`). When a single Forgejo issue is linked to several specs, this spams the issue with one "🔗 Spec liée" comment per spec instead of a single grouped one. Fix: - Add a `ForgejoIssueComment` model tracking one comment id per `(repo_full_name, issue_number)` pair, replacing the per-link `confirmation_comment_id` field. - Rewrite `sync_confirmation_comment(repo_full_name, issue_number)` to gather every link for that issue and build a single grouped "🔗 Specs liées" comment body, edited in place on later syncs. - Update the four dispatch call sites (`SpecViewSet.create_issue`, `SpecVersionIssueLinkViewSet.perform_create`, `ForgejoIssueWebhookView.post`, `poll_stale_issue_links`) accordingly, deduping to one task dispatch per `(repo, issue)` pair where several links can share one issue in the same sync.
Sign in to join this conversation.
No description provided.