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

Add additional details to webcompat report #20052

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

DJAndries
Copy link
Collaborator

@DJAndries DJAndries commented Sep 7, 2023

Resolves brave/brave-browser#32661

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Use MITM proxy to ensure that all additional details are being appended to report.

@DJAndries DJAndries requested a review from a team as a code owner September 7, 2023 19:51
@github-actions github-actions bot added potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false CI/storybook-url Deploy storybook and provide a unique URL for each build labels Sep 7, 2023
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@DJAndries DJAndries force-pushed the webcompat-add-details branch from b2bab5c to 459c8ae Compare September 7, 2023 21:13
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@DJAndries DJAndries force-pushed the webcompat-add-details branch from 459c8ae to 46d9fd6 Compare September 7, 2023 22:23
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@DJAndries DJAndries force-pushed the webcompat-add-details branch from 46d9fd6 to 0ddec7c Compare September 16, 2023 00:18
browser/ui/BUILD.gn Outdated Show resolved Hide resolved
Comment on lines +136 to +140
params_dict.Set(kSiteURLField, report_url.spec());
params_dict.Set(kShieldsEnabledField, shields_enabled);
params_dict.Set(kAdBlockSettingField, GetAdBlockModeString(ad_block_mode));
params_dict.Set(kFPBlockSettingField,
GetFingerprintModeString(fp_block_mode));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we define a struct for this data? I was going to let it slide since I figured it would be written directly to JSON, but that's not even the case 😛

Especially if we can expose that struct definition in a way so it can be shared with iOS, although it doesn't have to be in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

could you maybe elaborate? this is kind of hacky, but the JSON is passed to the dialog via the webui params (which is JSON), and then those same params are passed back to the UI handler upon submission (also via JSON). I haven't found a way to pass a struct directly from the "open dialog" function to the UI handler.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I understand now. I was hoping we could have a custom struct as a constructor argument for the delegate, but the current one that takes base::Value just directly sets params_ from the inherited class. Nevermind!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah it's a shame. this is a pretty cringey way to pass data, to say the least....

}
}

ad_block_list_names_ = base::JoinString(ad_block_list_names, ",");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd personally recommend using component IDs here for slightly easier machine-readability/consistency with the catalog in https://github.com/brave/adblock-resources (list names may change, infrequently). Then again, I'm not going to be the one looking at the raw report uploads 😄

Copy link
Collaborator Author

@DJAndries DJAndries Sep 18, 2023

Choose a reason for hiding this comment

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

happy to change this if it would be more useful. as you know, all of our webcompat reports are displayed on our dashboard in a human readable format, for manual review. i assumed it would be more useful for an adblock/easylist dev to see the name of the list in this case, but please correct me if i'm wrong since I will also not be looking at the reports! 😄 . curious to hear your thoughts on my perspective

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't feel strongly about it. We'd be able to figure out what lists are referenced either way if reviewing raw upload data, and having the names directly available makes it easier to do so without any changes to the tooling.

The benefits of using the component IDs are

  1. fixed size/format
  2. constant identifier even if list names change

(1) is 100% a serverside implementation concern, so I have no preference there
(2) is slightly nicer for the sake of consistency in longer-term analysis, but we delete reports after 30 days anyways so it's not even too relevant either

Copy link
Collaborator Author

@DJAndries DJAndries Sep 18, 2023

Choose a reason for hiding this comment

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

Thanks for elaborating. If using names would make report reviews easier, then I would prefer to go that route. From a server-side perspective, it's much easier for us to store the names, as we will not have to maintain a mapping of component IDs to list names which would increase query complexity, risk for mapping inconsistencies, etc. etc. The size of the field is not a concern, considering the low volume of reports (compared to the rest of the stats data we manage). If you think that potential name changes won't cause too much trouble, then I hope to keep this as is

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@DJAndries DJAndries force-pushed the webcompat-add-details branch from 0ddec7c to 5e48387 Compare September 18, 2023 23:26
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

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

strings++ (with a nit)

@DJAndries DJAndries force-pushed the webcompat-add-details branch from 5e48387 to 1d316b5 Compare September 19, 2023 18:19
Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

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

strings++

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

Copy link
Contributor

@pes10k pes10k left a comment

Choose a reason for hiding this comment

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

lgtm

@pes10k
Copy link
Contributor

pes10k commented Sep 19, 2023

just checking @DJAndries , are any needed updates to the privacy policy complete?

And, will this affect android and desktop? Or just desktop?

@DJAndries
Copy link
Collaborator Author

And, will this affect android and desktop? Or just desktop?

For this PR, just desktop

@pes10k
Copy link
Contributor

pes10k commented Sep 19, 2023

since most of this doesn't have a UI component, what is needed to enable it on android too?

@DJAndries
Copy link
Collaborator Author

since most of this doesn't have a UI component, what is needed to enable it on android too?

not too much, i think. the changes required will basically be a duplicate of this PR, but in Java. Raised brave/brave-browser#33126

@pes10k
Copy link
Contributor

pes10k commented Sep 19, 2023

thanks thanks, though im surprised that Java is needed (again since there isn't a UI/UX component to the change) will follow up with the android experts. Thanks!

@DJAndries DJAndries merged commit adafb1f into master Sep 19, 2023
6 checks passed
@DJAndries DJAndries deleted the webcompat-add-details branch September 19, 2023 22:02
brave-builds added a commit that referenced this pull request Sep 19, 2023
@kjozwiak
Copy link
Member

kjozwiak commented Oct 4, 2023

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.60.76 Chromium: 118.0.5993.32 (Official Build) nightly (64-bit)
-- | --
Revision | c66376dd699f9327afd2f556c90b029bf4aa32e9
OS | Windows 11 Version 22H2 (Build 22621.2361)
  • installed/launched 1.60.76 Chromium: 118.0.5993.32
  • visited brave.com and disabled shields which displayed the Report a broken site UI within the shields panel
  • clicked on Report site and then submitted a report via Submit
  • ensured that the data mentioned via Add additional details to webcompat report brave-browser#32661 (comment) was present via https://webcompat.brave.com/1/webcompat
Example Example Example
image image WebCompatReport

kjozwiak pushed a commit that referenced this pull request Oct 4, 2023

ad_block_list_names_ = base::JoinString(ad_block_list_names, ",");

#if BUILDFLAG(ENABLE_BRAVE_VPN)
Copy link
Collaborator

Choose a reason for hiding this comment

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

the UI code is not the correct place to put this because it's creating an unnecessary dependency from //brave/browser/ui -> //brave/browser/tor which already has deps issues and require check_includes = false. This should be encapsulated in another interface for report generation that only exposes a header target to //brave/browser/ui

* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "brave/components/webcompat_reporter/browser/fields.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this file named fields? Also why does it even need to be public in the first place? It appears to only be called in WebcompatReporterDialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional details to webcompat report
8 participants