Shopify / lighthouse-ci-action

MIT License
100 stars 50 forks source link

Redirection in URL #40

Open cerenervia opened 2 years ago

cerenervia commented 2 years ago

Lighthouse seems to make redirection for each tested URL. Is it normal? Are results altered by this waring?

Screnshot attached: image

vfonic commented 2 years ago

I believe this is normal, because we need to somehow set the theme ID with the changes from the repo. We can achieve that with preview_theme_id parameter that then redirects to preview of the theme from the repo.

joshistoast commented 4 weeks ago

Running into this now, @vfonic isn't the problem because of the preview_theme_id parameter? Or are you suggesting we can prevent a redirect by manually including that parameter in the theme url?

vfonic commented 4 weeks ago

When you say "theme url" do you mean "store url"?

In order to use the theme with your latest changes so that you can test it with Lighthouse, you need to:

  1. Upload the theme to the store

  2. Instruct the browser to use that theme

  3. is done automatically

  4. is done via preview_theme_id parameter in the link to the store page. This is stored in session or cookie and that's how this works. I don't think there's a way to prevent the page redirect because we'd need a very low level access to achieve that.

joshistoast commented 3 weeks ago

Not sure how those first 3 steps help, the lighthouse ci action automatically generates this theme id and uses it when requesting to run.

I don't think there's a way to prevent the page redirect

So we should all just expect less than helpful and erroneous performance scores?

vfonic commented 3 weeks ago

No idea. I'm not working for Shopify. I'm just trying to be helpful.