make `mach doctor` architecture simpler
Categories
(Firefox Build System :: General, enhancement)
Tracking
(firefox91 fixed)
| Tracking | Status | |
|---|---|---|
| firefox91 | --- | fixed |
People
(Reporter: sheehan, Assigned: sheehan)
Details
Attachments
(4 files)
In it's current state, mach doctor prints some useful debugging information to the screen, and in some cases attempts to fix issues found on your system. Its implementation is a bit messy, using an object-oriented approach and requiring updating an array of values to add a new check. Each check returns a stringly-typed dict which is then parsed and printed to the screen.
We should make mach doctor simpler so we can expand on it as a tool for helping with self-service debugging. Each check should be a simple function that returns a well defined data structure. An entrypoint function can be used to run the checks and display information in a well defined manner, and we should also be able to run the checks and parse their values from a library. mach doctor should print nothing but errors to the screen by default, so users can run it to verify issues on their systems.
| Assignee | ||
Comment 1•4 years ago
|
||
Rewrite doctor.py from an object-oriented paradigm to a simpler
function-based architecture. Each check is a function that returns
or yields DoctorChecks. DoctorChecks contain a status that describes
the status of the check (success, warning, fatal error etc), a string
of text with useful information for display to the terminal, and may
optionally attach a callable which can be executed to fix issues found
by the checks.
mach doctor is updated to use the new run_doctor function instead
of creating a Doctor object. The default value of verbose in run_doctor
is False, meaning only issues with the users system are printed to the
screen.
Most of the existing check logic is left intact from the previous
implementation. Checks for platform are changed to use the
sys.platform.startswith pattern. The latest MozillaBuild version is
pulled by querying the tip commit on hg.mozilla.org instead of using
a hard-coded variable.
Comment 3•4 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 4•4 years ago
|
||
Adds a simple DNS query to mozilla.org as a doctor check.
We use socket.getaddrinfo to resolve the hostname to IP.
| Assignee | ||
Comment 5•4 years ago
|
||
Adds a simple check that a Mozilla domain is reachable over HTTPS.
Depends on D117078
| Assignee | ||
Comment 6•4 years ago
|
||
Adds a check that SSH access to hg.mozilla.org is properly configured.
Attempt to run ssh hg.mozilla.org which will authorize to hg over
SSH via pash, without running any commands on the service. In the case
the user has properly configured SSH we will see a success message and
information on the SCM levels granted to the user. If we don't see
a successful connection, parse the output to ensure the user is using
an email address as their username (which is require on hg.mozilla.org).
If the user couldn't connect yet does have an email address as their
username, notify them that they do not have permission to push to hgmo.
Depends on D117079
Comment 9•4 years ago
|
||
| bugherder | ||
Description
•