Day 030 / Frappe / Patch Operations

Patch Log Formatter

View source ↗Scroll to explore ↓
Patch Log Formatter project cover
/ Overview

A dependency-free Python CLI that turns sanitized Frappe patch execution records into chronological text or JSON summaries with explicit status counts and durations.

NamePatch Log Formatter

ClientIndependent daily build

IndustriesDeveloper and operations tooling

DateDay 030 · September 29, 2026

/ Challenge

Raw patch logs can be noisy and may contain tracebacks, SQL or deployment details that do not belong in a shareable summary. Comparing execution order and outcomes manually also makes failed or skipped patches easy to miss.

/ Provided services

Clear thinking.
Practical delivery.

01

Chronological review

Sorts sanitized patch executions by normalized start time and patch identifier, with an explicit duration for each record.

02

Data-minimized input

Accepts only patch name, final status and two timestamps; arbitrary log fields such as tracebacks and SQL are rejected.

03

Automation-ready result

Offers readable and JSON output with distinct exit codes for clean reports, reported failures and invalid input.

Patch Log Formatter feature visual
/ Solution

Patch Log Formatter accepts at most 200 sanitized records with exactly four allowlisted fields, normalizes timezone-aware timestamps to UTC, calculates durations and produces a deterministic chronological report. It rejects arbitrary fields and never reads bench logs, runs patches, connects to Frappe or changes a system.

/ Impact

Success, failed and skipped totals

Timezone-aware UTC timeline

Per-patch duration calculation

Unknown fields rejected

Text and JSON output

Twelve passing standard-library tests

/ Tech stack

Python standard library

Argparse, datetime, pathlib, regular expressions and JSON provide the complete dependency-free CLI.

Frappe operations

Models a narrow patch-review workflow without claiming to execute, inspect or repair a live bench.

Unittest

Twelve tests cover counts, durations, UTC normalization, sorting, immutability, validation, text output and CLI exit behavior.

Next project

Site Config Redactor

View case study ↗