mozilla-releng / shipit

Ship It API & Frontend
9 stars 25 forks source link

Branch selection dropdown is missing branches #1392

Open ahal opened 5 months ago

ahal commented 5 months ago

I went to create a release for mozilla-vpn-client for the first time, but couldn't because the branch dropdown didn't display the releases/2.20.0 branch. It's also not possible to filter branches by typing into the input.

Ideally, this dropdown should contain all branches and it should be possible to type into the input, causing displayed branches to be filtered in real time.

I'm not 100% sure if this blocks VPN or not, I think there may be a way to restrict which branches show up there via the configs, so I'll investigate this avenue first. But as a general feature, this issue would be nice to have regardless.

ahal commented 5 months ago

Ah, the problem for VPN is that the /github/releases endpoint has a limit of 100 when querying Github: https://github.com/mozilla-releng/shipit/blob/f6de1d0cd40cd1ce03df75f0c1b196df77a5a58c/api/src/shipit_api/admin/github.py#L116

Further, the results returned are sorted by name. So what happened here is that mozilla-vpn-client has more than 100 branches (it's common practice to create PRs off of branches on the main repo there). So the release branches don't show up as they are pretty late in the alphabet.

I believe the best fix here is going to be adjust the Github GraphQL query to sort the results by date rather than by name.

ahal commented 5 months ago

On further investigation, it does not appear to be possible to tell Github to return branches sorted by date via the GraphQL api. So I think we'll have to use pagination to retrieve all branches, then do the sorting in shipit.

ahal commented 5 months ago

I'm also re-evaluating the "show all branches" part of this issue. I think as long as branches are sorted by date, the odds of the release branches being present are very high. At first I thought the release branches were missing because there were more than 10 branches newer than them.. but that's not the case.