-
-
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
Add [GithubCheckRuns] service #7759
Conversation
Interesting, thanks for making this note! Since refs can be branches and branches can contain |
It didn't occur to me that branches with Should it be |
That determination is driven off the requirements of the upstream endpoint. Most of the time the upstream endpoint supports an optional parameter that can be a branch, but in a smaller set of cases the branch/ref is actually required. I assumed that for check runs a ref would be required, is that correct? |
yes, ref is required |
Then you'll want to use |
I've done a quick pass through this and have opted to leave a few higher level comments/questions vs. inline comments. As far as the code, seems to generally be in good order, though I'm curious if the various other helpers, e.g. Additionally, I think more could be extracted within the |
There are several status/conclusion values returned by the API that are not included in The individual conclusions have to be aggregated in a way first and then mapped to a status anyway. I tried to map them to existing states that work with JS is really a hobby of mine so I'm sure there are more efficient ways to transform/map things. Happy to learn from someone who's more proficient than me. |
Understood. There's always a balance between trying to determine whether to incorporate something from a service into the shared enumerations. I still believe there's a bit more to think through here though relative to our desired behavior. For example, if the runs have an "in progress" status, does the conclusion field strictly always exist? Given the list of values defined in the schema for the conclusion, I'd be surprised if an actively running case has a conclusion field already set with one of those values. We should probably also look for opportunities to be consistent with our other similar types of badges (e.g. would a for the "in progress" state would message of On the implementation side, if we anticipate that we'll need a more service/endpoint-specific mapping beyond the general purpose build status (which I'm certainly open to, especially since it seems like we'll indeed need a two-fold mapping), then we should still refactor the code a bit to make it more easily testable. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier
I finally found some time for this... Meanwhile GH has updated their API docs which made defining the joi schema a piece of cake. I combined the state mapping into a separate method and added a spec test for it as well. I ran |
One file had CR instead of LF... Anyway, all checks have passed! Yay! Ready for final review 😄 |
bump |
Ladies and Gentlemen, Dear Maintainers, it's been 2 years since I opened this PR. Do I qualify as the most patient contributor on GitHub yet? I will give it one more shot. Please review and let me know what should be changed. If I do not get any reaction soon, I will close this PR. Best, |
I've been watching this PR for over a year now, hoping it gets merged. A little bit of communication from the maintainers would be great to get this going. If there's changes that needs to happen before this is merged in, then let's spell out those changes so they can be fixed. |
As a reminder, this is an open-source project, a small team of maintainers dedicate their spare time for free, some of us having diligently done so since 2017. If folks want this so badly, why don't they participate in a constructive way, for example by doing a first review pass, testing the new badges, and reporting on their findings here? Implying that there's been a five year wait, for an issue that saw outside activity for the first time in 2022, feels all the more out of place. @mbtools we do value your contribution and the time you put into this, and I'm sorry we've kept you on the hook for so long. I am a little stretched at the moment, but I do want to pick this up at some point. If you could extend your patience a little further, that would be great! 😃 |
No worries, I will leave it open. Thanks for putting it back on the radar 👍 |
The deployment to a review app to test this out has failed, hopefully #10134 should fix it. |
🚀 Updated review app: https://pr-7759-badges-shields.fly.dev |
🚀 Updated review app: https://pr-7759-badges-shields.fly.dev |
Looks to be working well in the review app 😀 |
🚀 Updated review app: https://pr-7759-badges-shields.fly.dev |
I added an optional name filter so you can get the status of one particular check run |
🚀 Updated review app: https://pr-7759-badges-shields.fly.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the good work, one small change and I'd say we can merge this! :)
Thanks for your patience on this one @mbtools! Could you please prepare the follow up PR we've been discussing in #4364 (comment)? 🙏🏻 |
Woohoo! I will have some 🍰 and pop a bottle of 🍾 🥳 🎈 🎉 PS: I will get back to the comment later today |
Description
This service is for displaying the results of check runs in GitHub.
Data
API path would be:
/{owner}/{repo}/commits/{ref}/check-runs
For example: https://api.github.com/repos/badges/shields/commits/master/check-runs
Motivation
Check Runs (and Check Suites) reflect the status of various GitHub Apps/Integrations/Services/etc. and are most often seen in the
Checks
tab for a PR or visible as icons next to the commit descriptions.Notes
This service returns the aggregated status of a ref. It currently does not allow to select a specific check run (job) as envisioned in #4364 but this can certainly be added later (as query parameter).
Preview