Skip to content
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

Closed
marktopper opened this issue Jul 31, 2015 · 41 comments
Closed

Support for styleci? #503

marktopper opened this issue Jul 31, 2015 · 41 comments
Labels
needs-upstream-help Not actionable without help from a service provider service-badge New or updated service badge

Comments

@marktopper
Copy link

Would it be possible to gain support for a StyleCI with the status?

@espadrine
Copy link
Member

Thanks for the suggestion!

I couldn't find a public API. Do you know if there is one?

@JayBizzle
Copy link

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

@GrahamCampbell
Copy link

I couldn't find a public API. Do you know if there is one?

We don't have a public API yet.

@GrahamCampbell
Copy link

You can append settings, see this commit StyleCI/StyleCI@437517d

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.

@GrahamCampbell
Copy link

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.

@GrahamCampbell
Copy link

This issue should probably be closed.

@marktopper
Copy link
Author

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.

@GrahamCampbell
Copy link

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.

@GrahamCampbell
Copy link

I am planning to write an API at somepoint, but I want it to be good, so it'll take time.

@espadrine
Copy link
Member

shields.io provides bad caching

I'd call it “aggressive caching” ☺ Although it only lasts seconds.

@GrahamCampbell
Copy link

Although it only lasts seconds.

We had problems because the caching was 12 hours.

@espadrine
Copy link
Member

@GrahamCampbell That's weird. Could you tell me what headers were bad?

@GrahamCampbell
Copy link

The Cache-Control header.

@espadrine
Copy link
Member

@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?

@GrahamCampbell
Copy link

That's not the header I was getting.

@GrahamCampbell
Copy link

@espadrine
Copy link
Member

@GrahamCampbell That is only for static badges (/badge/ ones). Since they don't change, browsers can cache them.

I assumed you were talking about badges that show constantly updated information? Or do you mean that this header appears on non-static badges?

@GrahamCampbell
Copy link

I redirect users to the "static" badges.

@GrahamCampbell
Copy link

Then github caches that and ignores the fact the redirect said don't cache.

@espadrine
Copy link
Member

@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?

@GrahamCampbell
Copy link

We're no longer using shields because of that issue. Sorry.

@espadrine
Copy link
Member

@GrahamCampbell Fair enough. I'll still try to fix it. I'll keep the Cache-Control header I receive. Is that a good idea?

@Bilge
Copy link

Bilge commented Jan 23, 2016

So... what happened to StyleCI?

@GrahamCampbell
Copy link

We have our own badge system.

@Bilge
Copy link

Bilge commented Jan 23, 2016

@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?

@GrahamCampbell
Copy link

The style is not inconsistent. We downloaded the badges from shields.io...

@GrahamCampbell
Copy link

If you want the crappy default style that shields.io has, just apply ?style=flat to the StyleCI URLs.

@GrahamCampbell
Copy link

Alternatively, just add ?style=flat-square to your shields badges to make them look as nice as StyleCI's default badges.

@Bilge
Copy link

Bilge commented Jan 23, 2016

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.

@GrahamCampbell
Copy link

I don't understand why you're opposed to Shields supporting badges for your service

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.

@GrahamCampbell
Copy link

I know this: https://styleci.io/api/repos/39950862?branch=master

That /api stuff isn't intended for external usage. That's just used by our own website and we'd happily make breaking changes to that without notice.

I'd recommend thus holding off until we launch api.styleci.io.

@GrahamCampbell
Copy link

Also, you'll have trouble calling /api endpoints atm for private repos to provide badges.

@peter-gribanov
Copy link
Contributor

when will support?

@GrahamCampbell
Copy link

Once StyleCI has a fully featured public HTTP API. https://api.styleci.io/ doesn't support getting the status of analyses yet.

@paulmelnikow paulmelnikow added needs-upstream-help Not actionable without help from a service provider service-badge New or updated service badge labels Apr 18, 2017
@paulmelnikow
Copy link
Member

So, it sounds like the current status is: we're waiting for a public API.

@paulmelnikow
Copy link
Member

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

@Bilge
Copy link

Bilge commented Oct 12, 2017

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.

@paulmelnikow
Copy link
Member

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.

@Bilge
Copy link

Bilge commented Oct 12, 2017

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?

@paulmelnikow
Copy link
Member

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.

@Bilge
Copy link

Bilge commented Oct 12, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-upstream-help Not actionable without help from a service provider service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

7 participants