SlatherOrg / slather

Generate test coverage reports for Xcode projects & hook it into CI.
MIT License
1.55k stars 236 forks source link

Adding `--cdn-assets` flag that loads the Logo, CSS and JS files from jsdelivr CDN #537

Closed sushant-here closed 1 year ago

sushant-here commented 1 year ago

I have worked on a few projects that use slather in the last few years. I have always accepted that the HTML report viewing experience will be sub-par because there are no CSS and JS files once the report (index.html) is deployed to Azure DevOps or Bitrise (I'm sure others have similar limitations).

I propose that instead of referencing the locallogo.jpg,list.min.js,highlight.pack.jsandslather.css` relative to the HTML report, the report should instead reference a Web/CDN version. This way HTML reports will be feature-rich when deployed to these services as build artifacts.

  1. No change in default behavior. The new flag is opt-in.
  2. Reads slather logo, CSS and JS from the master branch of SlatherOrg GitHub project using jsdelivr CDN. Could consider making it more dynamic and configurable later in the future. EG adding support for tags or different forks.

Relates to: https://github.com/SlatherOrg/slather/issues/536

First time I've written any ruby code - sorry if I've broken any conventions and/or messed up on the versioning for this PR. Let me know what I can do to get this merged ASAP :)

sushant-here commented 1 year ago

Keen to get this in. @ksuther - you seem to be the most active recently. Please let me know what I can do to help merge this.

ksuther commented 1 year ago

This looks reasonable to me, thanks for the contribution!

sushant-here commented 1 year ago

@ksuther - are you able to create a release with this change?

ksuther commented 1 year ago

Thanks for the nudge. Waiting a few days for a comment on another PR and I'll cut a release.

ksuther commented 12 months ago

Included in 3.7.5!