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 better validation for the "PREFERENCE" kind AppOptions #17694

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

Snuffleupagus
Copy link
Collaborator

Given that the "PREFERENCE" kind is used e.g. to generate the preference-list for the Firefox PDF Viewer, those options need to be carefully validated.
With this patch we'll now check this unconditionally in development mode, during testing, and when creating the preferences in the gulpfile.

@Snuffleupagus Snuffleupagus force-pushed the validate-defaultOptions branch 2 times, most recently from 885bc96 to 64ca88f Compare February 19, 2024 21:19
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@Snuffleupagus Snuffleupagus force-pushed the validate-defaultOptions branch 2 times, most recently from 54ef398 to 3d38e09 Compare February 20, 2024 16:12
Given that the "PREFERENCE" kind is used e.g. to generate the preference-list for the Firefox PDF Viewer, those options need to be carefully validated.
With this patch we'll now check this unconditionally in development mode, during testing, and when creating the preferences in the gulpfile.
Previously we'd simply export this directly from `web/app_options.js`, which meant that it'd be technically possible to *accidentally* modify the `compatibilityParams` Object when accessing it.
To avoid this we instead introduce a new `AppOptions`-method that is used to lookup data in `compatibilityParams`, which means that we no longer need to export this Object.

Based on these changes, it's now possible to simplify some existing code in `AppOptions` by taking full advantage of the nullish coalescing (`??`) operator.
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@mozilla mozilla deleted a comment from moz-tools-bot Feb 20, 2024
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/655caa29cb2c93b/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/655caa29cb2c93b/output.txt

Total script time: 1.23 mins

Published

@Snuffleupagus
Copy link
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/40505e54592ed46/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/72f5b40c2de57d1/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/72f5b40c2de57d1/output.txt

Total script time: 24.75 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 12
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/72f5b40c2de57d1/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/40505e54592ed46/output.txt

Total script time: 39.18 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 3

Image differences available at: http://54.193.163.58:8877/40505e54592ed46/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit 30e6995 into mozilla:master Mar 12, 2024
9 checks passed
@Snuffleupagus Snuffleupagus deleted the validate-defaultOptions branch March 12, 2024 17:24
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.

3 participants