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

report: show axe version in runtime settings #10729

Merged
merged 10 commits into from
Aug 26, 2020
Merged

report: show axe version in runtime settings #10729

merged 10 commits into from
Aug 26, 2020

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented May 7, 2020

image

fixes #10640

@connorjclark connorjclark requested a review from a team as a code owner May 7, 2020 23:17
@connorjclark connorjclark requested review from patrickhulce and removed request for a team May 7, 2020 23:17
@brendankenny
Copy link
Member

I thought we were talking in runtime settings?

@patrickhulce
Copy link
Collaborator

I also thought we decided on runtime settings, but I kinda like this too. I'm up for either if we can reach a quick consensus?

@connorjclark
Copy link
Collaborator Author

sorry, I have conflated these two parts of the report, you're right the consensus was on runtime settings ...

I do think like it better in the footer though :)

@brendankenny
Copy link
Member

I mean the footer isn't the credits, it's telling the user what the thing they just read was (more or less a colophon). We consider the host UA part of the testing environment in the same way as axe would be.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

this was marked as waiting on me, so I gave a review, but I'm a little unclear as to what's been decided re: runtime settings vs. footer.

I see arguments for both:

Runtime Settings
Mostly what @brendankenny said. The footer isn't meant to be an all-encompassing credits and I'm not sure the axe version is critical enough to the entire report to be included there.

Footer
Runtime settings are mostly things that change from run to run and are under the influence of the runner whereas the axe version is just derived from the Lighthouse version and isn't really specific to the run we saw.

Anyone wanna concede? :)

// fallback to package json so the report will always have some version.
const axeVersion = artifacts.Accessibility ?
artifacts.Accessibility.version :
require('../package.json').dependencies['axe-core'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let's combine this import of package.json with the one for lhVersion rather than require twice

Copy link
Member

@brendankenny brendankenny May 11, 2020

Choose a reason for hiding this comment

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

I believe package-json-versionify is going to strip out dependencies and make this a cannot read property 'axe-core' of undefined. We could drop that and just live with all of package.json in our bundle, but that is kind of unfortunate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

package-json-versionify

I had no idea that existed :) bummer too because there's no way that would've been caught either, smoke test of the bundle without running a11y?

Copy link
Collaborator

Choose a reason for hiding this comment

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

the error case @brendankenny points out of axe failing probably means we'll need the fallback even when we do run axe, maybe we should just always state this version?

@@ -131,6 +137,7 @@ class Runner {
benchmarkIndex: artifacts.BenchmarkIndex,
},
lighthouseVersion,
axeVersion,
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this belong in environment instead of the toplevel? I guess it might depend on our resolution to runtimesettings v. footer?

Copy link
Member

Choose a reason for hiding this comment

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

does this belong in environment instead of the toplevel? I guess it might depend on our resolution to runtimesettings v. footer?

+1 to moving to environment regardless. Not even axe puts the axe version number at the top level of their results object :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

+1. but how about a toplevel credits object though? or environment.credits ?

types/lhr.d.ts Outdated
@@ -41,6 +41,8 @@ declare global {
fetchTime: string;
/** The version of Lighthouse with which these results were generated. */
lighthouseVersion: string;
/** The version of Axe with which these results were generated. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** The version of Axe with which these results were generated. */
/** The version of axe-core with which these results were generated. */

@brendankenny
Copy link
Member

Runtime settings are mostly things that change from run to run and are under the influence of the runner whereas the axe version is just derived from the Lighthouse version and isn't really specific to the run we saw.

That's true, but that's partly just because we called it "runtime settings" and not the broader "environment" as it's named in the LHR :) If we ever switch to puppeteer as our chrome launcher and have a 1:1 Lighthouse version to Chrome version we probably still won't remove it from there.

// fallback to package json so the report will always have some version.
const axeVersion = artifacts.Accessibility ?
artifacts.Accessibility.version :
require('../package.json').dependencies['axe-core'];
Copy link
Member

@brendankenny brendankenny May 11, 2020

Choose a reason for hiding this comment

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

I believe package-json-versionify is going to strip out dependencies and make this a cannot read property 'axe-core' of undefined. We could drop that and just live with all of package.json in our bundle, but that is kind of unfortunate.

Comment on lines 110 to 111
// Use version from gathering stage. In case accessibility category doesn't run,
// fallback to package json so the report will always have some version.
Copy link
Member

Choose a reason for hiding this comment

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

Do we really care about including info on a library when we didn't run it? The larger question is probably should we be generalizing this to the equivalent of chrome://credits/ for all our libraries in the lhr but then selectively show in the report, but I also don't feel strongly.

@@ -107,6 +107,12 @@ class Runner {
// Entering: conclusion of the lighthouse result object
const lighthouseVersion = require('../package.json').version;

// Use version from gathering stage. In case accessibility category doesn't run,
// fallback to package json so the report will always have some version.
const axeVersion = artifacts.Accessibility ?
Copy link
Member

@brendankenny brendankenny May 11, 2020

Choose a reason for hiding this comment

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

The other failure mode is when artifacts.Accessibility exists but is an Error object because something threw.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let's just not show in runtime settings if we didn't find a version in the artifact

@paulirish
Copy link
Member

paulirish commented Jun 8, 2020

Resolution from last group discussion: we'll add to Runtime settings as ~"axe-core version"

two additional things

  1. we all recognize that this "runtime settings" block already includes items that belong in more of an "environment" grouping. we may explore this in the future
  2. we may choose to expose other version numbers in the future, but right now there's no strong need. If we do, we may change the "axe-core version" item to be more of a "credits" or "dependency versions" item.

@patrickhulce
Copy link
Collaborator

FYI @connorjclark it looks like we settled discussion on this and decided to proceed in runtime settings. I'll flip this to waiting for committer status accordingly, but no rush.

@connorjclark connorjclark changed the title report: show axe version in footer report: show axe version in runtime settings Jul 17, 2020
types/lhr.d.ts Outdated
@@ -41,6 +41,8 @@ declare global {
fetchTime: string;
/** The version of Lighthouse with which these results were generated. */
lighthouseVersion: string;
/** The version of libraries with which these results were generated. Ex: axe-core. */
credits: Record<string, string>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

a new toplevel property for this still makes me cringe a little, do we really foresee ever surfacing anything else here?

I'm still in camp environment.axeVersion ducks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

even after my suggestion of environment.credits ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

.environment.credits preferred to .credits for sure :)

I'm just hesitant on credits without any clue what would go into here that doesn't encourage us to start listing every dependency. is there any particular future lib you had in mind we might one day want to put into here?

Copy link
Collaborator Author

@connorjclark connorjclark Jul 17, 2020

Choose a reason for hiding this comment

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

I was thinking anything that informs the results of the report (so not, for example, lodash):

js-library-detector
third-party-web
robots-parser

(not exhaustive)

Not suggesting we show all in runtime settings. Would need different UI I think for more than one version. axe is the largest so am ok just showing that in runtime setting for now.

Copy link
Collaborator

@patrickhulce patrickhulce Jul 17, 2020

Choose a reason for hiding this comment

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

third-party-web

I see what you did there ;) I'm sold 👍 🤣 😆

].forEach(runtime => {
if (!runtime.description) return;
];
if (report.environment.credits && report.environment.credits['axe-core']) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is this how to properly maintain backwards compat?

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM

proto/lighthouse-result.proto Show resolved Hide resolved
Co-authored-by: Brendan Kenny <bckenny@gmail.com>
proto/lighthouse-result.proto Outdated Show resolved Hide resolved
proto/lighthouse-result.proto Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify axe-core version in report
7 participants