-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
core: fix sample_v2 generation, proto errors #8605
Conversation
@@ -53,7 +53,7 @@ | |||
"type-check": "tsc -p . && tsc -p lighthouse-viewer/", | |||
"i18n:checks": "./lighthouse-core/scripts/i18n/assert-strings-collected.sh", | |||
"i18n:collect-strings": "node lighthouse-core/scripts/i18n/collect-strings.js", | |||
"update:sample-artifacts": "node lighthouse-core/scripts/update-report-fixtures.js -G", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't do anything :)
ok, not being able to even have an empty array might be a bridge too far. Have to think about it :) |
@@ -161,6 +161,9 @@ message LighthouseResult { | |||
string entry_type = 2; | |||
google.protobuf.DoubleValue start_time = 3; | |||
google.protobuf.DoubleValue duration = 4; | |||
|
|||
// Whether timing entry was collected during artifact gathering. | |||
bool gather = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't @exterkamp just remove this ? maybe I'm just misremembering what I saw haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, unless he had amnesia I don't think so... @exterkamp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it from my PR so it could be here where it made more sense 😄
@@ -61,7 +61,7 @@ declare global { | |||
/** The record of all formatted string locations in the LHR and their corresponding source values. */ | |||
i18n: {rendererFormattedStrings: I18NRendererStrings, icuMessagePaths: I18NMessages}; | |||
/** An array containing the result of all stack packs. */ | |||
stackPacks: Result.StackPack[]; | |||
stackPacks?: Result.StackPack[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait this had no other impact being required the whole time? 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait this had no other impact being required the whole time? 😆
Yeah, the only code using was treating it as optional anyways, so easy change (or so I thought).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeated vs. ListValue elides [] and makes the samples different, this doesn't address that? Need to make it be elided in sample as well, not [].
@@ -161,6 +161,9 @@ message LighthouseResult { | |||
string entry_type = 2; | |||
google.protobuf.DoubleValue start_time = 3; | |||
google.protobuf.DoubleValue duration = 4; | |||
|
|||
// Whether timing entry was collected during artifact gathering. | |||
bool gather = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it from my PR so it could be here where it made more sense 😄
"lighthouseVersion": "4.3.0", | ||
"requestedUrl": "http://localhost:10200/dobetterweb/dbw_tester.html", | ||
"runWarnings": [], | ||
"stackPacks": [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the proto round trip test fail b/c empty list is elided. [] == nothing in proto as repeated. This comes back to the whole ListValue thing. See appveyor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, yes I know. See my comment #8605 (comment) :)
OK, 2a22744 is the solution I'll advocate for. Basically the JS side is helping out the proto side by allowing I've enabled that by modifying the proto test expectation so that if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this compromise. Technically from the proto
side, if we wanted []
and undefined
to be equivalent then we'd use repeated
which is what we're doing. The test was the problem, it didn't consider them equivalent, but now it does. So LGTM!
recently we (I) have asked a few PRs to update a subset of example artifacts and then
sample_v2.json
. However if you try to runyarn update:sample-artifacts
and thenyarn update:sample-json
, you'll notice there are a few errors preventing you from actually doing that :)This PR
fixes the
throttling-method
mismatch between the-G
and the-A
by switching-G
todevtools
to match-A
adds the optional
gather
boolean to the protoTiming
entry interface so that gatherer entries, when reimported with-A
, will still result in a proto-able LHR at the end.I'm not sure how often that will come up in practice for PSI, but it's possible, and with
false
/undefined
as the default, it's zero overhead when there are nogather
props (as there aren't in the currentsample_v2.json
because the source artifacts haveTiming: []
)makes
lhr.stackPacks
optional, matching the proto's treatment of them as arepeated
field. This is probably the easiest resolution to lhr.stackPacks doesn't make the proto round trip #8245 (and solves ensure 4.x LHR and 5.0 report renderer compatibility #8598 for stack packs automatically :), and now folks won't have to keep manually adding that back.cc @exterkamp
fixes #8245