Closed Bug 1437384 Opened 6 years ago Closed 6 years ago

phabbugz_feed.pl in PhabBugz extension should be extended to also query for new users in Phab

Categories

(bugzilla.mozilla.org :: Phabricator Integration, enhancement)

Production
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dkl, Assigned: dkl)

References

Details

When a new user(s) has been added to Phabricator that is also linked to an account in BMO, we should be able to periodically check for the user(s) and make changes to Phab or BMO when that happens. Normally when a user uses BMO for authentication to Phab, they automatically get linked together where the BMO ID is stored in the Phab database.

We can store a value (epoch of account creation) in the BMO database to enable us to figure out where the last query left off. So we will only need to process one or a few new accounts at a time.

When a new user is detected in Phabricator we will do the following:

1) Create a BMO search query that looks for the following:
   - attachments with the filename matching ^phabricator-D(\d+)
   - bugs that are private to one or more groups
   - the new user is playing a role on the bug such as cc'ed, assignee, qa contact
     or reporter
2) Parse each revision ID from the attachment filename and update each revision
   adding the new user as a subscriber to the revision. If the user is already a 
   subscriber (unlikely) it will be a no-op and harmless.
3) Update the stored epoch value in the BMO phabbugz table and set to the last
   successful epoch processed.
4) Run next query starting at the stored epoch. If the process fails, then we
   always start at the last successful epoch executing the last failed entries.
Pushed to bmo/master
Assignee: nobody → dkl
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.