#3748 Automate review stats
Closed: Fixed None Opened 10 years ago by ankursinha.

= problem =
Would it be possible to automatically run the review stats script on fedora infrastructure and send out a mail to the devel list?

= analysis =
Rakesh used to do this. I've taken over for the time being. However, it'd be great if the script could be run on fedora infra, and results posted on the devel list.

= enhancement recommendation =
Script at:

https://fedorahosted.org/triage/browser/scripts/bzReviewReport.py

A cron job would do it?


Hi,

Script will need some re-organisation and few additions (though minor), if one wants to automate it. Moreover, it hasn't been run since year now. May need update some testing and corresponding fixes as well.

Regards,

I tried running it today. It's going to take some fixes. It isn't working at all at the moment:

{{{

[ankur@localhost scripts(master +=)]$ python bzReviewReport.py -r rev-com -s 2014-04-01 -e 2014-04-13 -n "sanjay.ankur@gmail.com" -v
Report for 12 days.
Getting all package review bugs (be patient, this may take a while) ....
Bugzilla Query: {'product': 'Fedora', 'value0-0-0': 'fedora-review+', 'chfieldfrom': '2014-04-01 00:00:00', 'type0-0-0': 'equals', 'component': 'Package Review', 'field0-0-0': 'flagtypes.name'}
Traceback (most recent call last):
File "bzReviewReport.py", line 318, in <module>
bug_list = bz.query(bug_list_query)
File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 765, in query
r = self._query(query)
File "/usr/lib/python2.7/site-packages/bugzilla/rhbugzilla.py", line 328, in _query
ret = self._proxy.Bug.search(query)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in call
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 71, in request
return self.parse_response(resp)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1473, in parse_response
return u.close()
File "/usr/lib64/python2.7/xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 53: 'value0-0-0 is not a valid parameter for the Bugzilla::Bug::match function.'>
[ankur@localhost scripts(master +=)]$
}}}

I'll work on it when I find free cycles this week.

Thanks,
Warm regards,
Ankur

There have been a lot of python-bugzilla changes in the last while. ;(

You might check with tibbs or some other folks that have worked on our other bugzilla facing scripts.

I have done some modification to this script last year. Let me share those changes with you.

Patch to existing script is at -> http://paragn.fedorapeople.org/bzReviewReport-modified.patch

Modified script is available at -> http://paragn.fedorapeople.org/bzReviewReport-new.py

Replying to [comment:5 paragn]:

I have done some modification to this script last year. Let me share those changes with you.

Patch to existing script is at -> http://paragn.fedorapeople.org/bzReviewReport-modified.patch

Modified script is available at -> http://paragn.fedorapeople.org/bzReviewReport-new.py

Thanks Paragn,

The patch gets it working again :)

Kevin, what modifications would you require me to make to get the script automated? At the present, it gives an output.txt file with results.

Ankur

Oh, and what group do I need to be a part of to commit the patch to git? "triagers"?

Replying to [comment:7 ankursinha]:

Oh, and what group do I need to be a part of to commit the patch to git? "triagers"?

You need to be in the sysadmin group and be able to login to lockbox01. ;)

I can assist you getting there. We likely will want to run this on bapp02. Take a look at some of the other scripts we run there to see how they fit in. Perhaps fas::invalid-cc or gather-easyfix::build would be ones to look at.

Whats the status here?

I'm adding easyfix here in hopes some apprentices might find it interesting.

Basically this needs to be setup in ansible on sundries01 just like fedora_owner_change role.

So, add new role just like that one and add that role to the sundries playbook.

Will look into it during the week of Aug 31 - Sept 6th.
If there will be no updates from me during this time - feel free to re-assign.

I've tested the script and probably it's not working properly, I've tried a range of periods since one week until two years to all types of reports and all returned 0.

I'll work on this and try to fix this main problem and to create an alternative to send e-mails to the mail list instead of save the report in a file.

About the role, how often should this script run?

Make the script up to date with the current Bugzilla API
bzReviewReport.py.patch

I made the bzReviewReport script compatible with the current Bugzilla API so that it works again.

I'll continue with setting it up as an automated job in ansible.

I have added a patch to enable the script to be run as a cron job on sundries similarly to the fedora_owner_change role setup. However, as it is, the script only generates a data file to a current working directory. I will now proceed with setting it up so that it sends emails with the review stats to the fedora-devel mailing list, if you agree.

Sounds good to me. ;)

Thanks for working on this...

Hello, actually people on fedora-devel list suggested the script could be used for badge awards:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/I4D77CXDEWEPQCQLEVIRIDQJH2LAEGGH/

So instead of sending the stats weekly, it would be used to give badges for completed reviews :). I quite like the idea. Related ticket: https://fedorahosted.org/fedora-badges/ticket/101. I'll try to make an alternative patch for fedora-badges setup and I might tweak the script a little too. Perhaps it will work out.

Sure, there could well be badges based on those fedmsgs. Of course it cannot know things from before we got bugzilla -> fedmsg enabled, but moving forward the normal badges process should be able to award badges as messages come in.

I still think perhaps the weekly email would be nice though to highlight what has happened in the last week. Badges you aren't going to know about unless you specifically go look.

I've replied to the devel thread, we can see where it goes. ;)

Hello Kevin, I have just uploaded final but untested infra setup for bz-review-request script. It should send emails to devel@lists.fedoraproject.org. Please, let me know if you have any comments or notes to what can be improved.

Applied. Thanks!

We should see if everything is good when it runs...

Send Reviews Weekly from nobody@fedoraproject.org address so that it is not rejected by devel@lists.fedoraproject.org
0001-Send-Reviews-Weekly-from-nobody-fedoraproject.org.patch

Hey Kevin,

I don't have access to maillog on sundries so I just followed what we agreed on and changed From: field to nobody@fedoraproject.org.

Applied, thanks.

I guess we will see on monday...

Login to comment on this ticket.

Metadata