I think it might help to speed up review of PRs to the offical libs if there was a graphical preview of the PRs.
I’ve modified cpavlina’s script [1] which generates image for components, so that it could be used to generate images of changed components (added or modified) in the Travis check.
I think I can see how to adapt comparelibs.py [2] to call the schlib-render script, and output a png.
The question is, is there a server accessible to Travis which could be used to store the images? Then we automatically add the image to pull requests.
The OpenSCAD project does a similar thing, they even compare the images to verify code changes have not broken anything and produce an HTML report. Example [3]
One possible solution that does not require configuring a server, is to upload the images to a free service like imgur (unlimited API uploads for open-source projects) using credential stored in a “Travis secret”, see https://docs.travis-ci.com/user/encryption-keys/.
The main problem with this solution is that these secrets are not accessible during Travis builds that are caused by pull requests generated from forks. Only pull requests from the same repository (but from a non-master branch, naturally) can use these secrets. (See https://docs.travis-ci.com/user/pull-requests#Pull-Requests-and-Security-Restrictions.)
If testing only post-merge commits or pull requests from the main fork is OK, then that Travis secrets + imgur is a viable option.
@SchrodingersGat: Unfortunately the GitHub API does not allow you to upload images. GitHub internally receives the images, uploads them on the fly and then the brower-side interface inserts a link into the message.
Total out of the box here, but why go for an image if you can use the code of the internet itself to create the image on the fly - not just for the PRs?
There should be a couple of javascript or php libs out there, which are capable of this, no?
This doesn’t update the PR, but at least the report is available. The link could be pasted manually until we find a better way. I wonder if we could use kicad.org to host report files?