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-28 14:17:30 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-28 14:17:30 +0000
commit3c1eda5fc9e660d40cadcdef8903aea986fe3242 (patch)
treec11f81ca30069f4deca24de7c9c47368733ab7b8 /docs/how-to/migration-scripts/run-migration-analysis.sh
parentefc3da477d4edb9d1334718e3e20d197ba711468 (diff)
feat(migration): detect when archive git data is ahead of prod
Add git ancestry comparison (22-compare-git-data.sh) to determine commit relationships between prod and archive repos. Repos where archive is ahead are now correctly classified as ready-for-migration since ngit-grasp only accepts git data authorized by state events. Previously, repos with different git data were flagged as needs-resync even when archive had newer/better data than prod.
Diffstat (limited to 'docs/how-to/migration-scripts/run-migration-analysis.sh')
-rwxr-xr-xdocs/how-to/migration-scripts/run-migration-analysis.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/docs/how-to/migration-scripts/run-migration-analysis.sh b/docs/how-to/migration-scripts/run-migration-analysis.sh
index 089b553..acc5e44 100755
--- a/docs/how-to/migration-scripts/run-migration-analysis.sh
+++ b/docs/how-to/migration-scripts/run-migration-analysis.sh
@@ -320,7 +320,7 @@ check_prerequisites() {
320 fi 320 fi
321 321
322 # Check scripts exist 322 # Check scripts exist
323 for script in 01-fetch-events.sh 10-check-git-sync.sh 20-categorize.sh 21-compare-relays.sh 30-extract-parse-failures.sh 31-extract-purgatory-expiry.sh 40-classify-actions.sh; do 323 for script in 01-fetch-events.sh 10-check-git-sync.sh 20-categorize.sh 21-compare-relays.sh 22-compare-git-data.sh 30-extract-parse-failures.sh 31-extract-purgatory-expiry.sh 40-classify-actions.sh; do
324 if [[ ! -x "$SCRIPT_DIR/$script" ]]; then 324 if [[ ! -x "$SCRIPT_DIR/$script" ]]; then
325 log_error "Script not found or not executable: $SCRIPT_DIR/$script" 325 log_error "Script not found or not executable: $SCRIPT_DIR/$script"
326 missing=1 326 missing=1
@@ -551,6 +551,20 @@ run_phase_3() {
551 fi 551 fi
552 552
553 run_phase 3 "Categorize & Compare (fast)" "${cmds[@]}" 553 run_phase 3 "Categorize & Compare (fast)" "${cmds[@]}"
554
555 # Phase 3c: Compare git data between relays (requires git paths)
556 # This determines if archive is ahead of prod for repos with mismatched state
557 if [[ -n "$PROD_GIT" && -n "$ARCHIVE_GIT" ]]; then
558 # Build list of repos to compare: those where prod=complete but archive is not
559 local repos_to_compare="$OUTPUT_DIR/comparison/complete-prod-incomplete-archive.txt"
560 if [[ -f "$repos_to_compare" ]] && [[ ! -f "$OUTPUT_DIR/comparison/git-ancestry.tsv" ]]; then
561 log_info "Running git ancestry comparison (Phase 3c)..."
562 run_phase 3 "Git Ancestry Comparison" "'$SCRIPT_DIR/22-compare-git-data.sh' '$PROD_GIT' '$ARCHIVE_GIT' '$repos_to_compare' '$OUTPUT_DIR/comparison'"
563 fi
564 else
565 log_warn "Git paths not provided - skipping git ancestry comparison"
566 log_warn "Without git comparison, repos where archive is ahead will be incorrectly flagged as needing re-sync"
567 fi
554} 568}
555 569
556# Phase 4: Extract logs 570# Phase 4: Extract logs