feature: group the Forgejo issue-link confirmation comment per issue instead of per linked spec #36
No reviewers
Labels
No labels
breaking
bug
ci
dependencies
documentation
feature
security
skip-changelog
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thierryade/backend!36
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/group-issue-link-comments"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #35
sync_confirmation_commentused to post/edit one comment perSpecVersionIssueLink(the comment id tracked on the link itself viaconfirmation_comment_id), so an issue linked to several specs got spammed with one "🔗 Spec liée" comment per spec.Changes
ForgejoIssueCommentmodel (apps/specs/models.py), tracking a single comment id per(repo_full_name, issue_number)pair, replacing the per-linkconfirmation_comment_idfield (removed). Migration0013.sync_confirmation_comment(repo_full_name, issue_number)(new signature) now gathers everySpecVersionIssueLinkon that issue and builds one grouped "🔗 Specs liées" comment, edited in place afterward, never reposted.(repo_full_name, issue_number):SpecViewSet.create_issue,SpecVersionIssueLinkViewSet.perform_create(single-link sites)ForgejoIssueWebhookView.post,poll_stale_issue_links-- deduped to one dispatch per(repo, issue)pair, since several changed/created links can share a pair in the same sync and dispatching once per link would race two task runs to create the sameForgejoIssueCommentrowapps.exports.tasks.generate_pdf_export's PDF-export-completion hook (an extra call site found while grepping, not called out in the original report, but it dispatched the old per-link signature too)apps/specs/admin.py: droppedconfirmation_comment_idfrom the readonly fields, registered aForgejoIssueCommentAdminfollowing the same convention asForgejoRepoWebhookAdmin.apps/specs/test_issue_sync.py,apps/specs/test_issue_links.py, andapps/exports/tests.py; added tests for (a) two links on the same issue grouping into onecreate_commentcall containing both specs, (b) a no-op when the(repo, issue)pair has zero links, and (c) dedup at the webhook and poll call sites (two links detected/changed on the same issue dispatch exactly once).Test plan
pytest apps/specs apps/exports-- 175 passed locally.pytest apps(full suite) -- 210 passed locally.🤖 Generated with Claude Code
https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm
📊 Rapports Argus pour cette PR