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

Better dynamic badge with more dynamic content #2694

Closed
truongsinh opened this issue Jan 8, 2019 · 7 comments
Closed

Better dynamic badge with more dynamic content #2694

truongsinh opened this issue Jan 8, 2019 · 7 comments
Labels
service-badge Accepted and actionable changes, features, and bugs

Comments

@truongsinh
Copy link

📋 Description

with params:

  • subjectQuery
  • statusQuery
  • colorBQuery
  • prefixQuery
  • suffixQuery

in this format https://img.shields.io/badge/dynamic/yaml.svg?url=<URL>&subjectQuery=<LABEL>&statusQuery=<$.DATA.SUBDATA>&colorBQuery=<COLOR>&prefixQuery=<PREFIX>&suffixQuery=<SUFFIX>

for any of the params that is static instead dynamic, we can use json string, e.g https://img.shields.io/badge/dynamic/yaml.svg?url=<URL>&subjectQuery=<LABEL>suffixQuery="myStaticStatus"

The reason for this request is that at https://github.com/truongsinh/flutter-plugins , i'm generating dynamic badge from test coverage data, and i would like to display colorB from data source as well instead of static test.

I'm happy to make PR for this.

@truongsinh truongsinh changed the title Better dynamic badge Better dynamic badge with more dynamic content Jan 8, 2019
@calebcartwright calebcartwright added the service-badge Accepted and actionable changes, features, and bugs label Jan 8, 2019
@calebcartwright
Copy link
Member

Would #2473 help with this one too @paulmelnikow ?

@paulmelnikow
Copy link
Member

Hi! Thanks for the suggestion. Yes I agree with @calebcartwright that #2473 is perfect for your use case. It inverts the whole paradigm without you having to define a mapping.

Does that make sense @truongsinh? i.e. does it seem like #2473 will solve your problem?

(Also ref #1752)

@truongsinh
Copy link
Author

@calebcartwright @paulmelnikow close enough, in my use case, I prefer to keep all the data in one file (because this file is machine-generated too). If we could for example have /badge/endpoint.svg?url=<URL>&style=<STYLE>&entry=$.0 or /badge/endpoint.svg?url=<URL>&style=<STYLE>&entry=$.mykey it would perfectly suitable for me needs

@paulmelnikow
Copy link
Member

How big will the file be?

@truongsinh
Copy link
Author

~40 entries, each entries I assume 100 bytes = ~4KB

@truongsinh
Copy link
Author

on futher thought, I think it's okay now. I already start using it https://github.com/truongsinh/flutter-plugins data source https://github.com/truongsinh/flutter-plugins/tree/codecov/coverage_data

screen shot 2019-01-10 at 8 22 22 am

@paulmelnikow
Copy link
Member

The Endpoint badge is live!

If you decide to use the new feature, your feedback is much appreciated! Please feel free to comment on the Endpoint beta issue if you have feedback or questions about how to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

No branches or pull requests

3 participants