grimoirelab-perceval icon indicating copy to clipboard operation
grimoirelab-perceval copied to clipboard

[Feature request] Bugzilla backend should have --project filter option

Open lukaszgryglicki opened this issue 5 years ago • 5 comments

Bugzilla should have a --project proj_name flag to filter by project. For example freedesktop bugzilla or apache bugzilla both have product drop-down filter. Without that option, I have to pull all issues for apache or freedesktop and filter out almost all of them after checking bug['data']['product'][0]['__text__']. This should be similar to jira backend for example (--project PROJECT):

perceval jira
[2018-11-08 10:28:27,282] - Sir Perceval is on his quest.
usage: perceval [-h] [--category CATEGORY] [--tag TAG] [--from-date FROM_DATE]
                [-u USER] [-p PASSWORD] [--archive-path ARCHIVE_PATH]
                [--no-archive] [--fetch-archive]
                [--archived-since ARCHIVED_SINCE] [-o OUTFILE] [--json-line]
                [--project PROJECT] [--verify VERIFY] [--cert CERT]
                [--max-issues MAX_ISSUES]
                url

I was following jira and bugzilla documentation.

lukaszgryglicki avatar Nov 08 '18 10:11 lukaszgryglicki

BTW: why is Bugzilla data-source so terribly slow? Can it be improved?

lukaszgryglicki avatar Nov 08 '18 10:11 lukaszgryglicki

I guess this should be discussed with @sduenas and maybe @jgbarah

valeriocos avatar Nov 08 '18 11:11 valeriocos

I've been always reluctant this feature, especially in Bugzilla. Our philosophy with Perceval has been to download complete datasets from any datasources. That's why you wouldn't find any filter in any of the backends but in Jira and probably on Git. Those filters are there for historic reasons.

One of the reasons I always been against these kind of filters is because it might lead you to have problems following data. In Bugzilla it can happen when a bug is moved to one project to another; or from one module to another. You can end up having the same issue duplicated in your database if you don't take care of these problems.

Anyway, if the community thinks this is interesting for the project, I'd be happy to accept any PR implementing this feature.

sduenas avatar Nov 10 '18 15:11 sduenas

BTW: why is Bugzilla data-source so terribly slow? Can it be improved?

Get data from Bugzilla is a very complex process which involves downloading and parsing data of CSV, XML and HTML contents. I'm not sure if there's a faster way for implementing it.

There's another backend call it bugzillarest which works with newer versions of Bugzilla which implements a REST API.

sduenas avatar Nov 10 '18 15:11 sduenas

Anyway, if the community thinks this is interesting for the project, I'd be happy to accept any PR implementing this feature.

For a long time I have thought of doing that, but I never found the time. In any case, just for the record: I think it should be easy, following the model of how the git backend deals with branches (you can get commits only for a single branch, or a collection of branches). I think it is mainly a matter of filtering the query to Bugzilla, when Perceval gets the list of issues to retrieve.

jgbarah avatar Nov 12 '18 10:11 jgbarah