Skip to content

feat(admin): warn when a host's webhooks never carry comment events - #27

Merged
ngoyal16 merged 1 commit into
mainfrom
feat/comment-events-warning
Nov 22, 2026
Merged

ngoyal16 merged 1 commit into
mainfrom
feat/comment-events-warning

Conversation

@ngoyal16

Copy link
Copy Markdown
Contributor

Summary

Fixes #25. With only a GitLab system hook, merge request events arrive but comments never do, so @bot commands and learnings fail silently.

  • Store: HookStats summarises verified deliveries per host from the webhook history:
    • verified deliveries;
    • comment events (GitLab note, GitHub issue_comment and pull_request_review_comment, Bitbucket pullrequest:comment_created);
    • GitLab System Hook deliveries.
      Unverified deliveries don't count.
  • Code hosts page: a host that gets verified deliveries but no comment events shows a "No comment events" badge, plus a warning in its webhooks panel with the fix for its platform:
    • GitLab with only system hook deliveries: "GitLab system hooks don't send comments, so @review-bot commands and learnings from replies won't work. Add a group or project webhook with Comments…"
    • GitLab with other hooks: turn on Comments.
    • GitHub: subscribe to Issue comment and Pull request review comment.
    • Bitbucket: turn on the Comment created trigger.
  • Setup: an optional "Receive comments" step appears once deliveries arrive. It shows the same reason, and is done once comment events arrive for every host.
  • Hints and docs: the Add webhook hint for GitLab and docs/gitlab.md say a system hook alone isn't enough. A system hook plus group hooks is fine, since the console drops the duplicate MR event.

Not done: the issue's suggestion 2, checking hooks through the GitLab API. It needs Maintainer access on each project or group. The history-based warning catches the reported case without that.

Testing

  • make test-db (Postgres 17) passes.
  • New tests:
    • TestCommentEventsWarning: no deliveries means no warning; system-hook-only shows the warning (an unverified note doesn't count); the Setup step appears; a verified note clears both.
    • TestCommentWarningText: GitHub, Bitbucket, and GitLab with group hooks.
    • TestHookStats (Postgres).
  • UI typechecks and builds. Not checked in a browser.

🤖 Generated with Claude Code

A GitLab system hook sends merge request events but never comments, so
with only a system hook, @bot commands and learnings fail silently:
deliveries are green and nothing points at the cause.

From the verified webhook history, the Code hosts page now flags a host
that receives deliveries but no comment events, with a platform-specific
fix (system-hook-only GitLab hosts get the system hook explanation).
Setup gets an optional "Receive comments" step once deliveries arrive.
The Add webhook hint and docs/gitlab.md say a system hook alone is not
enough.

Closes #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ngoyal16
ngoyal16 merged commit b8ed340 into main Nov 22, 2026
14 checks passed
@ngoyal16
ngoyal16 deleted the feat/comment-events-warning branch November 22, 2026 07:34
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.

GitLab: warn when comment events never arrive (system hook only), so @bot commands fail silently

1 participant