-
-
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
[Wordpress] Plugin Issues Badge #5721
Conversation
Added request options and required schema to get support_threads and support_threads_resolved
Added badges for wp plugin issues, this includes raw number, percentage, out of and comparison
Fixed platform tests to conform to the new schema and request (mocked tests)
Added a long format style badge that shows open close in a clearer style
|
From what I recall, the raw vs non-raw distinction is primarily used in rendering to control if/where the status (e.g. Is that what's implemented here? |
I think this was mostly from me tackling it late at night without putting brain power in & getting carried away making badges! So I was using raw to mean just the raw number, as in 10 open issues, to separate it from the badges that are doing some kind of comparison/math, like percentage or open/close. Then open or close as another to switch between them. I agree I have done it in a confusing way, just can't think how to make it simpler? |
I'd suggest taking a look at the GitHub Issues badges and maybe the one for Bitbucket as well. One of our primary goals is consistency across our badge offerings, and I think we should be able to align these issue badges with our existing ones, barring any wildly divergent wordpress-specific context. |
From what I can see, my use of Most of the difference for mine comes from using a more pronounced separation, for example, where you may use The only other difference is, I have added more 'flavours' such as percentage open/closed. Would we be better to remove these and instead just provide an open/close with no style variants? |
I see what you meant now. I was a little confused by the wording in the description (
No I think these are worthwhile badges to provide and not suggesting that they be removed. It's more about how to best represent them.
We follow pretty specific patterns for our badge routes (https://github.com/badges/shields/blob/master/doc/badge-urls.md#badge-url-conventions), and although I can understand the thinking that As an example, we provide badges that display the maintainability rating from CodeClimate as either a percent or letter grade (both based on the exact same underlying data point from the provider), but because these are different values the route uses separate nouns We're going to want to do the same thing here, as raw/percent/outOf aren't just parameters, they fundamentally change the badge message value. Again I think the GitHub Issues Service Class can serve as a good reference shields/services/github/github-issues.service.js Lines 42 to 46 in f1a5dd9
I also feel like there's a lot of duplicative functions between the two classes that currently exist, and would like to see them cleaned up. Two approaches would be introducing a new file that contains those as helper functions or creating an additional Issues Base class that the others extend. You may find it easier to address the route updates by splitting some of those into separate classes, and having the common stuff encapsulated somewhere will help! |
Awesome. Yeah, I'll go back through and sort out the route's to fit Shields better. I will also look at how best to reduce the amount of duplicative functions and streamline things a bit better. |
@JoeIzzard any chance you could circle back to this? It would be great to get the remaining Wordpress pull requests landed. 😉 |
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 someone else wants to pick this up, you can simply fetch the commits by running |
Related to #5493, this PR adds the Plugin Issues badge's. These include several styles, so may need to strip some out to be more inline with other services; I kinda just made everything I think someone may want in a badge. This includes: