-
Notifications
You must be signed in to change notification settings - Fork 24
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
Generated badge with port version #3
Comments
I do not recall seeing badges before. Where would these badges appear? |
For example, there's pypi badge in ansible you've forked: https://github.com/dlangille/ansible#readme Actually they are used in most repos: https://github.com/chef/chef#readme |
I see what you mean now. It is a way for a given project to indicate that their software is available on FreeBSD. |
Yes, the above is what I thought you were getting at. I suspect |
I'd like The goal being to make |
Yes, would be great! You could also set up a script to generate markdown code suitable for inclusion in README.md, e.g.
(this is badge image which links to port's page on freshports) and add link to that from
line on a ports page. |
After a short discussion at FreeBSD Developers summit in Stockholm, I think |
I'm good with either. Also 👍 to API, as with it FP could be also ingerdated with shields.io directly. |
See http://dev.freshports.org/--/badges/?port=x11/xproto Is this what you were expecting? |
Proof of concept. There is no error handling yet (always returns 200). |
Well not quite. It should either generate a redirect to badges.io link which it self shows a needed svg (example of such link is in the top post), or json with enough info for badges.io to generate it itself (which would be even better). |
Actually badge can be generated from this as well, but i'd name it |
Oops, accidental close. |
FYI badges.io is for sale. |
Examples: https://img.shields.io/badge/Bacula--Server-7.0.2_1-red.svg?style=plastic Next step: figure out JSON, which I'm not seeing a reference to on their website. i.e. this does not work: https://img.shields.io/badge/bacula--server-7.0.2__1-red.json |
At present, http://dev.freshports.org/--/badges/?port=sysutils/bacula-client produces an IMG element if found, and a 404 otherwise. |
|
|
Compare http://dev.freshports.org/--/badges/?port=archivers/hlextract and http://dev.freshports.org/--/badges/?port=sysutils/bacula-client The img is included with the HTML for debugging. |
Apart from 2 items from my last comment, good. |
Try now, not sure yet about the Not Found issue: http://dev.freshports.org/--/badges/?port=not/foundtest |
Yes, almost good - I'd use lightgray instead of gray as it seems pretty common for other badges. Also note that for not found case generated URL != generated img src (though img src is correct). |
How's that? |
Still to do: caching. |
Absolutely perfect! Thank you! |
Done |
Yeah, now it works: https://github.com/AMDmi3/libSDL2pp/tree/ports-badge Waiting for production state of this feature :) Also not sure, but maybe s/Port/port/ would look a bit better. |
I changed to lower case. Seems they are caching it. |
Yep, github could. Direct link has lowercase |
Although it is disturbing, seems like it's caching the redirect while it shouldn't - this means that even if the version is updated, GH will still show an old badge. According ti http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html, you should redirect with 303 (which is non cacheable) or provide corresponding Cache-Control / Expires headers. |
Code was: now: re http://php.net/manual/en/function.header.php But it will take some time for that cache to wear off |
Thank you! We'll see if it helps. |
FYI, I am creating a branch, badges, so I can commit this work in progress without affecting production. Then I will checkout this code for use on http://beta.freshports.org/ and that will allow me to keep working on dev, which is my personal sandbox. |
This should now work on http://beta.freshports.org/ :
Please update your URLs to point to beta, but anticipate that the URL / form may change after REST is implemented. Expect dev to be broken for some time while I work on REST. |
Done |
I just pushed the badges branch. It's no longer just on my dev site. |
E.g. it should be available on freshports.org? It doesn't seem to (or is the url different?) http://www.freshports.org/--/badges/?port=archivers/hlextract
|
No, not yet. It is on the branch and needs to be merged into the main tree, but I want to configure caching before I do that. |
Any news on this? |
It is sad isn't it? I'm now busy with EuroBSDCon prep... |
I managed to get this working in VMware on my laptop. I'm flying tomorrow. |
I wonder what I need to cache here. It is just a redirect. Here's the fetch:
|
Everything is just read from the DB. That should be fast for now. I'll see what I need to do to get this working on the plane tomorrow, |
I do believe this has been merged from the badges branch to the master branch. I'll cleanup the files during the flight and this should be on dev.freshports.org later this weekend. |
Reopening, until we are in production. |
I see we are in production. I missed that. How's it looking? |
Still waiting to hear back from OP. badges question raised again here: https://twitter.com/f0andrey/status/1049027503199858688 |
See also: Is there any overlap? (If not, I can delete this comment.) |
Just a crazy idea. You've likely seen these badges used by many GitHub repos to report continous integration status and other stuff. Why not make FreshPorts generate a badge for a port by request? The badge should simply show DISTVERSION, like this:
This has numerous purposes among which is raising awareness of FreeBSD ports/Freshports among users, a convenient way to know the project is supported by FreeBSD and a way to know that the port is at latest version (or whether it falls behind).
The simplest way to implement this is just a make a per-port link (e.g. http://www.freshports.org/x11/xproto/badge or http://www.freshports.org/x11/xproto/?badge) which redirects to shields.io like
https://img.shields.io/badge/FreeBSD_port-${DISTVERSION}-blue.svg
. Or you could just generate the same .svg by yourself to not depend on third party site.The text was updated successfully, but these errors were encountered: