Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch selection dropdown is missing branches #1392

Open
ahal opened this issue Jan 23, 2024 · 3 comments
Open

Branch selection dropdown is missing branches #1392

ahal opened this issue Jan 23, 2024 · 3 comments

Comments

@ahal
Copy link
Contributor

ahal commented Jan 23, 2024

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
Copy link
Contributor Author

ahal commented Jan 24, 2024

Ah, the problem for VPN is that the /github/releases endpoint has a limit of 100 when querying Github:

def list_github_branches(owner, repo, limit=100):

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
Copy link
Contributor Author

ahal commented Jan 24, 2024

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 ahal changed the title Branch selection dropdown should list all branches Branch selection dropdown is missing branches Jan 24, 2024
@ahal
Copy link
Contributor Author

ahal commented Jan 24, 2024

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.

ahal added a commit to ahal/shipit that referenced this issue Jan 24, 2024
This endoint currently only fetches up to 100 branches from Github as
this is the maximum number of objects you can get from a single query to
the GraphQL endpoint.

But `mozilla-vpn-client` has well over 100 branches, and the `release`
branches were being excluded from the query. Fix this by using
pagination until all branches have been returned.

Issue: mozilla-releng#1392
ahal added a commit to ahal/shipit that referenced this issue Jan 24, 2024
This endoint currently only fetches up to 100 branches from Github as
this is the maximum number of objects you can get from a single query to
the GraphQL endpoint.

But `mozilla-vpn-client` has well over 100 branches, and the `release`
branches were being excluded from the query. Fix this by using
pagination until all branches have been returned.

Issue: mozilla-releng#1392
ahal added a commit to ahal/shipit that referenced this issue Jan 24, 2024
This endoint currently only fetches up to 100 branches from Github as
this is the maximum number of objects you can get from a single query to
the GraphQL endpoint.

But `mozilla-vpn-client` has well over 100 branches, and the `release`
branches were being excluded from the query. Fix this by using
pagination until all branches have been returned.

Issue: mozilla-releng#1392
ahal added a commit to ahal/shipit that referenced this issue Jan 24, 2024
This endoint currently only fetches up to 100 branches from Github as
this is the maximum number of objects you can get from a single query to
the GraphQL endpoint.

But `mozilla-vpn-client` has well over 100 branches, and the `release`
branches were being excluded from the query. Fix this by using
pagination until all branches have been returned.

Issue: mozilla-releng#1392
ahal added a commit that referenced this issue Jan 25, 2024
This endoint currently only fetches up to 100 branches from Github as
this is the maximum number of objects you can get from a single query to
the GraphQL endpoint.

But `mozilla-vpn-client` has well over 100 branches, and the `release`
branches were being excluded from the query. Fix this by using
pagination until all branches have been returned.

Issue: #1392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant