Enable locking of auto update setting
Categories
(Toolkit :: Application Update, enhancement)
Tracking
()
People
(Reporter: bytesized, Assigned: bytesized)
References
Details
Attachments
(9 files)
97.67 KB,
image/png
|
Details | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
16.99 KB,
patch
|
RyanVM
:
approval-mozilla-esr68+
|
Details | Diff | Splinter Review |
The automatic update setting has a bit of a complicated implementation that no longer strictly uses the pref system. Instead, the correct interface to interact with the setting is UpdateUtils.(get|set)AppUpdateAutoEnabled()
. This interface currently does not allow the setting to be locked. I would like to add this functionality to enable an enterprise policy forcing automatic updates to be enabled.
Assignee | ||
Comment 1•5 years ago
|
||
I was going to do this by adding a locking mechanism for this setting that the policy could be hooked up to, but I have now realized that, on Windows, you could just open the file and edit the value, which isn't a great enforcement mechanism for an enterprise policy. So I am changing my plan to instead just query the policy engine directly.
Assignee | ||
Comment 2•5 years ago
|
||
While changing the code that controls the update settings on the preferences page, I noticed a bug that I intend to include a fix for in this patch (screenshot of bug attached). I had thought that we locked this setting when update is disabled by policy, but it turns out that we hide it. But we don't hide the Windows-specific notification about how the setting works. So the notification is shown, referring to a preference that is not.
Given that this is a one-line change in an area of code that I'm already changing with this patch, I think it is acceptable to skip filing a separate bug for this.
Assignee | ||
Comment 3•5 years ago
|
||
This adds the policy to the policy engine, but does not add the functionality, which will be done in another patch in this stack.
Assignee | ||
Comment 4•5 years ago
|
||
This functionality is being replaced by the policy: AppAutoUpdate
Depends on D63978
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D63979
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D63980
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D63981
Assignee | ||
Comment 8•5 years ago
|
||
Includes fixes for the following bugs:
- "auto-update-config-change" notification is never sent because it never updates its cached value so it always thinks the value is uninitialized, at state in which it does not send the notification.
- maybeUpdateAutoConfigChanged doesn't send the first notification because the value hasn't changed yet, just been set. But this is only true on Windows. On other OS's, the function is only called when the value changes.
- If a non-Windows user changes the app.update.auto pref value, it effectively changes the value of the auto update setting but doesn't generate a "auto-update-config-change" notification.
- Minor cleanup of an unnecessary bind call.
Depends on D63982
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D63983
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
Backed out 7 changesets (Bug 1612979) for causing browser chrome failure at browser/disable_app_update/browser_policy_disable_app_update.js
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=291467147&repo=autoland&lineNumber=16547
[task 2020-03-03T17:17:24.161Z] 17:17:24 INFO - TEST-PASS | browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js | Should not be able to check for updates with DisableAppUpdate enabled. -
[task 2020-03-03T17:17:24.163Z] 17:17:24 INFO - Leaving test bound test_updates_post_policy
[task 2020-03-03T17:17:24.163Z] 17:17:24 INFO - Entering test bound test_update_preferences_ui
[task 2020-03-03T17:17:24.166Z] 17:17:24 INFO - Buffered messages finished
[task 2020-03-03T17:17:24.168Z] 17:17:24 INFO - TEST-UNEXPECTED-FAIL | browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js | Update choices should be diabled when app update is locked by policy - false == true - got false, expected true (operator ==)
[task 2020-03-03T17:17:24.168Z] 17:17:24 INFO - Stack trace:
[task 2020-03-03T17:17:24.169Z] 17:17:24 INFO - is@resource://specialpowers/SpecialPowersSandbox.jsm:89:21
[task 2020-03-03T17:17:24.169Z] 17:17:24 INFO - @chrome://mochitests/content/browser/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js:32:7
[task 2020-03-03T17:17:24.170Z] 17:17:24 INFO - execute@resource://specialpowers/SpecialPowersSandbox.jsm:140:12
[task 2020-03-03T17:17:24.170Z] 17:17:24 INFO - _spawnTask@resource://specialpowers/SpecialPowersChild.jsm:1727:15
[task 2020-03-03T17:17:24.170Z] 17:17:24 INFO - receiveMessage@resource://specialpowers/SpecialPowersChild.jsm:285:21
[task 2020-03-03T17:17:24.171Z] 17:17:24 INFO - JSWindowActor query*receiveMessage@resource://specialpowers/SpecialPowersParent.jsm:1055:12
[task 2020-03-03T17:17:24.171Z] 17:17:24 INFO - JSWindowActor query*spawn@resource://specialpowers/SpecialPowersChild.jsm:1682:17
[task 2020-03-03T17:17:24.171Z] 17:17:24 INFO - test_update_preferences_ui@chrome://mochitests/content/browser/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js:29:23
[task 2020-03-03T17:17:24.172Z] 17:17:24 INFO - Async*Tester_execTest/<@chrome://mochikit/content/browser-test.js:1062:34
[task 2020-03-03T17:17:24.172Z] 17:17:24 INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1097:11
[task 2020-03-03T17:17:24.173Z] 17:17:24 INFO - nextTest/<@chrome://mochikit/content/browser-test.js:925:14
[task 2020-03-03T17:17:24.173Z] 17:17:24 INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:914:23
[task 2020-03-03T17:17:24.174Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206, Main Thread] WARNING: '!inner', file /builds/worker/workspace/build/src/dom/ipc/JSWindowActorService.cpp, line 182
[task 2020-03-03T17:17:24.178Z] 17:17:24 INFO - Leaving test bound test_update_preferences_ui
[task 2020-03-03T17:17:24.178Z] 17:17:24 INFO - Entering test bound test_update_about_ui
[task 2020-03-03T17:17:24.178Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 0x7fd006997000 == 9 [pid = 4206] [id = {ed1363b6-b428-41eb-bf63-cbd71e9b94d2}]
[task 2020-03-03T17:17:24.178Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 19 (0x7fd01136bde0) [pid = 4206] [serial = 19] [outer = (nil)]
[task 2020-03-03T17:17:24.178Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 20 (0x7fd007b5cc00) [pid = 4206] [serial = 20] [outer = 0x7fd01136bde0]
[task 2020-03-03T17:17:24.178Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206, Main Thread] WARNING: '!aUseRemoteTabs && mUseRemoteSubframes', file /builds/worker/workspace/build/src/docshell/base/nsDocShell.cpp, line 1581
[task 2020-03-03T17:17:24.179Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206, Main Thread] WARNING: Attempting to get a displayport from a content with no primary frame!: file /builds/worker/workspace/build/src/layout/base/nsLayoutUtils.cpp, line 791
[task 2020-03-03T17:17:24.180Z] 17:17:24 INFO - GECKO(4206) | [Parent 4206, Main Thread] WARNING: NS_ENSURE_TRUE(root) failed: file /builds/worker/workspace/build/src/layout/base/nsDocumentViewer.cpp, line 3137
[task 2020-03-03T17:17:24.180Z] 17:17:24 INFO - Console message: [JavaScript Warning: "XUL box for hbox element contained an inline #text child, forcing all its children to be wrapped in a block." {file: "chrome://browser/content/aboutDialog.xhtml" line: 0}]
[task 2020-03-03T17:17:24.183Z] 17:17:24 INFO - Console message: [JavaScript Warning: "XUL box for hbox element contained an inline #text child, forcing all its children to be wrapped in a block." {file: "chrome://browser/content/aboutDialog.xhtml" line: 0}]
[task 2020-03-03T17:17:24.183Z] 17:17:24 INFO - Console message: [JavaScript Warning: "XUL box for hbox element contained an inline #text child, forcing all its children to be wrapped in a block." {file: "chrome://browser/content/aboutDialog.xhtml" line: 0}]
[task 2020-03-03T17:17:24.184Z] 17:17:24 INFO - Console message: [JavaScript Warning: "XUL box for hbox element contained an inline #text child, forcing all its children to be wrapped in a block." {file: "chrome://browser/content/aboutDialog.xhtml" line: 0}]
[task 2020-03-03T17:17:24.184Z] 17:17:24 INFO - TEST-PASS | browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js | About dialog appeared -
[task 2020-03-03T17:17:24.264Z] 17:17:24 INFO - TEST-PASS | browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js | The About Dialog panel Id should equal policyDisabled -
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ae0edb10b4b6
https://hg.mozilla.org/mozilla-central/rev/7ff3e1eca482
https://hg.mozilla.org/mozilla-central/rev/92a849b58a96
https://hg.mozilla.org/mozilla-central/rev/b97e098a8590
https://hg.mozilla.org/mozilla-central/rev/73880324e493
https://hg.mozilla.org/mozilla-central/rev/9140dcb8abf8
https://hg.mozilla.org/mozilla-central/rev/abeadcea1d5d
Comment 15•5 years ago
|
||
Is this upliftable to ESR?
Assignee | ||
Comment 16•5 years ago
|
||
[Approval Request Comment]
If this is not a sec:{high,crit} bug, please state case for ESR consideration:
This patch replaces a non-functional policy mechanism with a new policy. Since ESR is widely used by enterprise, I think it makes sense to uplift an enterprise policy fix to ESR.
User impact if declined:
Attempts to control automatic update by setting app.update.auto with the preference manipulation enterprise policy will have inconsistent results.
Fix Landed on Version:
75
Risk to taking this patch (and alternatives if risky):
Risk seems pretty low. The code being changed hasn't been touched since 68. I rebased the patch onto ESR68 and did some manual inspection and testing of the patch, which all looks fine.
See https://wiki.mozilla.org/Release_Management/ESR_Landing_Process for more info.
I know that we generally land code through Lando now, but I wanted to post a rollup patch for uplift, since the rebase did require some merging. Let me know if there is a different way that I ought to have done this.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 17•5 years ago
|
||
flod, there's a new string in the esr68 patch here, how much of a pain is it from a l10n pov?
Comment 18•5 years ago
|
||
(In reply to Julien Cristau [:jcristau] from comment #17)
flod, there's a new string in the esr68 patch here, how much of a pain is it from a l10n pov?
No sides effect on sign-offs, etc. but it will never be translated at this point. From a user point of view, it doesn't seem like a huge problem, since it's a policy description with a limited target.
Comment 19•5 years ago
|
||
Yeah, we've decided we're OK if policy descriptions don't get translated. More important to get the changes into ESR.
Comment 20•5 years ago
|
||
Hello,
I have tried verifying this with 76.0a1(20200317093640), on Windows 10x64 and Ubuntu 18.04 and as far as I can tell, the UI of about:preferences is affected by this policy(in the sense that "Allow Nightly:" subsection is removed).
However the aformentioned section is removed with both AppAutoUpdate to false&true.
Could you please provide QA with STR to properly test this policy implementation?
Assignee | ||
Comment 21•5 years ago
|
||
Yes, that behavior is expected. This is how I would verify this patch:
Set the AppAutoUpdate
policy to true. This forces automatic updates.
- Check about:preferences to see that the Auto Update setting is hidden.
- Ensure that the policy has taken effect by checking for this console output:
await UpdateUtils.getAppUpdateAutoEnabled()
should returntrue
UpdateUtils.appUpdateAutoSettingIsLocked()
should returntrue
await UpdateUtils.setAppUpdateAutoEnabled(false)
should throw an exception
Now set the AppAutoUpdate
policy to false. This prevents automatic updates.
- Check about:preferences to see that the Auto Update setting is hidden.
- Ensure that the policy has taken effect by checking for this console output:
await UpdateUtils.getAppUpdateAutoEnabled()
should returnfalse
UpdateUtils.appUpdateAutoSettingIsLocked()
should returntrue
await UpdateUtils.setAppUpdateAutoEnabled(true)
should throw an exception
Now unset the AppAutoUpdate
policy.
- Check about:preferences to see that the Auto Update setting is not hidden.
- Ensure that the setting is unaffected by policy by checking for this console output (make sure to run these in order):
await UpdateUtils.setAppUpdateAutoEnabled(true)
should returntrue
await UpdateUtils.getAppUpdateAutoEnabled()
should returntrue
await UpdateUtils.setAppUpdateAutoEnabled(false)
should returnfalse
await UpdateUtils.getAppUpdateAutoEnabled()
should returnfalse
UpdateUtils.appUpdateAutoSettingIsLocked()
should returnfalse
Comment 22•5 years ago
|
||
Hello all,
Thank you Kirk for the clarification in regards to the patch content.
Confirming this issue as verified fixed on 75.0b7(ID:20200322132212) and 76.0a1(ID:20200323213856) with all the above enlisted elements.
Updated•5 years ago
|
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
bugherder uplift |
Comment 25•5 years ago
|
||
Hello,
Confirming this issue as verified fixed. I have verified 68.7.0esr(ID:20200326192020) (Treeherder build) on Windows 10x64, Ubuntu 18.04x64, macOS 10.15 .
Description
•