Skip to content

Bug model derived from Webhook payload #1208

@leplatrem

Description

@leplatrem

The current bug model has a comment and an attachment field.

comment: Optional[WebhookComment] = None
attachment: Optional[WebhookAttachment] = None

Because that is what the Webhook payload sends us when target == 'comment' or target == 'attachment'.

Example with this event:

event: {
        "target": "attachment",
        "changes": null,
        "time": "datetime.datetime(2025, 10, 16, 11, 52, 57, tzinfo=TzInfo(0))",
        "user": {
          "login": "[email protected]",
          "real_name": "Mathieu Leplatre [:leplatrem]",
          "id": 526079
        },
        "routing_key": "attachment.create",
        "action": "create"
},
bug: {
        "priority": "",
        "resolution": "",
        "type": "enhancement",
        "keywords": [],
        "is_private": false,
        "creator": "[email protected]",
        "assigned_to": "[email protected]",
        "see_also": [
          "https://mozilla-hub.atlassian.net/browse/RMST-161"
        ],
        "whiteboard": "[remote-settings]",
        "comment": null,
        "groups": null,
        "status": "NEW",
        "id": 1984079,
        "cf_fx_points": "",
        "attachment": {
          "content_type": "text/x-phabricator-request",
          "flags": [],
          "is_private": false,
          "is_obsolete": false,
          "description": "Bug 1984079 - Iterate through list of signatures r?say-yawn",
          "file_name": "phabricator-D268863-url.txt",
          "id": 9520447,
          "is_patch": false,
          "creation_time": "datetime.datetime(2025, 10, 16, 11, 52, 57, tzinfo=TzInfo(0))"
        },
        "summary": "Add support for multiple signatures in the collection metadata",
        "product": "Firefox",
        "severity": "--",
        "component": "Remote Settings Client",
        "flags": []
      }

But conceptually, a bug has several attachments and comments.

We should probably split that model and introduce a WebhookRequestBug model that differs from just Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions