Closed Bug 1704146 Opened 4 years ago Closed 4 years ago

Extract default profile managing functions into `BackgroundTasksUtils.jsm`; return specific exit codes for default profile states

Categories

(Toolkit :: Application Update, task)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

Details

Attachments

(3 files)

I have some code to manage the default profile specifically for testing in the commits Bug 1703318. I'd like it to not wait for the metrics pieces, which will take a while to get hammered into shape, so I'm going to split that work into this ticket, which can land first.

Summary: Extract default profile managing functions into `BackgroundTasksUtils.jsm` → Extract default profile managing functions into `BackgroundTasksUtils.jsm`; return specific exit codes for default profile states

We duplicate these functions in two head.js files right now, and I'm
loathe to add a third, so let's extract a shared test module.

This is simply for testing convenience: it's awkward to use the
profile service to set the default profile. Centralizing these
functions in one place both makes the utility functions consistent and
helps make future tasks that want to do similar things adopt the
testing conventions automatically.

When no default profile exists, or there is an issue reading data from
it, we have limited options to surface the issue. Since we can't read
preferences, we can't rely on driving loglevels up. Similarly, we
can't use Glean to report metrics since the user's datareporting
preferences won't be respected.

Returning exit codes will allow us to distinguish various situations
in the Windows tasksched.exe history at least, as well as allowing
us to test easily.

Depends on D111347

Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5b7500d84394 Pre: Extract shared `BackgroundTasksTestUtils.jsm`. r=bytesized,application-update-reviewers https://hg.mozilla.org/integration/autoland/rev/33f5ffa72023 Part 1: Extract default profile managing functions to BackgroundTasksUtils. r=bytesized,application-update-reviewers https://hg.mozilla.org/integration/autoland/rev/baf49776c4b2 Part 2: Return exit codes for default profile states. r=bytesized,application-update-reviewers
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: