-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
clients(lr): insert assets in lhr for logging purposes #9002
Conversation
at some point we were going to delete all of this because the artifacts are returned by the module now. Can lr use that instead of this logging business? |
Discussed offline a bit. We considered changing the LR entry to return the entire RunnerResult, but that would involve some annoying parsing changes in LR. Realized we can just put all of the |
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.
Let's put up the LR-side of this for review as well?
It'd be easier to handle both at once.
*/ | ||
async function logAssets(artifacts, audits) { |
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.
once we have the LR-side to process your nested artifacts, I think we can delete this logAssets function.
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.
done
|
||
if (logAssets) { | ||
await assetSaver.logAssets(results.artifacts, results.lhr.audits); | ||
const assetsToLog = |
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 refactor doesn't seem to be a win. if anything, logAssets() should call its own private prepare method, but due to other comments, i dont think we'll end up needing this code anyhow.
// When LR is called with |internal: {keep_raw_response: true, save_lighthouse_assets: true}|, | ||
// this code will log artifacts to raw_response.artifacts. | ||
if (logAssets) { | ||
const reportObj = JSON.parse(runnerResult.report); |
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.
let's use runnerResult.lhr instead of parsing the string back
This enables logging from PSI.
Maybe we should log all the artifacts too?
Tests awaiting feedback.
Note: this PR is building on this (Googlers only).