diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-26 07:19:19 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-27 20:38:09 +0000 |
| commit | ef50f4bd9775e86011d8d636df13422c0dcec287 (patch) | |
| tree | 068396117f44e59318a4ffff6535547e7020c6f7 /docs/how-to/migration-scripts/40-classify-actions.sh | |
| parent | 0e00db4decfa779c26c6c7648b2badcc5704e6f8 (diff) | |
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.
Diffstat (limited to 'docs/how-to/migration-scripts/40-classify-actions.sh')
| -rwxr-xr-x | docs/how-to/migration-scripts/40-classify-actions.sh | 6 |
1 files changed, 4 insertions, 2 deletions
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() { | |||
| 329 | # ========================================================================= | 329 | # ========================================================================= |
| 330 | log_info "Parsing log-based categories..." | 330 | log_info "Parsing log-based categories..." |
| 331 | 331 | ||
| 332 | # Parse failures: repo<TAB>npub<TAB>kind<TAB>event_id<TAB>reason | 332 | # Parse failures: event_id<TAB>kind<TAB>reason<TAB>repo<TAB>npub |
| 333 | # Note: repo and npub are in columns 4 and 5 (enriched by Phase 4 from announcements.json) | ||
| 334 | # Some entries may have empty repo/npub if the event_id wasn't found in announcements | ||
| 333 | if [[ -f "$logs_dir/parse-failures.txt" ]] && file_has_content "$logs_dir/parse-failures.txt"; then | 335 | if [[ -f "$logs_dir/parse-failures.txt" ]] && file_has_content "$logs_dir/parse-failures.txt"; then |
| 334 | grep -v '^#' "$logs_dir/parse-failures.txt" | awk -F'\t' '{print $1 "|" $2}' | sort -u > "$tmp_dir/parse_failures.txt" | 336 | grep -v '^#' "$logs_dir/parse-failures.txt" | awk -F'\t' '{print $4 "|" $5}' | sort -u > "$tmp_dir/parse_failures.txt" |
| 335 | log_info "Found $(wc -l < "$tmp_dir/parse_failures.txt" | tr -d ' ') parse failure entries" | 337 | log_info "Found $(wc -l < "$tmp_dir/parse_failures.txt" | tr -d ' ') parse failure entries" |
| 336 | else | 338 | else |
| 337 | touch "$tmp_dir/parse_failures.txt" | 339 | touch "$tmp_dir/parse_failures.txt" |