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

feat(chrome-scans): Add ChromiumComponentsShouldUseWebScanner rule #871

Merged
merged 5 commits into from
Jan 27, 2023

Conversation

sfoslund
Copy link
Member

Details

This PR is 1/2 of addressing #836. It includes the following commits/changes, which can be reviewed separately:

  • 27295d6 adds a new sample project to the tools repo that uses a minimal webview2.
  • b007694 adds the ChromiumComponentsShouldUseWebScanner rule and a new e2e test leveraging the new web view sample added in this PR.
Motivation

Addresses issue #836

Context

This PR only adds the new rule logic but does not do the work to suppress any further errors in descendants of the root "Chrome" element (hence why there are 35 expected errors in the end to end test instead of just 1). A future PR will add the suppression logic separately.

Pull request checklist

  • Addresses an existing issue: #0000

@sfoslund sfoslund requested a review from a team as a code owner January 25, 2023 23:03
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2023

Codecov Report

Merging #871 (137a51a) into main (4fc19c3) will increase coverage by 1.08%.
The diff coverage is 80.70%.

@@            Coverage Diff             @@
##             main     #871      +/-   ##
==========================================
+ Coverage   73.70%   74.78%   +1.08%     
==========================================
  Files         398      422      +24     
  Lines       12046    13017     +971     
==========================================
+ Hits         8878     9735     +857     
- Misses       3168     3282     +114     
Impacted Files Coverage Δ
src/Actions/Actions/ControlPatternAction.cs 0.00% <0.00%> (ø)
src/Actions/Actions/CustomUIAAction.cs 0.00% <0.00%> (ø)
src/Actions/Actions/ListenAction.cs 0.00% <0.00%> (ø)
src/Actions/Actions/PrivacyExtensions.cs 100.00% <ø> (ø)
src/Actions/Actions/SetDataAction.cs 0.00% <0.00%> (ø)
...rc/Actions/Attributes/InteractionLevelAttribute.cs 0.00% <0.00%> (ø)
src/Actions/Misc/ExtensionMethods.cs 7.46% <0.00%> (-31.60%) ⬇️
src/Actions/Resources/ErrorMessages.Designer.cs 0.00% <ø> (-55.56%) ⬇️
src/Automation/AxeWindowsAutomationException.cs 33.33% <ø> (-33.34%) ⬇️
src/Automation/Data/OutputFile.cs 88.88% <ø> (ø)
... and 429 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@codeofdusk codeofdusk left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -520,4 +520,8 @@ HowToFix: {2}
Condition: {3}</value>
<comment>{0} is id, {1} is description, {2} is how to fix, and {3} is condition</comment>
</data>
<data name="ChromiumComponentsShouldUseWebScanner" xml:space="preserve">
<value>Chromium components should be scanned with a web-based scanner.</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

The "how to fix" guidance suggests K4W.

{
Info.Description = Descriptions.ChromiumComponentsShouldUseWebScanner;
Info.HowToFix = HowToFix.ChromiumComponentsShouldUseWebScanner;
Info.ErrorCode = EvaluationCode.Error;
Copy link
Contributor

@DaveTryon DaveTryon Jan 26, 2023

Choose a reason for hiding this comment

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

At one point, someone mentioned possibly treating this as a framework issue, which would mean creating a web page and linking to it here. Did we ultimately decide against that approach?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't aware of that discussion and Fer is OOF so we won't be able to get her input for a while. Is that something that had been settled previously?

@sfoslund sfoslund merged commit f83d5e7 into microsoft:main Jan 27, 2023
@sfoslund sfoslund deleted the AddChromeRule branch January 27, 2023 18:56
sfoslund added a commit that referenced this pull request Jan 27, 2023
#### Details

Adding test utility suggested in
#871 (comment).
Initially this PR only leverages the new utility in the 3 tests that are
not overlapping with those changed in
#871 to avoid PR conflicts,
but I'll either update this PR or that one depending on which gets
merged first.

##### Motivation

Address PR feedback from
#871

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a"
in the checkbox -->
- [n/a] Addresses an existing issue: #0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants