Skip to content

report: add Trust & Safety group under Best Practices#10623

Merged
devtools-bot merged 13 commits into
masterfrom
trust_safety
Apr 30, 2020
Merged

report: add Trust & Safety group under Best Practices#10623
devtools-bot merged 13 commits into
masterfrom
trust_safety

Conversation

@Beytoven

Copy link
Copy Markdown
Contributor

As the title suggests, this PR simply moves the Trust and Safety related audits to a specified sub-category. All other Best Practices audits are moved under General.

Screen Shot 2020-04-22 at 5 18 48 PM

@Beytoven Beytoven requested a review from a team as a code owner April 23, 2020 00:24
@Beytoven Beytoven requested review from patrickhulce and removed request for a team April 23, 2020 00:24

@patrickhulce patrickhulce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks great @Beytoven thanks! :)

/** Title of the Trust & Safety group of the Best Practices category. Within this section are the audits related to trust and safety. */
safetyGroupTitle: 'Trust & Safety',
/** Title of the General group of the Best Practices category. Within this section are the audits that don't belong to a specific group. */
generalGroupTitle: 'General',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
generalGroupTitle: 'General',
bestPracticesGeneralGroupTitle: 'General',

I like that the others prefix with the category, especially nice for a group titled General ;)

/** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */
bestPracticesCategoryTitle: 'Best Practices',
/** Title of the Trust & Safety group of the Best Practices category. Within this section are the audits related to trust and safety. */
safetyGroupTitle: 'Trust & Safety',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
safetyGroupTitle: 'Trust & Safety',
bestPracticesSafetyGroupTitle: 'Trust & Safety',

{id: 'image-aspect-ratio', weight: 1},
{id: 'image-size-responsive', weight: 1},
// Trust & Safety
{id: 'is-on-https', weight: 1, group: 'trust-and-safety'},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

per #10619 I think we want to add redirects-http too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't realize we were moving one of the PWA audits as well. @connorjclark can you confirm?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's have redirects-http be in PWA and this new subgroup.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh yes definitely don't move, I just meant also have it show up here :)

Comment thread lighthouse-core/config/default-config.js
@brendankenny

Copy link
Copy Markdown
Contributor

are ungrouped audits still a thing? Is it better to have everything else under 'General' or to just have them be ungrouped?

I don't have a strong opinion, but generally using up UI space just to have a generic "other things" title doesn't add that much. OTOH maybe it doesn't look so great not grouped :)

{id: 'image-size-responsive', weight: 1},
// Trust & Safety
{id: 'is-on-https', weight: 1, group: 'trust-and-safety'},
{id: 'external-anchors-use-rel-noopener', weight: 1, group: 'trust-and-safety'},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how would you feel about best-practices-trust-and-safety? right now basically every group prefixes the category or an abbreviation of it

@brendankenny

Copy link
Copy Markdown
Contributor

are ungrouped audits still a thing?

oh, looks like ungrouped ones come first which wouldn't be great for this. What great ascii art someone put in that comment, though!

I guess the order could be reversed, but OTOH here is @patrickhulce arguing for the exact opposite of "minimum amount of groups pls" :)

@Beytoven

Copy link
Copy Markdown
Contributor Author

are ungrouped audits still a thing?

oh, looks like ungrouped ones come first which wouldn't be great for this. What great ascii art someone put in that comment, though!

I guess the order could be reversed, but OTOH here is @patrickhulce arguing for the exact opposite of "minimum amount of groups pls" :)

The styling doesn't look too good with a mix of grouped and ungrouped audits.

For reference:
Screen Shot 2020-04-22 at 5 04 35 PM

…r gatherers w/ properties that have a .bind() function
@brendankenny brendankenny changed the title report: add T&S subcategory under Best Practices report: add Trust & Safety group under Best Practices Apr 28, 2020

@brendankenny brendankenny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agreed with @patrickhulce this looks just about ready to go!

Comment thread lighthouse-core/config/default-config.js Outdated
Comment thread lighthouse-core/config/default-config.js Outdated
Comment thread lighthouse-core/config/default-config.js Outdated
title: str_(UIStrings.seoCrawlingGroupTitle),
description: str_(UIStrings.seoCrawlingGroupDescription),
},
'best-practices-safety': {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe best-practices-trust-safety?

If I come in looking for the Trust and Safety group, my ctrl-f would definitely start with "trust" :)


assert.equal(config.passes.length, 1, 'did not filter config');
assert.deepStrictEqual(config, extendedConfig, 'had mutations');
expect(config).toMatchObject(extendedConfig, 'had mutations');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

toMatchObject here only checks that everything in extendedConfig is in config, which means config can be extendedConfig plus extra non-matching properties and this assertion would still pass.

e.g. if one of the gatherer.implementation in extendedConfig accidentally got switched to {}, it would match with almost anything in the same gatherer.implementation slot in config.

This could be checked both ways (each is a subset of the other) with

expect(config).toMatchObject(extendedConfig, 'had mutations');
expect(extendedConfig).toMatchObject(config, 'had mutations');

to check both directions but I think we really want

expect(config).toEqual(extendedConfig, 'had mutations');

to make sure we're being strict on equality.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh good catch, while we're on the subject I don't think the message part works with that particular expect API, so we can nix had mutations or convert it to a comment and stick to the actual object diff

Comment thread lighthouse-core/test/config/config-test.js Outdated
Co-Authored-By: Brendan Kenny <bckenny@gmail.com>
Co-Authored-By: Patrick Hulce <patrick.hulce@gmail.com>

@patrickhulce patrickhulce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, nicely done @Beytoven! 🎉

Comment thread lighthouse-core/audits/dobetterweb/no-document-write.js Outdated
Comment thread lighthouse-core/test/config/config-test.js Outdated
Co-Authored-By: Patrick Hulce <patrick.hulce@gmail.com>
@patrickhulce

Copy link
Copy Markdown
Collaborator

@brendankenny did you wish to have another look or are you fine with my LGTM?

@brendankenny brendankenny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes, sorry to barge in, LGTM2!

@patrickhulce

Copy link
Copy Markdown
Collaborator

cool!

FYI @Beytoven you might need to merge master to fix the required statuses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants