upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/how-to/migration-scripts/run-migration-analysis.sh
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-23 16:12:03 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-27 20:38:04 +0000
commit2b21b807bdf6c0bab548ffceb5c41eee0902890c (patch)
treee3b17db923384dd512ae40f0f263de165d119f4f /docs/how-to/migration-scripts/run-migration-analysis.sh
parent6a6c8cf8b70bc387ea7241b5c9ec457cb525eb40 (diff)
Prevent Phase 4 from using wrong service (ngit-relay vs ngit-grasp)
Add validation to ensure Phase 4 scripts use ngit-grasp service (with structured logging) instead of ngit-relay service. Changes: - Add validate-service.sh helper for reusable service validation - Add validation to run-migration-analysis.sh before Phase 4 - Add validation to 30-extract-parse-failures.sh - Add validation to 31-extract-purgatory-expiry.sh - Update migration guide with clear warnings about service selection - Expand troubleshooting for 'Phase 4 finds no logs' issue - Emphasize lesson learned in relay.ngit.dev notes This prevents the issue where Phase 4 was run against ngit-relay.service and found no parse failures because structured logging only exists in ngit-grasp services.
Diffstat (limited to 'docs/how-to/migration-scripts/run-migration-analysis.sh')
-rwxr-xr-xdocs/how-to/migration-scripts/run-migration-analysis.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/how-to/migration-scripts/run-migration-analysis.sh b/docs/how-to/migration-scripts/run-migration-analysis.sh
index 65d9d17..b2ca142 100755
--- a/docs/how-to/migration-scripts/run-migration-analysis.sh
+++ b/docs/how-to/migration-scripts/run-migration-analysis.sh
@@ -548,6 +548,34 @@ run_phase_4() {
548 return 0 548 return 0
549 fi 549 fi
550 550
551 # Validate service name before running Phase 4
552 # Structured logging only exists in ngit-grasp, not ngit-relay
553 if [[ "$SERVICE_NAME" == *"ngit-relay"* ]]; then
554 log_error "SERVICE_NAME appears to be ngit-relay: $SERVICE_NAME"
555 log_error ""
556 log_error "Phase 4 requires an ngit-grasp service with structured logging."
557 log_error "Structured logging ([PARSE_FAIL], [PURGATORY_EXPIRED]) only exists"
558 log_error "in ngit-grasp services, NOT in ngit-relay services."
559 log_error ""
560 log_error "Please update --service to use the ngit-grasp archive service."
561 log_error ""
562 log_error "To find the correct service name:"
563 log_error " systemctl list-units 'ngit-grasp*' --all"
564 log_error ""
565 log_error "Common ngit-grasp service names:"
566 log_error " - ngit-grasp.service"
567 log_error " - ngit-grasp-relay-ngit-dev.service (NixOS multi-instance)"
568 log_error " - ngit-grasp-archive.service"
569 return 1
570 fi
571
572 # Warn if service name doesn't look like ngit-grasp
573 if [[ "$SERVICE_NAME" != *"ngit-grasp"* && "$SERVICE_NAME" != *"grasp"* ]]; then
574 log_warn "SERVICE_NAME doesn't contain 'ngit-grasp': $SERVICE_NAME"
575 log_warn "Structured logging only exists in ngit-grasp services."
576 log_warn "If this is not an ngit-grasp service, Phase 4 will find no logs."
577 fi
578
551 local cmds=() 579 local cmds=()
552 580
553 cmds+=("'$SCRIPT_DIR/30-extract-parse-failures.sh' '$SERVICE_NAME' '$OUTPUT_DIR/logs'") 581 cmds+=("'$SCRIPT_DIR/30-extract-parse-failures.sh' '$SERVICE_NAME' '$OUTPUT_DIR/logs'")