Page MenuHomePhabricator

Weekly phabricator-reports mail: List active Herald rules authored by users not recently active
Closed, ResolvedPublic

Description

With T108586 in mind, expand the weekly (and currently broken, see T244677) stats email to include Herald rules authored by Phab users not active for six months.

Note that some results will still be valid and should remain active, e.g. adding tags, when created by a previous team member who left.

Note: Might require first to allow accessing the phabricator_herald DB table.

Details

Event Timeline

Aklapper triaged this task as Low priority.Feb 25 2020, 1:51 PM
Aklapper created this task.

(Realized this when looking at H313 whose author was last active in April 2019.)

Change 574751 had a related patch set uploaded (by Aklapper; owner: Aklapper):
[operations/puppet@production] phabricator weekly changes email: List Herald rules by inactive users

https://gerrit.wikimedia.org/r/574751

Change 575030 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] mariadb: grant phabricator stats user access to herald database

https://gerrit.wikimedia.org/r/575030

Mentioned in SAL (#wikimedia-operations) [2020-02-26T16:00:25Z] <jynus> deploy new grants to phabricator stats user to database on m3 T246105

Change 575030 merged by Dzahn:
[operations/puppet@production] mariadb: grant phabricator stats user access to herald database

https://gerrit.wikimedia.org/r/575030

Change 574751 merged by Dzahn:
[operations/puppet@production] phabricator weekly changes email: List Herald rules by inactive users

https://gerrit.wikimedia.org/r/574751

Dzahn added a subscriber: Dzahn.Feb 26 2020, 5:35 PM

after new GRANTs have been deployed:

 phab1001:~] $ mysql -u phstats -p -h m3-master.codfw.wmnet phabricator_herald
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Tested query manually. Takes 3 to 4 seconds.

Merged change.

mysql:phstats@m3-master.codfw.wmnet [phabricator_herald]> SELECT CONCAT("https://phabricator.wikimedia.org/H", h.id) AS heraldRule,u.userName AS author FROM phabricator_herald.herald_rule h INNER JOIN phabricator_user.user u WHERE h.authorPHID = u.phid AND h.isDisabled = 0 AND h.authorPHID NOT IN (SELECT trs.authorPHID FROM phabricator_maniphest.maniphest_transaction trs INNER JOIN phabricator_user.user u WHERE FROM_UNIXTIME(trs.dateModified) >= (NOW() - INTERVAL 6 MONTH) AND trs.authorPHID = u.phid) ORDER BY heraldRule;

+----------------------------------------+---------------------+

heraldRuleauthor

+----------------------------------------+---------------------+

+----------------------------------------+---------------------+

20 rows in set (3.439 sec)

mysql:phstats@m3-master.codfw.wmnet [phabricator_herald]>
Dzahn raised the priority of this task from Low to Medium.Feb 26 2020, 5:35 PM
Dzahn closed this task as Resolved.Feb 26 2020, 5:40 PM
Dzahn claimed this task.

The script sending out the weekly mail has been updated by puppet.

Info: Computing checksum on file /usr/local/bin/project_changes.sh
Info: /Stage[main]/Profile::Phabricator::Main/Phabricator::Logmail[projectchanges]/File[/usr/local/bin/project_changes.sh]: Filebucketed /usr/local/bin/project_changes.sh to puppet with sum 2b2cf1caed33e95c033e27afe4907373

I edited the recipient address manually and ran the script. I received a stats mail and it has the new herald rules in it. Ran puppet to revert my change to recipient address back to the list.

This is resolved.