CodeTriage icon indicating copy to clipboard operation
CodeTriage copied to clipboard

Store labels in the db.

Open kevincox opened this issue 9 years ago • 4 comments

The primary key of repo, label, issue will allow fast filtering of issues matching a label in a repo. This is the most email used for sending emails.

This is progress towards #498

kevincox avatar Sep 20 '16 23:09 kevincox

Could we use a postgres array for this? The upside would be less to worry about, the downside is that it would be harder to query all issues against a specific tag. what do you think @prathamesh-sonpatki ?

schneems avatar Sep 22 '16 14:09 schneems

We can split this into tables, labels and issue_labels.

labels will have name and repo_id. issue_labels will have label_id, issue_id and repo_id.

Then we will be able to show all issues for a particular label, query them and do all sorts of things.

prathamesh-sonpatki avatar Sep 22 '16 15:09 prathamesh-sonpatki

@schneems My first thought was postgres arrays but it depends on how we want to query the data. We should looks back at #498 first and decide what queries we want to support.

@prathamesh-sonpatki I don't know what queries that split will get us over the current situation. It will save a couple of bytes (maybe not actually because of the extra table) but I don't see any benefit over that.

kevincox avatar Sep 22 '16 19:09 kevincox

I think there's probably a use case for searching for issue labels cross-repo, e.g. language:ruby label:help-wanted. This PR could support that with a new index. I think PG arrays are a red herring.

@kevincox Can you rebase?

nateberkopec avatar May 27 '17 23:05 nateberkopec