CleanRun

The clean-run check: run the report's own command in the official image of its toolchain, with nothing of the reporter's machine around it, and compare what it prints with the failure in the report. Drift prints the command and never runs it.

Properties

Link copied to clipboard
const val ERROR_TEXT: String

Asked when the report shows a command and no error: its output gives the failure.

Link copied to clipboard
const val FAMILY: String
Link copied to clipboard
const val KEY: String

The fact a reply leaves in the session: CleanMatch.id of the reading.

Functions

Link copied to clipboard

The failure of the (already redacted) report text, as drift why --reply reads it.

Link copied to clipboard
fun isBinary(output: String): Boolean

True when output is binary or mostly control characters, so no reading applies.

Link copied to clipboard
fun quote(command: String): String?

command as one single-quoted shell word, or null when it is not safe to print: empty, over MAX_COMMAND characters, a control or non-ASCII character, a backtick, $(, a masked secret or a trailing backslash. An embedded single quote becomes '\''.

Link copied to clipboard
fun read(failure: ReportFailure, output: String): CleanRunReading

Compares the output of the clean run with failure: CleanMatch.SAME when a line of it (or a signal or transport symptom) is the report's failure, CleanMatch.DIFFERENT when it prints some other error, else CleanMatch.WORKS, which an empty output also is.