Skip to content

Support Bugzilla needinfo webhooks - #6558

Open
ayoubdiourin7 wants to merge 5 commits into
mozilla:masterfrom
ayoubdiourin7:feature/bugzilla-needinfo-webhook
Open

Support Bugzilla needinfo webhooks#6558
ayoubdiourin7 wants to merge 5 commits into
mozilla:masterfrom
ayoubdiourin7:feature/bugzilla-needinfo-webhook

Conversation

@ayoubdiourin7

Copy link
Copy Markdown
Collaborator

Summary

  • Add an authenticated Bugzilla webhook endpoint.
  • Trigger a bug-fix run when a public bug receives needinfo?(hackbot@mozilla.tld).
  • Ignore events created by Hackbot itself.
  • Deduplicate retried Bugzilla webhook deliveries.
  • Add a dedicated Bugzilla needinfo mode and prompt.
  • Allow Hackbot to fetch the bug context, create a new Phabricator patch, or respond on Bugzilla.

Resolve #6469

Comment thread agents/bug-fix/hackbot_agents/bug_fix/config.py Outdated
Comment on lines +1 to +6
"""Inbound Phabricator and Bugzilla webhooks that trigger Hackbot runs.

Starts with Phabricator: an ``@hackbot`` mention in a comment on a Differential
revision triggers a bug-fix follow-up run against that revision. Authenticated
by Phabricator's HMAC signature (not the ``X-API-Key`` the other routes use), so
this lives on its own router without ``require_api_key``.
For Phabricator, an ``@hackbot`` mention on a Differential revision triggers a
follow-up run. For Bugzilla, a structured ``flag.needinfo`` modification aimed
at Hackbot triggers a bug-based follow-up. Each endpoint uses its webhook's own
authentication rather than the public API's ``X-API-Key``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make it generic, so we do not need to update on every webhook we support.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in fa90009

Comment thread services/hackbot-api/app/config.py Outdated
Comment on lines +68 to +70
_seen_bugzilla_events: TTLCache = TTLCache(
maxsize=4096, ttl=settings.bugzilla_webhook.dedupe_ttl_seconds
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work. This is a stateless service. Two requests could be handled with two different instances, then the cache will be different.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do DB-level de-duplication that we could even use for different use cases, not only this.

I will file an issue for that.

@ayoubdiourin7 ayoubdiourin7 Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The Phabricator cache _seen_transactions also has the same limitation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but that one is used only for performance concerns and reduce notwork requests, not as a source of truth, so it will not impact the end results.

Co-authored-by: Suhaib Mujahid <suhaibmujahid@gmail.com>
@ayoubdiourin7
ayoubdiourin7 marked this pull request as ready for review August 11, 2026 10:18
@ayoubdiourin7
ayoubdiourin7 requested a review from a team as a code owner August 11, 2026 10:18
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.

Support responding to needinfo (ni?) mentions from Bugzilla

2 participants