Closed Bug 1395990 Opened 2 years ago Closed 2 years ago

Pass "-purgecaches" arg when creating chrome debugging process for artifact builds

Categories

(DevTools :: General, enhancement, P3)

enhancement

Tracking

(firefox57 fixed)

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

Details

Attachments

(3 files)

We are currently relying on Services.appinfo.isOfficial in order to add -purgeCaches to the arguments passed to the chrome debugging process at:

http://searchfox.org/mozilla-central/rev/51b3d67a5ec1758bd2fe7d7b6e75ad6b6b5da223/devtools/client/framework/ToolboxProcess.jsm#261-270

However Services.appinfo.isOfficial is only false for non-artifact builds. Artifact builds actually have it set to true since they are based on a CI-built artifact.

We could rely on the following combination of constants to get a better approximation:

> let isOfficialBuild = AppConstants.NIGHTLY_BUILD ||
>                       AppConstants.RELEASE_OR_BETA ||
>                       AppConstants.MOZ_DEV_EDITION;
Actually this other version fails in the same way. Looks like we have to use: 

> const IS_UNOFFICIAL_BUILD = Services.prefs.getStringPref("app.update.channel") === "default";

to get something that can be used for both artifact and non artifact builds.
We use `#ifndef MOZILLA_OFFICIAL` for turning on the remote debugging prefs in local builds, which works in artifact builds: https://dxr.mozilla.org/mozilla-central/source/modules/libpref/init/all.js#1049
So should be AppConstants.MOZILLA_OFFICIAL
Comment on attachment 8903660 [details]
Bug 1395990 - use constant MOZILLA_OFFICIAL to check for local build in ToolboxProcess.jsm;

https://reviewboard.mozilla.org/r/175430/#review180550
Attachment #8903660 - Flags: review?(bgrinstead) → review+
With this change it looks like there is only one other usage of "Services.appinfo.isOfficial" (in a test): https://dxr.mozilla.org/mozilla-central/search?q=%22Services.appinfo.isOfficial%22&redirect=false. Mossop, can that property go away?
Flags: needinfo?(dtownsend)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
(thanks for jumping on this and the review Brian!)
(In reply to Brian Grinstead [:bgrins] from comment #6)
> With this change it looks like there is only one other usage of
> "Services.appinfo.isOfficial" (in a test):
> https://dxr.mozilla.org/mozilla-central/search?q=%22Services.appinfo.
> isOfficial%22&redirect=false. Mossop, can that property go away?

Yes, we should use AppConstants.MOZILLA_OFFICIAL instead.
Flags: needinfo?(dtownsend)
Attachment #8903675 - Flags: review?(dtownsend)
Attachment #8903676 - Flags: review?(dtownsend)
Comment on attachment 8903675 [details]
Bug 1395990 - stop using Services.appinfo.isOfficial in test_TelemetrySession.js;

https://reviewboard.mozilla.org/r/175452/#review180560
Attachment #8903675 - Flags: review?(dtownsend) → review+
Comment on attachment 8903676 [details]
Bug 1395990 - remove Services.appinfo.isOfficial;

https://reviewboard.mozilla.org/r/175454/#review180562
Attachment #8903676 - Flags: review?(dtownsend) → review+
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d8b0d8d0043
use constant MOZILLA_OFFICIAL to check for local build in ToolboxProcess.jsm;r=bgrins
https://hg.mozilla.org/integration/autoland/rev/fb06b4e04043
stop using Services.appinfo.isOfficial in test_TelemetrySession.js;r=mossop
https://hg.mozilla.org/integration/autoland/rev/de9a050e5ff0
remove Services.appinfo.isOfficial;r=mossop
https://hg.mozilla.org/mozilla-central/rev/7d8b0d8d0043
https://hg.mozilla.org/mozilla-central/rev/fb06b4e04043
https://hg.mozilla.org/mozilla-central/rev/de9a050e5ff0
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.