-
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
report: augment auditRef, not result, with stackPack ref #8633
Conversation
@@ -72,21 +72,21 @@ class Util { | |||
} | |||
} | |||
|
|||
// For convenience, smoosh all AuditResults into their auditDfn (which has just weight & group) | |||
// For convenience, smoosh all AuditResults into their auditRef (which has just weight & group) |
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.
change this and "auditMeta" below to their modern names :)
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.
makes sense to me!
@@ -81,8 +81,8 @@ class CategoryRenderer { | |||
this.dom.find('.lh-audit__description', auditEl) | |||
.appendChild(this.dom.convertMarkdownLinkSnippets(audit.result.description)); | |||
|
|||
if (audit.result.stackPacks) { | |||
audit.result.stackPacks.forEach(pack => { | |||
if (audit.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 more sense to me 👍
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult)); | ||
const iconDataURL = 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E'; | ||
clonedSampleResult.stackPacks = [{ | ||
id: 'snackpack', |
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.
😆
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.
LGTM love this change, paying down tech debt and making new stuff more clear!
Not sure if I can convince everyone we should make this change :) Note that it's contained entirely within the report renderer, so there will be no effect on core, PSI, etc.
In
prepareReportResult
we smoosh a few things to make report rendering easier, like writing aLH.Audit.Result
to the relevantLH.Result.AuditRef
and, most recently, writingLH.ReportResult.StackPackDescription
to the relevantLH.Audit.Result
.This PR makes it so both
LH.Audit.Result
andLH.ReportResult.StackPackDescription
are written to the auditRef.On the con side: it makes a certain amount of sense to match stack packs to auditResults as they have a 1:1 match, while there may be multiple auditRefs to a single audit (and thus a stack pack).
However:
The solution in this PR keeps modifications contained within
LH.ReportResult.AuditRef
and makes that deletion in #8536 unnecessary.(@exterkamp if we land this you won't need any of your changes to
util-test.js
)