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

Switch to chart.js for the release activity page #1255

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Jan 21, 2021

This PR switches the charts in the /releases/activity page from Highcharts to chart.js, improving multiple things:

  • Highcharts is proprietary, and I'm not actually sure docs.rs fits into the cases where we don't need a commercial license for it.
  • Highcharts doesn't fit well with CSP, requiring style-src 'unsafe-inline' to work.
  • This removes the last dependency we fetch from cdnjs, so this fixes self-host all static content #921.

Rendered example of the page with chart.js:

Screenshot_2021-01-21 Releases - Docs rs

Copy link
Member

@Nemo157 Nemo157 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I haven't tested it locally and I assume we have no tests covering this page, but I trust your screenshot.

@Nemo157
Copy link
Member

Nemo157 commented Jan 21, 2021

Test failure is probably #1251 making the test flaky, probably needs reworking to inject more test crates to ensure there is a result.

@pietroalbini
Copy link
Member Author

If anyone wants to test it locally I recommend running this query to fill some data in:

UPDATE config SET value = '{"counts":[233,281,431,564,390,188,230,291,320,352,458,332,349,338,358,410,467,579,841,397,565,298,407,532,511,456,484,426,326,295],"dates":["19 Dec","20 Dec","21 Dec","22 Dec","23 Dec","24 Dec","25 Dec","26 Dec","27 Dec","28 Dec","29 Dec","30 Dec","31 Dec","01 Jan","02 Jan","03 Jan","04 Jan","05 Jan","06 Jan","07 Jan","08 Jan","09 Jan","10 Jan","11 Jan","12 Jan","13 Jan","14 Jan","15 Jan","16 Jan","17 Jan"],"failures":[16,9,6,7,29,8,6,8,4,13,18,12,11,4,19,18,28,44,23,17,14,8,10,28,19,14,7,13,8,17]}' WHERE name = 'release_activity';

I assume we have no tests covering this page

Yeah, we don't really have a way to do UI tests as of today.

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I would like to deploy before merging this, there are quite a few PRs queued up to be deployed.

templates/releases/activity.html Show resolved Hide resolved
@jyn514 jyn514 added the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Jan 21, 2021
@jyn514 jyn514 merged commit 1c18e60 into rust-lang:master Jan 21, 2021
@pietroalbini pietroalbini deleted the chartjs branch January 21, 2021 17:27
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

self-host all static content
4 participants