Page MenuHomePhabricator

Make wikibugs parse phab emails & send messages
Closed, DeclinedPublic

Description

I'm keeping this task parallel with T324; whichever is solved first will be the way to go ;-)

Wikibugs-l now also serves Phab e-mails, and they are received in good order at the wikibugs account. This is the format Phab uses:

Date: Mon, 6 Oct 2014 18:55:01 +0000
From: mmodell <noreply@phabricator.wikimedia.org>
Subject: [Maniphest] T453: Have phabricator send emails to wikibugs-l list for all task updates
Thread-Topic: T453: Have phabricator send emails to wikibugs-l list for all task updates
X-Herald-Rules: none, <1>, <2>
X-Phabricator-Projects: <#bugzilla-migration>
X-Phabricator-To: <PHID-USER-fn7qnpccfbitivgtw2rt>
X-Phabricator-Cc: <PHID-USER-hgn5uw2jafgjgfvxibhh>
X-Phabricator-Cc: <PHID-USER-fn7qnpccfbitivgtw2rt>
X-Phabricator-Cc: <PHID-USER-lluzkul4z7us4sxkayss>
X-Phabricator-Cc: <PHID-USER-3neel27i7dyu62jbbx2l>
X-Phabricator-Cc: <PHID-USER-z3l4i7dl52qicxtephy5>
X-Phabricator-Cc: <PHID-USER-v7vgzvvcw7v2umf737ri>
X-Phabricator-Cc: <PHID-USER-wil4b5lylrvf3krixlkl>
X-Phabricator-Cc: <PHID-USER-766idcqt4jkngnnuhnrj>
X-Phabricator-Cc: <PHID-USER-muirnivxp5hzppn2a3z7>
X-Phabricator-Cc: <PHID-USER-7ey733eainlhx5xqp4d3>
X-Phabricator-Sent-This-Message: Yes
X-Phabricator-Mail-Tags: <maniphest-status>, <maniphest-comment>


mmodell closed this task as "Resolved".
mmodell added a comment.

Done. The list is getting mail from maniphest, see here: https://www.mail-archive.com/wikibugs-l@lists.wikimedia.org/msg433371.html

TASK DETAIL
  https://phabricator.wikimedia.org/T453

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.

To: mmodell
Cc: Aklapper, mmodell, Qgil, chasemp, greg, Legoktm, Elitre, Eloquence, valhallasw, jeremyb

Of course, these mails are not parsed correctly, and the parser raises an Exception.

There are two possible routes to implement this;

  1. parse phab e-mails in the same intermediate format we use for bugzilla:
{'Date': 'Tue, 07 Oct 2014 19:02:44 +0000',
 'Subject': '[Bug 71681] Enable "import" on fa.wikivoyage',
 'X-Bugzilla-Assigned-To': 'wikibugs-l@lists.wikimedia.org',
 'X-Bugzilla-Changed-Fields': '',
 'X-Bugzilla-Component': 'Site requests',
 'X-Bugzilla-Flags': '',
 'X-Bugzilla-Keywords': 'shell',
 'X-Bugzilla-Priority': 'Normal',
 'X-Bugzilla-Product': 'Wikimedia',
 'X-Bugzilla-Reason': 'AssignedTo CC',
 'X-Bugzilla-Severity': 'enhancement',
 'X-Bugzilla-Status': 'PATCH_TO_REVIEW',
 'X-Bugzilla-Target-Milestone': '---',
 'X-Bugzilla-Type': 'changed',
 'X-Bugzilla-URL': 'https://bugzilla.wikimedia.org/',
 'X-Bugzilla-Version': 'wmf-deployment',
 'X-Bugzilla-Watch-Reason': 'None',
 'X-Bugzilla-Who': 'gerritadmin@wikimedia.org',
 'comment': 'Change 164933 merged by jenkins-bot:\n'
            'Enable "import" on fa.wikivoyage\n'
            '\n'
            'https://gerrit.wikimedia.org/r/164933\n',
 'commentnumber': 4,
 'email': 'gerritadmin@wikimedia.org',
 'realname': 'Gerrit Notification Bot',
 'shorturl': 'https://bugzilla.wikimedia.org/71681',
 'shorturltocomment': 'https://bugzilla.wikimedia.org/71681#c4',
 'summary': 'Enable "import" on fa.wikivoyage',
 'url': 'https://bugzilla.wikimedia.org/show_bug.cgi?id=71681'}

and use the same output logic. However, as you can see, the internal format (and thus also the output logic) are pretty bugzilla-specific, due to all the X-Bugzilla parameters. Those are also used in the output logic. In addition, Bugzilla concepts are used extensively, such as the Product»Component setup, as well as the names of priorities and severities. Do we have severities in Phab?

  1. Only use the same input (from redis) and output (to IRC). I think this will be less work, but by keeping the underlying base, we keep the current stability.

However. The mail format used by phab is still not machine-parsable, so we end up needing the same hacks as in bugzilla. To make matters worse, the Phab format looks even less machine readable -- different contexts are only separated by newlines, and the format is more 'human' than bugzilla's. A few examples:

qgil changed the title from "Wikibugs IRC bot should stream Phabricator activity" to "IRC bot to report Phabricator activity exactly like Wikibugs does with Bugzilla".
  • I have no clue what that would to with titles with "'s
greg added a blocking task: T504: Have wikiphabot follow the same channel announce rules as wikibugs.

(note the 'blocking')

jdforrester moved this task to Need discussion on the Wikimedia Phabricator Day 1 workboard.

(even for a human that has two possible meanings)

Revi added a subscriber: Revi.

vs

qgil added subscribers: mmodell, Rush, yuvipanda.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

valhallasw raised the priority of this task from to Lowest.
valhallasw updated the task description. (Show Details)
valhallasw changed Security from none to None.
valhallasw added subscribers: Aklapper, chasemp, mmodell and 11 others.

I think the phabot (T571) might be a better way to go since it's already got the right information in much more machine-friendly format, all we have to do is deal with the channel rules (and yet another irc bot in each relevant channel)

Phabot has other nice features as well - it will speak in the channel every time someone mentions a task like TXXX, phabot will respond with the task title and a link to the maniphest page for said task. It's really helpful in the Phabricator channel. Also I believe we can enable that feature only in channels like -dev where it might be considered useful.

greg added a comment.Oct 8 2014, 6:11 AM
In T571#9338, @mmodell wrote:

I think the phabot (T571) might be a better way to go since it's already got the right information in much more machine-friendly format, all we have to do is deal with the channel rules (and yet another irc bot in each relevant channel)

I think you mean T324, right? But yes, I agree that phabot is the right approach; use the built in tools and all that. The added features of phabot see nice as well.

@greg indeed I meant T324, thank you.

valhallasw closed this task as Declined.Oct 12 2014, 11:06 AM
valhallasw claimed this task.

We are going the PHP-phawikibugs route.