Feature request: is it possible to add a query filter on "topics:"
This is quite github specific feature request. However, maybe a more generic "repository labels" would make sense here. For example we already have this sort of idea for supporting filtering by archived/fork/etc but that is a static list. Then we could expose in the query parser topic:.
- RawConfig is how we do archived/forked/etc https://sourcegraph.com/github.com/sourcegraph/zoekt@df7a7e7162cf7d7af4d4cdde3701c57950830676/-/blob/query/query.go?L40:6-40:15#tab=references
- I imagine to encode topics we would store a Set (map[string]struct{}) per repo. Probably doesn't need to live in memory per shard given the low amount of data.
FYI I don't think this would get worked on anytime soon, but happy to guide anyone who is motivated to do it.
A generic labels/tags/topics functionality that could be populated by "something" per type of backend (topics for GH) (not sure if others have similar functionality) sound like a good approach, and would solve my needs fine.
For now, I have worked my way around it with a script that uses the GH api to translate topics => repo-names and construct a zoekt query with a repo regex.
A generic labels/tags/topics feature would be great.
@keegancsmith I can try to look at this feature, but I need details on the different modifications to be made. Can you guide me?
@xavier-calland
Here is how I would get started
- The labels would probably have to live here. Why? For Sourcegraph we have an optimization that updates to metadata don't cause a reindex (see .meta files in the code). I think repository labels shouldn't cause a full reindex.
- Indexing: Pick a code host (probably GitHub) and pipe the data from the code host all the way to the builder, which writes the metadata to disk.
- Query language: you have to extend the query language. You could add EG a
label:filter. Check out query.go and parse.go for inspiration. - Matchtree: The final piece is to use a match tree to skip the repos that don't have the correct label. Checkout
RepoSetin matchtree.go or any of the other match trees there for inspiration.
EDIT: 5. UI: It would be nice to show the labels in UI, too.
Assign me to this issue please? I could do similar issue in the future.
I will use this template https://github.com/sourcegraph/zoekt/pull/370/files
Excuse me I di not finished yet.
I still did not finished: https://github.com/sourcegraph/zoekt/pull/939
@hanskr could be a great feature, would you still enjoy it?
I am not in the group. Should I register?
Sorry that linear issue comment we just use at Sourcegraph to help not lose track of stuff. All issue tracking for zoekt happen on this github issue tracker.
I am confused. I started to contribute. See my PR at : https://github.com/sourcegraph/zoekt/pull/939 .
Who is assigned to this issue please?
I've assigned it to you to make it clear you are interested in implementing this.
Thank you!
Hello.
Sorry for the BIG BIG delay!
I am currently doing a research publication in a newspaper. I really hope it will published.
I need zoekt. I will continue the zoekt PR as soon as I can.