From ef50f4bd9775e86011d8d636df13422c0dcec287 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 26 Jan 2026 07:19:19 +0000 Subject: Fix parse failure output to show repo|npub instead of event_id|kind Phase 4 (30-extract-parse-failures.sh) now enriches parse failures with repo name and npub by looking up event_id in announcements.json. This is critical because 'Invalid announcement' rejections only log event_id and kind, not the repo name or npub. Phase 5 (40-classify-actions.sh) was also fixed to extract columns 4 and 5 (repo|npub) instead of columns 1 and 2 (event_id|kind) from parse-failures.txt. Without this fix, action-required.txt showed unusable output like: 000014b2... | 30617 | parse failure logged | fix event format... Now it correctly shows: scripts | npub1hs5244... | parse failure logged | fix event format... The enrichment uses jq to build a lookup table from announcements.json and optionally uses 'nak' to convert hex pubkeys to npub format. --- docs/how-to/migration-scripts/40-classify-actions.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/how-to/migration-scripts/40-classify-actions.sh') diff --git a/docs/how-to/migration-scripts/40-classify-actions.sh b/docs/how-to/migration-scripts/40-classify-actions.sh index 1706e47..53c0f9d 100755 --- a/docs/how-to/migration-scripts/40-classify-actions.sh +++ b/docs/how-to/migration-scripts/40-classify-actions.sh @@ -329,9 +329,11 @@ main() { # ========================================================================= log_info "Parsing log-based categories..." - # Parse failures: reponpubkindevent_idreason + # Parse failures: event_idkindreasonreponpub + # Note: repo and npub are in columns 4 and 5 (enriched by Phase 4 from announcements.json) + # Some entries may have empty repo/npub if the event_id wasn't found in announcements if [[ -f "$logs_dir/parse-failures.txt" ]] && file_has_content "$logs_dir/parse-failures.txt"; then - grep -v '^#' "$logs_dir/parse-failures.txt" | awk -F'\t' '{print $1 "|" $2}' | sort -u > "$tmp_dir/parse_failures.txt" + grep -v '^#' "$logs_dir/parse-failures.txt" | awk -F'\t' '{print $4 "|" $5}' | sort -u > "$tmp_dir/parse_failures.txt" log_info "Found $(wc -l < "$tmp_dir/parse_failures.txt" | tr -d ' ') parse failure entries" else touch "$tmp_dir/parse_failures.txt" -- cgit v1.2.3