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 type validation to the default_preferences generation (PR 10548 follow-up) #10610

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

Snuffleupagus
Copy link
Collaborator

The generated default_preferences.json file is necessary when initializing the Firefox preferences, which only supports certain types, hence this patch adds additional validation to help prevent run-time errors in Firefox.

Given that these changes add a code-path to AppOptions.getAll which could throw, the OptionKind.PREFERENCE branch is also modified to require exact matching to prevent (future) errors in the viewer.

Finally the conditionally defined defaultOptions will no longer (potentially) be considered during the gulp default_preferences task, to make it more difficult for them to be accidentally included.

… follow-up)

The generated `default_preferences.json` file is necessary when initializing the Firefox preferences, which only supports certain types, hence this patch adds additional validation to help prevent run-time errors in Firefox.

Given that these changes add a code-path to `AppOptions.getAll` which could throw, the `OptionKind.PREFERENCE` branch is also modified to require *exact* matching to prevent (future) errors in the viewer.

Finally the conditionally defined `defaultOptions` will no longer (potentially) be considered during the `gulp default_preferences` task, to make it more difficult for them to be accidentally included.
@Snuffleupagus
Copy link
Collaborator Author

/botio-windows lint
/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Mar 3, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/4a4b35b8e27ccc5/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 3, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/0fc8f9f6a92f752/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Mar 3, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/4a4b35b8e27ccc5/output.txt

Total script time: 1.80 mins

Published

@pdfjsbot
Copy link

pdfjsbot commented Mar 3, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/0fc8f9f6a92f752/output.txt

Total script time: 2.85 mins

  • Lint: Passed

@timvandermeij timvandermeij merged commit 07ef11f into mozilla:master Mar 6, 2019
@timvandermeij
Copy link
Contributor

timvandermeij commented Mar 6, 2019

Thank you for making this less prone to errors!

@Snuffleupagus Snuffleupagus deleted the prefs-type-validation branch March 6, 2019 23:39
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.

None yet

3 participants