Skip to main content

Module report

Module report 

Source
Expand description

Typed reports and the output contract shared by the text and JSON renderers.

The layers are separate on purpose:

  1. Builders (build) are pure: they read the app, the registered models and the settings and return typed reports. They open no database connection and print nothing.
  2. Renderers (text, json) turn a report into a string. No renderer parses another renderer’s output.

Every report travels in an Envelope whose schema_version only changes for breaking changes; new fields are additive. The JSON Schema is docs/schemas/cli-report-v1.json.

Exit codes are 0 (success), 1 (failure, including a check that found an error) and 2 (usage error); see EXIT_OK.

Modules§

build
Pure report builders. They read compiled metadata only: no database connection is opened and nothing is printed.
channel
Where JSON reports go, and the envelope of a command that failed before it could produce its report.
json
The JSON renderer.
snapshot
A bounded, versioned snapshot of an application’s metadata: the framework version, compiled features, database aliases with their backend kinds, registered models, documented routes and the OpenAPI document.
text
Text renderers. They reproduce the historical terminal output of check and routes byte for byte.

Structs§

CheckSummary
Summary of a check run (the data of its envelope).
Diagnostic
One finding.
Envelope
The versioned wrapper around every structured report.
FieldReport
One column of a registered model.
MigrationReport
One migration in a showmigrations report.
MigrationStatusData
The data of a showmigrations envelope: the same rows, in the same order, as the text output.
ModelReport
One registered model.
ModelsData
The data of a models report, sorted by name then table.
RouteReport
One documented route.
RoutesData
The data of a routes envelope. Routes are the documented routes of the OpenAPI document (hidden endpoints are omitted), sorted by path then method.

Enums§

Severity
How serious a Diagnostic is.
UrlSource
Where the database URL of a live command came from. The URL itself is never reported.

Constants§

EXIT_FAILURE
Exit code of a failed command.
EXIT_OK
Exit code of a successful command.
EXIT_USAGE
Exit code of a usage error.
REDACTED
What a redacted value is replaced with.
SCHEMA_VERSION
Version of the JSON envelope. Bumped only for breaking changes.

Functions§

redact_field
Redact the value of a field called key: all of it when the key looks secret, otherwise any credentials inside it (see redact_text).
redact_text
Redact every credential found in text.