-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Badge request: GitHub merged pull requests #6164
Comments
It seems there is another way as well to -> https://github.com/Elskom/Sdk/pulls?q=is%3Apr+is%3Aclosed+is%3Aunmerged |
Thanks! I think that the API information is not correct for what you're asking for though, or at least not a viable option. We actually already support distinguishing between merged vs. closed for individual PRs #6159 #6161 The difference here is the desire to filter against the total PR count for merged vs. closed, and this is actually much simpler to do via the v4/GraphQL API. Fortunately, our existing badge that reports total for both issues and PRs already does this! shields/services/github/github-issues.service.js Lines 332 to 349 in d4116b3
Think all that would be needed to make this happen is an additional route variant ( shields/services/github/github-issues.service.js Lines 42 to 46 in d4116b3
and then tweaking the respective signatures to support passing through the merged-only option, and using the state filters accordingly: shields/services/github/github-issues.service.js Lines 345 to 348 in d4116b3
closed = merged+closed states |
@calebcartwright can we also have an |
would probably need to bikeshed on the name a bit, but i don't see why not! |
You can use these queries with the custom issue search badge e.g: - https://img.shields.io/github/issues-search/Elskom/Sdk?label=unmerged%20PRs&query=is%3Apr%20is%3Aclosed%20is%3Aunmerged - https://img.shields.io/github/issues-search/Elskom/Sdk?label=merged%20PRs&query=is%3Apr+is%3Aclosed+is%3Amerged |
Good point Chris. Do you think we should go ahead and close this (folks can always use the |
I would like the options available like the other pr aggregate badges. Also @chris48s it does not say |
I see from here it does not let you set text at the end, perhaps have an optional query param for it that defaults to nothing?. |
No, this is by design. We do not allow open ended badge message customization #6135. For the issues status badges, we have two kinds, one that puts the status in the label (raw) and another that puts it as a suffix in the message: https://img.shields.io/github/issues-pr-raw/badges/shields https://img.shields.io/github/issues-pr/badges/shields the former is already possible via the issue search badge and query params as noted above, the latter would not be. i'm not personally opposed to to including the additional PR status variants, but it does seem like quite a bit of overhead just to get the non-raw versions (status on the message) |
This issue seems like it was solved. |
Thanks for the question! However, no, I don't see this as resolved. It's often the case that there's a viable alternative/workaround available via existing features such as our dynamic badge features (or custom endpoint), but that doesn't inherently negate/resolve the request for a native badge. This issue was requesting a native badge that doesn't yet exist (though which has some alternative as noted earlier in the thread). From the maintainer side we've not explicitly said "no we won't do this", and the author hasn't changed their mind yet either and closed the issue themselves. I don't anticipate the issue being closed unless and until one of those two things happen, or unless someone implements the requested badge. |
Noted 👍
…On Thu, May 12, 2022, 3:54 PM Caleb Cartwright ***@***.***> wrote:
This issue seems like it was solved. Can I suggest closing it?
Thanks for the question! However, no, I don't see this as resolved.
It's often the case that there's a viable alternative/workaround available
via existing features such as our dynamic badge features (or custom
endpoint), but that doesn't inherently negate/resolve the request for a
native badge.
This issue was requesting a native badge that doesn't yet exist (though
which has some alternative as noted earlier in the thread). From the
maintainer side we've not explicitly said "no we won't do this", and the
author hasn't changed their mind yet either and closed the issue themselves.
I don't anticipate the issue being closed unless and until one of those
two things happen, or unless someone implements the requested badge.
—
Reply to this email directly, view it on GitHub
<#6164 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGOB42EXUKQ2IKRXFMWJ33VJVVYRANCNFSM4XP4JFUA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I would like to work on this one :) |
Please someone work on this |
📋 Description
I would like a badge that counts all of the pull requests that was merged only, the closed pr badge could be changed I think to filter out merged prs.
The badge should contain the count of merged pull requests, also the count of merged pull requests could also be used to subtract from the closed pull request badge to (or well make a version of it that excludes merged prs).
🔗
Where can we get the data from?
list the pull requests first using
GET https://api.github.com/repos/{owner}/{repo}/pulls
then request:GET https://api.github.com/repos/{owner}/{repo}/pulls/{pull_number}/merge
Is there a public API?
yes
Does the API requires an API key?
Nope.
Link to the API documentation.
https://docs.github.com/en/rest/reference/pulls#list-pull-requests
https://docs.github.com/en/rest/reference/pulls#check-if-a-pull-request-has-been-merged
🎤 Motivation
I noticed that we could show up opened, closed issues and pull requests among other things however lacked the ability to get a badge for merged pull requests.
People like me want to show that we merge pull requests a ton and it would support those who feel like contributing to projects too.
The text was updated successfully, but these errors were encountered: