ossf / scorecard-webapp

Website and API for OpenSSF Scorecard
https://scorecard.dev
Apache License 2.0
22 stars 27 forks source link

Goat counter issue on staging branch #75

Open mdunbavan opened 2 years ago

mdunbavan commented 2 years ago

Hello all,

So after a bit of investigation it seems like Google App Engine has some issues with external scripts being loaded on static sites that are client-side only. I got to this conclusion by deploying exactly the same code to Netlify to see if I could replicate the issue there but it worked perfectly fine for me. The url is below:

https://staging-netlify-test--elastic-noether-393172.netlify.app/

I then changed the above env to use SSR(server side rendering) on the front-end so we aren't relying too much on the client-side and we get the added benefits of everything being loaded into the app state at once. This would then stop the issue of the external script being loaded before the client-side was ready breaking the site on refresh.

To further back up my thoughts, I have attached a screengrab of the associated env with the network tab open displaying the Goatcounter script publishing a count event.

Screenshot 2022-04-13 at 12 03 06

I have now created a PR to go into the main branch for staging on Google App Engine with the same config settings as above. I will need this to be approved to merge into main then we can further test.

https://github.com/ossf/scorecard-webapp/pull/74

Thanks, Mark

azeemshaikh38 commented 2 years ago

Yep, that fixes the breakages but now the sidebar is gone (see image below). Also, the GitHub Stars icon is flaky. The number gets populated sometimes but sometimes it doesn't.

image

mdunbavan commented 2 years ago

Yeah I saw that.

I am leaving in about 30 mins but I am going to look into this issue tomorrow

azeemshaikh38 commented 2 years ago

Another question is - we are now making these changes (like disabling ssr) for AppEngine deployment. If we move to Netlify at a later point, would these changes still work?

I am leaving in about 30 mins but I am going to look into this issue tomorrow

Thanks!

mdunbavan commented 2 years ago

Yeah they will still work, and in that change which fixed the Goat counter issue, we actually enabled ssr

Ideally you need to move to Netlify sooner rather than later. It would be great if OSSF could get it setup now so we could easily port it over and make sure it is running on an optimal server for what you need.