gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
9.04k stars 1.35k forks source link

Launchpad: API search for PRs on GitLab #3788

Open sergeibbb opened 4 days ago

sergeibbb commented 4 days ago

This issue is a follow-up of #3543


Todo

Follow-ups

Testing notes

Connect both GitLab and GitHub. Search by:

Disconnect GitHub. Search by a text query.

sergeibbb commented 3 days ago

Hi @axosoft-ramint , @eamodio

I have a following question. It looks like GitLab's GraphQL is not able to search for PRs in general. It can does the following:

Now for the Launchpad "get for a user" set of requests is used but retrieving only open ones: state:opened

Also there is a REST API endpoint that just searches everywhere, e.g.: https://gitlab.com/api/v4/search?scope=merge_requests&search=flight

What I can do:

  1. use "get by user" requests withtout state:opened limitations. By doing that I loose PRs that are not associated with the current user.
  2. use "get by project" request for currently opened repositories. By doing that I loose PRs that belong to other projects.
  3. use REST API endpoint. The results can be too wide, but now we have same for GitHub.

For now I'm going to continue with # 3 until we choose another option or find a better solution.

Also, maybe I just wrong about GraphQL possibilities and it can search, and I just haven't found how to do that.

What do you think?

axosoft-ramint commented 3 days ago

I feel like since what we're doing with GitHub on a search is "search everywhere", we should have equivalent behavior for GitLab. So 3 sounds right.