fix(hg): show clone errors, stable cwd; shrink timeline fonts
Remove /dev/null redirects in hg-ingest.sh so errors are visible. cd to work dir before loop to prevent getcwd failures after rm. Use $HOME instead of ~ for proper expansion in default values. Reduce timeline entry title, subtitle, and body font sizes for a more compact activity feed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,11 +15,10 @@ set -euo pipefail
|
||||
|
||||
DATABASE_URL="${DATABASE_URL:-postgres://moments_rw@magrathea.kosherinata.internal:5432/moments?sslmode=verify-full&sslrootcert=/etc/pki/ca-trust/source/anchors/root-internal.pem&sslcert=/etc/pki/tls/misc/$(hostname -f).pem&sslkey=/etc/pki/tls/private/$(hostname -f).pem}"
|
||||
HG_HOST="${HG_HOST:-hg-edge.mozilla.org}"
|
||||
WORK_DIR="${HG_WORK_DIR:-~/hg}"
|
||||
WORK_DIR="${HG_WORK_DIR:-$HOME/hg}"
|
||||
|
||||
# Repos to clone (groups are expanded inline)
|
||||
REPOS=(
|
||||
mozilla-central
|
||||
integration/mozilla-inbound
|
||||
integration/autoland
|
||||
integration/fx-team
|
||||
@@ -56,6 +55,7 @@ total=0
|
||||
CLONE_DIR="$WORK_DIR/clone"
|
||||
CACHE_DIR="$WORK_DIR/cache"
|
||||
mkdir -p "$CACHE_DIR"
|
||||
cd "$WORK_DIR"
|
||||
|
||||
for repo in "${REPOS[@]}"; do
|
||||
cache_file="$CACHE_DIR/$(echo "$repo" | tr '/' '_').tsv"
|
||||
@@ -68,7 +68,7 @@ for repo in "${REPOS[@]}"; do
|
||||
rm -rf "$CLONE_DIR"
|
||||
|
||||
echo "[hg-ingest] cloning $repo"
|
||||
if ! hg clone --noupdate "https://$HG_HOST/$repo" "$CLONE_DIR" 2>/dev/null; then
|
||||
if ! hg clone --noupdate "https://$HG_HOST/$repo" "$CLONE_DIR"; then
|
||||
echo "[hg-ingest] clone failed: $repo (skipping)"
|
||||
continue
|
||||
fi
|
||||
@@ -86,7 +86,7 @@ for repo in "${REPOS[@]}"; do
|
||||
# Extract matching changesets to cache file
|
||||
hg log -R "$CLONE_DIR" -r "$revset" \
|
||||
--template '{node}\t{author}\t{date|hgdate}\t{desc|firstline}\n' \
|
||||
> "$cache_file" 2>/dev/null || true
|
||||
> "$cache_file" || true
|
||||
|
||||
# Free disk immediately
|
||||
rm -rf "$CLONE_DIR"
|
||||
@@ -101,8 +101,7 @@ for repo in "${REPOS[@]}"; do
|
||||
date_ts="${date_raw%% *}"
|
||||
|
||||
# Build ISO timestamp from unix epoch
|
||||
occurred_at=$(date -u -d "@${date_ts}" '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || \
|
||||
date -u -r "${date_ts}" '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null)
|
||||
occurred_at=$(date -u -d "@${date_ts}" '+%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
event_id="hg:${repo}:${node}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user