-
-
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
Support for styleci? #503
Comments
Thanks for the suggestion! I couldn't find a public API. Do you know if there is one? |
You can already use shields for StyleCI... https://styleci.io/repos/{your_styleci_repo_id}/shield You can append settings, see this commit https://github.com/StyleCI/StyleCI/commit/437517db00a9a0734cfe432aaa5eb0fc673d75bf /ping @GrahamCampbell |
We don't have a public API yet. |
That commit doesn't actually change any behaviour of our shields. We've supported all 3 styles long before that commit. That commit is just a refactor commit with zero change to behaviour. |
The only thing it changes is that we're totally independent of shields.io because shields.io provides bad caching headers to github was caching old badges. |
This issue should probably be closed. |
I know this: https://styleci.io/api/repos/39950862?branch=master Else if you need a API which will just return the color and the status message let me know and I will make it. |
That's not going to be possible I'm afraid. Our production service is more complex than our open source repo. |
I am planning to write an API at somepoint, but I want it to be good, so it'll take time. |
I'd call it “aggressive caching” ☺ Although it only lasts seconds. |
We had problems because the caching was 12 hours. |
@GrahamCampbell That's weird. Could you tell me what headers were bad? |
The Cache-Control header. |
@GrahamCampbell Hmm, here's what the current code does: // Cache management - no cache, so it won't be cached by GitHub's CDN.
ask.res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); What is your suggested fix? |
That's not the header I was getting. |
This is the actual header: https://github.com/badges/shields/blob/master/server.js#L4130. |
@GrahamCampbell That is only for static badges ( I assumed you were talking about badges that show constantly updated information? Or do you mean that this header appears on non-static badges? |
I redirect users to the "static" badges. |
Then github caches that and ignores the fact the redirect said don't cache. |
@GrahamCampbell Ah, I see. What I could do is send the no-cache header if I receive a special header… What header could you send while redirecting to Shields? |
We're no longer using shields because of that issue. Sorry. |
@GrahamCampbell Fair enough. I'll still try to fix it. I'll keep the Cache-Control header I receive. Is that a good idea? |
So... what happened to StyleCI? |
We have our own badge system. |
@GrahamCampbell That's cute, but its style is inconsistent with every other major badge system out there including Shields and PUGX and every other major independent vendor including Travis and Coveralls. Are you just too hipster to conform to the style that absolutely everyone else is using? |
The style is not inconsistent. We downloaded the badges from shields.io... |
If you want the crappy default style that shields.io has, just apply |
Alternatively, just add |
Don't you think it would be a good idea to have the different styles mentioned on the site somewhere? Also, I don't understand why you're opposed to Shields supporting badges for your service. No other major CI service provider seems to have the same issue. |
I'm not. I'm just not going to contribute it. It's also going to be hard to add support because we don't yet have a public API so shields has no way to know what the status for each of our repos is. |
That I'd recommend thus holding off until we launch api.styleci.io. |
Also, you'll have trouble calling |
when will support? |
Once StyleCI has a fully featured public HTTP API. https://api.styleci.io/ doesn't support getting the status of analyses yet. |
So, it sounds like the current status is: we're waiting for a public API. |
I'm marking all the needs-upstream-help issues closed. If there's new information from the upstream service, please post in the thread. If they're actionable by Shields, a maintainer will reopen the issue. If anyone wants to follow up with these vendors, feel free to do that! Even though the unresolved issues are closed, they are easy to find: https://github.com/badges/shields/issues?q=label%3Aneeds-upstream-help+is%3Aclosed |
Since StyleCI actually does have (still undocumented?) flat styles there doesn't seem to be a lot of point in adding support to Shields anyway. |
If it's helpful to be in the Shields supported list, another option, is to pull the text from the SVG badge using the parsing code in Shields. |
What do you mean? You're going to parse the image's text to rebuild a badge that looks identical to the image you parsed the text out of? How is that in any way helpful? |
Might or might not be helpful. As I suggested, it might be helpful for the service to be listed in the Shields supported list. Shields might also support more formatting options. |
If all you want to do is make a list you may as well just link to the original implementation. In any case it seems grossly inefficient to do what you're suggesting otherwise. |
Would it be possible to gain support for a StyleCI with the status?
The text was updated successfully, but these errors were encountered: