feat(doctor): emit the checks as JSON so a deployment can be monitored - #154
Merged
Merged
Conversation
`doctor_cmd` formatted the checks as a column-aligned table and nothing else, so an operator who wants to know that their deployment stopped being able to send mail — before a participant fails to receive an invitation — had to scrape text whose width depends on the longest check name. `--json` prints one object per check with `name`, `state` and `detail`, as the whole of standard output and nothing else, so it can be piped straight into a parser. The exit code is untouched: non-zero when any check failed, in both modes, because a monitor reads both. Those three field names are now an interface. Renaming one breaks whatever is alerting on it, so `DOCTOR_JSON_FIELDS` names them in one place and the test asserts the emitted keys are exactly that tuple. The text format is what people read and has not moved: a new test rebuilds the expected table from `run_doctor()` and compares the command's stdout line for line. The secret-redaction test now covers the JSON path as well, since that output gets pasted into issues just as often. Closes #126 Signed-off-by: L4XB <lukas.buck@e-mail.de>
Member
Author
|
I have read and agree to the SixSentences CLA v1.0. |
The audit pins a hash per exported file, so a change under services/api has to rewrite it. Signed-off-by: L4XB <lukas.buck@e-mail.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
six-community doctorformatted its checks as an aligned text table and nothingelse, so an operator who wants to be told that their deployment stopped being
able to send mail — before a participant fails to receive an invitation — had to
scrape column-aligned text whose width depends on the longest check name.
--jsonemits one object per check withname,stateanddetail. The datawas already structured; only the rendering was not.
Closes #126.
Behavior and compatibility
six-community doctor --jsonprints a JSON array on stdout and nothing else,on either stream, so it can be piped straight into a parser.
monitor reads the body and the status.
run_doctor()and compares the command's stdout line for line, so the formatpeople read cannot drift while the other one is added.
statebreaks the day one of them is renamed, so they are named once in
DOCTOR_JSON_FIELDSand the test asserts the emitted keys are exactly thattuple — a rename fails the suite rather than somebody's monitoring.
jsonis stdlib and isimported inside the branch, as elsewhere in this module).
Why an array of objects rather than one object keyed by check name: the checks
have an order an operator reads them in,
_provider_checks()returns a variablenumber of them, and an array keeps both without making the key set part of the
contract.
Validation
ruff format --check src testsreports one file it would reformat,tests/test_email_verification.py, and that is unchanged by this branch — itreports the same on
main.extension is unaffected.
pass on the pinned Xcode toolchains—or the Companion is unaffected.
Review boundaries
tenancy, capability URLs, uploads, retention, deletion, browser state, and
logs as applicable. The JSON carries exactly the
detailstrings the texttable already printed;
test_no_configured_secret_reaches_the_outputnowruns the command with
--jsonand asserts the same canaries are absent.and document data egress, cost, retention, and failure behavior—or none
were added.
redistribution-compatible—or none were added.
permission, signing, update, and binary-distribution implications.
no research-facing behavior changed.
changed.
and generated host access were reviewed—or the extension is unaffected.
Source-release hygiene
data, user upload, database dump, log, private prompt, or non-redistributable
research content is included.
commercial-plan, hosted-administration, and marketing-site code remains
separate.
deploy/community/README.mdgains the
--jsoninvocation, what the three fields mean, and that they area stable interface.
CHANGELOG.mdis updated for user-visible changes, or the omission isexplained above.
Signed-off-bytrailer.CLA.mdand posted its exact acceptance sentence as astandalone pull-request comment.
Visual evidence
Not a UI change. What the new mode prints: