-
-
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
web API design #100
Comments
Part of the intent of b.adge.me was to have both the ability to talk to existing badge vendors (for redirection, as we discussed with Travis-CI), and have the ability to deliver images for other badge vendors, to push for compatibility between them. As a result, this is what delivers a badge from the text it is made of:
The
That said, there is one issue with this design (which I mostly adopted for Buckler-like compatibility): having a dash at the start of the STATUS requires a hack, such as a Unicode U+200B ZERO WIDTH SPACE. http://b.adge.me/:bonzai-%E2%80%8B--cut---green.svg |
@espadrine Can you help me understand this, and how it relates to the Oh! Or are you saying that the |
http://b.adge.me/travis/node-red/node-red.svg One is a travis resolution, the other is a self-defined badge. |
There are actually two completely different APIs that have been discussed. One API is used to specify the criteria for the badge over the URL line (failed, red), etc. This is the API that Travis CI, etc. could download badges from us and serve them up through their infrastructure, or they could redirect to from their infrastructure. #94 (comment) Then second API, the one that |
The way I see those APIs' use: the colon one (with text/color input) is used for vendors to redirect to, the vendor one is used for badge users that want to display all their badges uniformly but some of their badge suppliers don't use shields. Of course, the vendor one can be extended to things that don't have external vendors, too (such as npm download counters). |
Whatever we do, I propose that we start our paths with a version specifier such as |
@whit537 Having a version specifier without a version promise is not very useful. Does it mean that we will always support URLs with the previous versions? In that case, we'll always need to support older URLs code anyway; we'd have this requirement without the version tag, too, why have it? Does it mean that we will support URLs of the version before, but it is deprecated?
How would we communicate a version bump? Also, it feels to me that part of the point of having this service is that the URL we give can be trusted not to change. |
I agree with @espadrine. Also, I think it's important to enable scaling through the URL, either using I also believe it would be interesting to provide both PNG and SVG, according to the extension given at the end of the URL. |
Picking up from #101 (comment) ...
Let's start with a description of img.shields.io and then identify differences with b.adge.me. img.shields.io currently has paths of this form:
Insofar as img.shields.io special-cases some of the names in the %first namespace, I don't see case sensitivity as a bad thing there. I would expect |
Re: version number. Having a version in the path doesn't commit us to any deprecation strategy. On the other hand, it does give us flexibility in the future to change to a new path layout for reasons we cannot now foresee. |
I'd like to avoid encoding needless constraints in the interface. Arbitrarily forbidding a raw badge to have its first box contain If that URL interface forces the first box' text to be case-insensitive, it bothers me even more — the server logs contain a lot of requests where case is significant (eg, camel-case). Not sure why, but it is there…
In this case, the user that Gittip knows about is "JSFiddle". Couldn't Gittip theoretically have a distinct user whose name is "jsfiddle"? Regardless, whether Gittip itself is case-insensitive or not doesn't force us into being case-insensitive ourselves. What we receive from Recapitulating my concerns:
I would like to request a change of the main public URL API, with the promise of backwards-compatibility. Can you give me your opinion on the current If the request doesn't match the For the fallback, I need you to give me the list of all supported colors. I believe I support most (all?) of them, but this is about making sure that no badges break. Should I automatically lower-case the text in the first box in the backwards-compatible API? |
Update: currently, the |
In IRC we've come to this proposal:
We have two alternative "custom" strategies to merge into the above. Things to note relative to the
Things to note relative to the
See #101 for transition plan. |
Twitter poll re: https://twitter.com/whit537/status/426446973088956416 |
Decided for |
Thinking in IRC re: a |
@mchiodo It's nice to have it point to a filename so that if you're downloading it you get a well-named file. It occurs to me that we may well one day want to serve something besides these little badges, at which point having a new, clean namespace to play in could be advantageous. We can always carve that out of the current top-level ns though. |
Closing. We're live with: |
To start we may want to research how each existing implementation (that has a URL-based API) does it.
A spec as a markdown file in this repository should provide enough detail that someone could implement the same API.
Public facing documentation on how to use the API will need to written near the end.
The text was updated successfully, but these errors were encountered: