shields icon indicating copy to clipboard operation
shields copied to clipboard

[GitHub] add latest release of a branch badge

Open karolwydmuch opened this issue 2 years ago • 3 comments

karolwydmuch avatar Oct 18 '23 12:10 karolwydmuch

Messages
:book: :sparkles: Thanks for your contribution to Shields, @karolwydmuch!

Generated by :no_entry_sign: dangerJS against a63bc374f98fdad46f2720764b74b75f06e22359

github-actions[bot] avatar Oct 18 '23 12:10 github-actions[bot]

Hi. Thanks for opening a PR.

A badge should be quick to render. In most contexts where our badges are displayed there's a hard limit of 4 seconds on a request. In general we try usually avoid accepting badges that require more than one network call to render for this reason.

This means badges that require iterating over multiple pages of API response are impractical. They end up being too slow to render in a lot of cases.

I had a look to see if it would be possible to obtain this information in a single GraphQL query but it seems this is not exposed by the GraphQL API. https://docs.github.com/en/graphql/reference/objects#release

If we can't find a more efficient way to query it, I'm inclined to decline this one.

Out of interest, and also for testing purposes, do you have an example of a repo that publishes releases against different branches? It is not something I have come across before and I don't think this corresponds to an open feature request.

chris48s avatar Oct 19 '23 19:10 chris48s

@karolwydmuch any thoughts following Chris's comments? :)

PyvesB avatar Jun 01 '24 12:06 PyvesB

Given that there hasn't been any activity for a while, I'm going to close this pull request. Feel free to ping us or reopen it if you get a chance to look into it again. 😉

If others think that repository level projects would be an option and want to pick this up, you can simply fetch the commits by running git fetch origin pull/9661/head:pr-9661. Change the implementation to target repository level projects and open a new pull request with a co-authored trailer included in the commit message to give attribution to the original author.

PyvesB avatar Jul 03 '24 06:07 PyvesB