Skip to main content

Module push_trigger_log

Module push_trigger_log 

Source
Expand description

The record of each decision of the push trigger: handed over, or declined with its reason. What: The record of every decision of the push trigger after a command that adds commits: handed over, or declined with the step that declined and why. Why: A merge that was never pushed left nothing to look at, because the trigger returned silently at eight places and the reason sat only in the code. The record is one JSON line appended to a size-capped file in the common Git directory beside the commit timing records, and a debug line under MONOCHROMATIC_VERBOSE=true; the person’s terminal shows neither.

In TS you’d write (pseudocode):

await appendFile(join(commonDir, 'cli-git-push-trigger.jsonl'), JSON.stringify({ command, outcome, reason }) + '\n');

Structs§

Decision
Everything one line states.
Origin
The worktree a decision was made in; the file is shared by every worktree of the repository, so a line must say which.

Enums§

Outcome
How the trigger ended for one command.

Constants§

TRIGGER_FILE
The file inside the common Git directory that collects the trigger records of every worktree of the repository.
TRIGGER_SCHEMA_VERSION
The version of the record’s fields; it changes only when a field’s meaning changes, never when a field is added.

Functions§

level_of
The level a line states: warn for a decision the wrapper could not make or a hand-over that failed, else info.
record_decision
What: Records one decision: a debug line always (when verbose), and one appended line when the common Git directory is known. Why: The command’s result never depends on the record: a file that cannot be written is only a debug line.
trigger_line
What: The line for one decision. Why: The fields say which worktree (worktree, gitDir, instance), which command, which release, which branch and the one reason with what it read, so a missing push is diagnosed from the file alone; the userinfo of a URL in the detail is masked, because a failure the service reports can name a remote.