-
-
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
Enable overriding the message of a json endpoint through the query string in the URL #6815
Comments
Possibly related to this use case: #6786 |
Thanks for the reference, but I have to admit that I'm new to badges and not familiar with the deep details and therefore don't fully understand the conversation. Our intention why we consider to use an own JSON endpoint is to be able to configure the entire badge, except for the message, at one location. Each Eclipse-project using that badge should only have an individual message, that is expected to be the project name. Do you think another approach would be more suitable in our situation? If you are interested in some more details, you can find them here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=574646 |
It sounds like the ask is to be able to specify a collection of static badges whose formatting is specified in a JSON file and the message in a query parameter. I could imagine this being solved with a new endpoint for a collection of static badges, along the lines of the proposal I described in #6786 (comment). That would require adding an entry for each project into the JSON file. However for your use case, I think a better solution would be to check in a script which fetches a list of the projects, generates the static SVGs, and dumps them onto a CDN somewhere – probably in the same place you were thinking of putting that endpoint JSON file. |
That was my sense as well, with the underlying motivating use case being the desire to be able to centrally manage/bulk update a set of similar-but-not-identical static badges used in different repositories. @HannesWell - I can understand the desire to automate/simplify the process of updating a bunch of images, but I personally think that capability is outside the remit of Shields; the Endpoint badge is definitely not geared towards that type of use case. I was going to suggest something very similar to what Paul suggested, with the option of just using GitHub to host the svg files (so the aforementioned script could just check them into source) and then using |
👍 |
Yes, we would like to generate badges that all have the same formatting, colour and label and only have an individual message-text. Thanks for your suggestions. I just wonder why it is possible to override the label from the query string, but it is not possible to override the message? From my naive perspective the difference is only that the label is the text on the left and the message the text on the right of a badge. |
The use case for customizing the label is when you want to display two CI badges, and need to differentiate them (i.e. they can't both be labeled "build"). In that case there's no need to override the right text. I think the reason you're finding this mismatch in capabilities surprising is that you're using Shields in a way more like what was requested in #2824, for making a custom action button, whereas Shields is primarily designed for rendering status badges. We of course don't mind that you use Shields for these buttons, but at the same time, well, it isn't the primary use case for which Shields was intended. Thinking more about #2824 and how these buttons have been used in the wild, another design suggestion would be to exclude the package name from the button entirely: https://img.shields.io/static/v1?logo=eclipseide&label&color=orange&message=Create+Development+Environment&style=for-the-badge&logoColor=white Then they're all the same and you can generate it once and pop it on a CDN somewhere. |
Thanks for the explanation. I expected a reason pointing in that direction. Your design suggestion would be another option. However it would be nicer to 'personalize' the buttons for each project. |
I stumbled on this issue as I was running into the same issue myself. I was wanting to create a badge that is similar to a lot of status badges where the left side shows the category, and the right side shows information about the category. For example: In my specific case, I want a family of badges such as: I clearly don't want to create every iteration of the right hand side. Is this something that endpoints aren't intended to support? |
📋 Description
It is possible to override for example the label of a JSON endpoint in the query string like this:
https://img.shields.io/endpoint?label=another%20label&url=<URL-to-my-endpoint>.json
But it does not seem to be possible to override the message of a JSON endpoint through the query string like this:
https://img.shields.io/endpoint?message=another%20message&url=<URL-to-my-endpoint>.json
It would be great if overriding the message trough the query string would be possible, too.
We consider to provide a unified badge template by using a JSON endpoint, that can be used by multiple Eclipse projects and where each project only overrides the message with its name in the URL. This way all projects use similar badges with an individual message.
The text was updated successfully, but these errors were encountered: