-
-
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
[GitHubChecksStatus] Add commit check badge #5973
Conversation
This pull request introduces 1 alert when merging 7e4ce81 into 91b108d - view on LGTM.com new alerts:
|
Thank you for the PR @itsvs. Could you please elaborate on the perceived use case for this badge? I suppose there's technically a brief window where the status will be unknown/dynamic but this largely becomes a static badge very quickly and I don't quite understand the utility of having a commit hash specific status badge. Typically the build status-type badges are used to dynamically reflect the current status of project/repository/etc. that changes regularly over time, and the same holds true for the check runs data discussed in #4364. However, the status for a single commit doesn't feel like it really fits into that mold |
Hey @calebcartwright, thanks for taking the time to look over my PR! I agree that there's little use for a commit-specific badge, but Github's commit status endpoint actually allows for the Hope this makes sense! |
Thanks for the additional context, that's most helpful! In that case I think we'll want to pare back the commit-centric focus to be more explicit that any old ref will suffice. I'd suggest potentially updating the route, the internals like the class and file name, as well as examples that demonstrate non-specific commit uses (e.g. branch). We'd also want to have some non-commit hash tests too. |
Makes sense, I'll make those changes later today. Thanks for the input! |
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 again for the PR @itsvs! Looks to be in fairly good order overall, and have left some inline feedback for your review. It may seem like a lot of comments, but it's largely just places where Shields has some utils/helpers that should be reused instead of duplicating the functionality those cover 👍
.get('/badges/shields/this-ref-does-not-exist.json') | ||
.expectBadge({ | ||
label: 'checks', | ||
message: 'invalid ref', |
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.
This value will likely need to be tweaked to account for changes in the service test for the 404 scenario
I believe that resolves all your comments, @calebcartwright! |
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.
Excellent, thank you!
Related to #4364. Adds a badge for Github's commit status endpoint (not quite the same as the
check-run
endpoints, but similar idea).