lighthouse-ci icon indicating copy to clipboard operation
lighthouse-ci copied to clipboard

Creating 2 reports against the same base URL with a query parameter only shows the 1 check in GitHub

Open harrison-carter opened this issue 2 years ago • 6 comments

Describe the bug

When I run a Lighthouse CI Collect against two url's such as the example below

  • http://localhost:3000/foo
  • http://localhost:3000/foo?example=bar

The two Lighthouse reports are generated successfully and stored in storage.googleapis.com. In GitHub, when the action has finished and I have a token setup to add in the outcome of both of these reports - I only see the report generated for http://localhost:3000/foo?example=bar in the checks list.

To Reproduce Steps to reproduce the behavior:

Using the configuration below, run lhci autorun against 2 URL's with the same base URL. One of them should provide a query string.

module.exports = {
  ci: {
    collect: {
      url: [
        'http://localhost:3000/foo',
        'http://localhost:3000/foo?example=bar'
      ],
      startServerCommand: 'yarn start',
      numberOfRuns: 3
    },
    upload: {
      target: 'temporary-public-storage'
    }
  }
};

Expected behavior

Two reports should show in GitHub checks when using a token to report the checks.

Logs/Screenshots

When running ``lhci autorun`, 2 Lighthouse reports have been generated. Screenshot 2022-03-10 at 17 28 34

When viewing in GitHub, only one of these reports shows. Screenshot 2022-03-10 at 17 28 52

Environment (please complete the following information):

  • OS: Github Actions
  • Browser:
  • Version:

harrison-carter avatar Mar 10 '22 17:03 harrison-carter

We have also been seeing this behaviour. I believe the query params are being stripped when generating the label for github: https://github.com/GoogleChrome/lighthouse-ci/blob/main/packages/cli/src/upload/upload.js#L190

We can customise the upload prefix, but that's about it. I wonder if we want an option to preserve query params in the label, but open to other ideas!

GeorgeA93 avatar Mar 11 '22 15:03 GeorgeA93

A toggle to preserve the query params without stripping them would be great!

harrison-carter avatar Mar 11 '22 16:03 harrison-carter

Very basic approach which needs testing: https://github.com/GoogleChrome/lighthouse-ci/compare/main...GeorgeA93:main

GeorgeA93 avatar Mar 14 '22 11:03 GeorgeA93

Very basic approach which needs testing: main...GeorgeA93:main

Looks like a clean approach 👍

harrison-carter avatar Mar 14 '22 13:03 harrison-carter

any update on this?

ghost avatar Oct 07 '22 13:10 ghost

Can I follow up on this as well? Thank you!

victorlin-sq avatar Jul 26 '23 02:07 victorlin-sq