From 5570b9631e03c077faa95fbf1f068a4360d25bd7 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 9 Jan 2026 21:51:52 +0000 Subject: Fix production-sync-testing.md guide and sanitize-logs.sh script - Fix shebang in sanitize-logs.sh from #!/bin/bash to #!/usr/bin/env bash for NixOS compatibility - Update sanitizer defaults from 100/20 to 200/100 chars for better log readability - Fix CLI argument names in guide: --sync-bootstrap-relay -> --sync-bootstrap-relay-url - Fix CLI argument names in guide: --git-path -> --git-data-path These issues were discovered during first-time testing of the production sync testing guide. --- docs/how-to/production-sync-testing.md | 18 +++++++++--------- scripts/sanitize-logs.sh | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/how-to/production-sync-testing.md b/docs/how-to/production-sync-testing.md index dfff20d..a55e9ea 100644 --- a/docs/how-to/production-sync-testing.md +++ b/docs/how-to/production-sync-testing.md @@ -38,7 +38,7 @@ This domain has few repo announcements listing it, so sync stays manageable. The bootstrap relay provides the initial set of announcements to discover repos: ```bash ---sync-bootstrap-relay wss://git.shakespeare.diy +--sync-bootstrap-relay-url wss://git.shakespeare.diy ``` ### 3. Run with Time Limit @@ -51,9 +51,9 @@ rm -rf /tmp/ngit-test-* # Run for 30 seconds with sanitized output timeout 30s cargo run -- \ - --sync-bootstrap-relay wss://git.shakespeare.diy \ + --sync-bootstrap-relay-url wss://git.shakespeare.diy \ --domain ngit.danconwaydev.com \ - --git-path /tmp/ngit-test-git \ + --git-data-path /tmp/ngit-test-git \ --relay-data-path /tmp/ngit-test-relay \ 2>&1 | ./scripts/sanitize-logs.sh | tee sync-test.log ``` @@ -72,8 +72,8 @@ cargo run -- [args] 2>&1 | ./scripts/sanitize-logs.sh ``` **Options:** -- `--head-chars N` - First N characters to show (default: 100) -- `--tail-chars N` - Last N characters to show (default: 20) +- `--head-chars N` - First N characters to show (default: 200) +- `--tail-chars N` - Last N characters to show (default: 100) Example output: ``` @@ -245,9 +245,9 @@ tracing::trace!("Per-event detail that's too noisy"); ```bash timeout 30s cargo run -- \ - --sync-bootstrap-relay wss://git.shakespeare.diy \ + --sync-bootstrap-relay-url wss://git.shakespeare.diy \ --domain ngit.danconwaydev.com \ - --git-path /tmp/ngit-test-git \ + --git-data-path /tmp/ngit-test-git \ --relay-data-path /tmp/ngit-test-relay \ 2>&1 | ./scripts/sanitize-logs.sh ``` @@ -256,9 +256,9 @@ timeout 30s cargo run -- \ ```bash timeout 30s cargo run -- \ - --sync-bootstrap-relay wss://git.shakespeare.diy \ + --sync-bootstrap-relay-url wss://git.shakespeare.diy \ --domain ngit.danconwaydev.com \ - --git-path /tmp/ngit-test-git \ + --git-data-path /tmp/ngit-test-git \ --relay-data-path /tmp/ngit-test-relay \ --metrics-address 127.0.0.1:9090 \ 2>&1 | ./scripts/sanitize-logs.sh diff --git a/scripts/sanitize-logs.sh b/scripts/sanitize-logs.sh index 123e72c..7225fe4 100755 --- a/scripts/sanitize-logs.sh +++ b/scripts/sanitize-logs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # sanitize-logs.sh - Truncates verbose log lines for LLM analysis # # Usage: @@ -9,8 +9,8 @@ set -euo pipefail # Default settings -HEAD_CHARS=100 -TAIL_CHARS=20 +HEAD_CHARS=200 +TAIL_CHARS=100 MAX_LINE_LENGTH=$((HEAD_CHARS + TAIL_CHARS + 20)) # buffer for the ellipsis marker # Parse arguments @@ -35,8 +35,8 @@ while [[ $# -gt 0 ]]; do echo "Reads from stdin, writes to stdout." echo "" echo "Options:" - echo " --head-chars N Show first N chars of long lines (default: 100)" - echo " --tail-chars N Show last N chars of long lines (default: 20)" + echo " --head-chars N Show first N chars of long lines (default: 200)" + echo " --tail-chars N Show last N chars of long lines (default: 100)" echo " --max-line N Lines shorter than this are unchanged (default: head+tail+20)" echo " -h, --help Show this help" echo "" -- cgit v1.2.3