Hi everybody, since the bug-wranglers are under heavy load, the question was raised (again) if we can't have some automatic process to assign bugs. robat2 told me that something like this is planed for bugzilla3 . So I thought it might be a good idea to have something ready and tested until then. Attached is an python script that is supposed to decide if a given bug is ready to be assigned, to decide to whom the bug should be assigned and to actually assign it, if asked to. The script has some dependencies. Listed below are the versions I tested with. www-client/pybugz-{0.7.4,0.8.0} sys-apps/portage-2.2_rc42 app-portage/gentoolkit-9999 (r685), 0.2 won't work, 0.3_rc7 should work Other versions might work as well. If the script is called without arguments. It fetches all open bugs assigned to b-w@g.o and prints out if it would assign it and to whom it would assign the bug. Adding --do-it to the command line makes it actually do what it told you. The script tries to create too much spam. See the comments for the reasoning behind the decision not to handle a bug. Currently it would assign around 50% of the bugs. You can add a search string to the command line. In this case it will fetch every bug that matches your search. (ignoring assignee, status, etc...) If you use it to assign a bug it adds a comment. The comment can be seen in bug 287895. I'd like everyone who is interested to review and test it. Feel free to add comments, suggestions, bugs.
Created attachment 206250 [details] bw-script v1
(In reply to comment #0) > The script tries to create too much spam. As you might have guessed, the opposite is the case. :)
The scripts gets all it's information from $PORTDIR (using equery meta and portage). So make sure you synced recently.
er...
Created attachment 206260 [details] bw-script v2 support for --help added
Created attachment 206286 [details] bw-script v3 * show packages found in the summary for bugs it would assign * show word <-> package matches if --debug is enabled
(In reply to comment #6) > Created an attachment (id=206286) [details] > bw-script v3 > > * show packages found in the summary for bugs it would assign > * show word <-> package matches if --debug is enabled > $ bw-script.py bugs fetched: 113 ---------------- 281945 apache2 init.d script fails to start during normal boot but works afterwards not done: A @g.o person or myself commented on the bug. ---------------- 283108 mount invokes oom-killer while mount the dvd drive sometimes not done: A @g.o person or myself commented on the bug. ---------------- Traceback (most recent call last): File "/data/scripts/bw-script.py", line 439, in <module> main() File "/data/scripts/bw-script.py", line 288, in main cpv_list, pv_list = get_packages_from_summary(summary, options) File "/data/scripts/bw-script.py", line 137, in get_packages_from_summary new_pkg = get_pv_from_word(word) File "/data/scripts/bw-script.py", line 75, in get_pv_from_word return portage.pkgsplit(pkgs[0])[0] TypeError: 'NoneType' object is unsubscriptable
Can't reproduce. Is this bug 285511? Test with ./bw-script -s "<bug-summary>". Works here with portage-{2.1.6.13, 2.2_rc42, 2.2_rc44}.
jlec told me on irc that he can't reproduce the bug anymore. Here is an overview of the current features. bw-script as attached to bug 287911 as v3 Features: * Doesn't touch anything unless --do-it is given on the command line. * Detection and resolution of identical duplicates (mostly produced by refreshing the browser window). * Tries to detect and ignore overlay bugs (as they need to be assigned to the overlay maintainer and not the package maintainer). * Handles bug only if they are older than 30 minutes (to give the reporter and others time to add stuff). * Ignores bugs that have been touched by its own email address or by @gentoo.org emails. * Parses the summary line to get a list of packages. Uses only cat/pkg occurrences if present. Otherwise it tries to find package names. It uses a substitute and a filter list to get more correct matches and to prevent false positives (like "less"). * Uses gentoolkit.equery.meta facility to get the assignees for packages. Those it relies on an uptodate portage tree. * Uses a heuristic to decide if a bug contains enough information to get assigned. It assigns if it find either of: emerge --info, an attachment, guesses that it is a stable, keyword or version bump request * Adds a comment to every bug it assignees. See bug 287895. TODO: * Add a heuristic to detect if a bug might be a duplicate of some other bug and don't assign in this case.
<personal opinion> I think people should write whatever scripts they want to make this better. Run it against bugs. If bugs falls over, we will block it and you can come chat with us about how to make bugs not fall over. This is nominally our policy today; and it seems to have worked well. </personal opinion> I'm not sure what the request is here. I think mgorny wrote some JS to do something like this (https://github.com/mgorny/bug-assign-user-js) which users can hoist into their browser to use. If developers want to author scripts against the bugzilla interface, please do so. If we eventually build a working script and we want infra to host such a script, or setup a service account for bugzilla, please open a new bug. -A