[go: nahoru, domu]

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

core(network-requests): add entity classification #15105

Merged
merged 12 commits into from
May 30, 2023

Conversation

benschwarz
Copy link
Contributor
@benschwarz benschwarz commented May 23, 2023

Summary

At present it's difficult to collect which requests are first and third party in LH. As of this PR, entity will be present in the network-requests audit output.

Related Issues/PRs

@benschwarz benschwarz changed the title 🥳 Add isFirstParty && isThirdParty to network-requests audit core(network-requests): 🥳 Add isFirstParty && isThirdParty to network-requests audit May 23, 2023
@benschwarz benschwarz changed the title core(network-requests): 🥳 Add isFirstParty && isThirdParty to network-requests audit core(network-requests): add isFirstParty & isThirdParty to audit May 23, 2023
Copy link
Member
@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

Should isFirstParty and/or isThirdParty be added to the audit table output?

No, it's fine. network-requests is a hidden audit so it would just be a few extra bytes with no benefit.

How do I update golden LHR?

yarn update:sample-json

const mainResource = await MainResource.request({devtoolsLog, URL: artifacts.URL}, context);
if (artifacts.GatherContext.gatherMode === "navigation") {
const mainResource = await MainResource.request(
{ devtoolsLog, URL: artifacts.URL },
Copy link
Member

Choose a reason for hiding this comment

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

this and the change above look like they may be default prettier formatting or something?

Copy link
Contributor Author
@benschwarz benschwarz May 24, 2023

Choose a reason for hiding this comment

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

yep. it was. do y'all have formatter settings that can be applied to VSCode? (I could add to the contributing guide if there is)

core/audits/network-requests.js Outdated Show resolved Hide resolved
@benschwarz benschwarz changed the title core(network-requests): add isFirstParty & isThirdParty to audit core(network-requests): add 3P entity to audit May 23, 2023
@benschwarz benschwarz marked this pull request as ready for review May 24, 2023 02:32
@benschwarz benschwarz requested a review from a team as a code owner May 24, 2023 02:32
@benschwarz benschwarz requested review from adamraine and removed request for a team May 24, 2023 02:32
@benschwarz
Copy link
Contributor Author

@brendankenny PTAL when you get the chance. Is there anything I've missed here?

@@ -77,6 +83,7 @@ class NetworkRequests extends Audit {
priority: record.priority,
isLinkPreload,
experimentalFromMainFrame,
entityName,
Copy link
Member

Choose a reason for hiding this comment

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

We could name this as entity to match the pattern of audit-side classification. Third-party summary audit is a good example.

When the entity property is provided from an audit, the report rendering side skips classification and relies on the provided one. See report-side classification yielding to audit provided entity.

In this case the audit isn't rendered, but would be good to keep the same convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for review @alexnj. PTAL 🙏

Copy link
Member
@alexnj alexnj left a comment

Choose a reason for hiding this comment

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

LGTM. Left one comment.

@benschwarz
Copy link
Contributor Author

@adamraine I think this is ready to go 👍

@connorjclark connorjclark changed the title core(network-requests): add 3P entity to audit core(network-requests): add entity classification May 30, 2023
@alexnj alexnj merged commit 06f17ae into GoogleChrome:main May 30, 2023
33 checks passed
@benschwarz benschwarz deleted the network-requests-party-hard branch May 30, 2023 23:36
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.

Add requestCount to third-party-summary subitem attributes
5 participants