mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
60 lines
1.8 KiB
Bash
Executable File
60 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deterministic boundary for artifact regeneration: `export` copies the merged tree
|
|
# without git metadata (the remote URL carries the token); `import` copies back only
|
|
# generated artifacts, so nothing else a regen container produced can reach the repo.
|
|
set -euo pipefail
|
|
|
|
usage() {
|
|
echo "usage: $0 export <repo_dir> <scratch_dir>" >&2
|
|
echo " $0 import <scratch_dir> <repo_dir>" >&2
|
|
exit 2
|
|
}
|
|
|
|
cmd=${1:-}
|
|
src=${2:-}
|
|
dest=${3:-}
|
|
[ -n "$cmd" ] && [ -n "$src" ] && [ -n "$dest" ] || usage
|
|
[ -d "$src" ] || usage
|
|
|
|
case "$cmd" in
|
|
export)
|
|
# Refuse a pre-existing destination: a reused tree could keep a file from an
|
|
# earlier PR under an allowed generated path and leak it into this one.
|
|
if [ -e "$dest" ]; then
|
|
echo "refusing export: $dest already exists; use a fresh per-PR directory" >&2
|
|
exit 1
|
|
fi
|
|
mkdir -p "$(dirname "$dest")"
|
|
mkdir "$dest"
|
|
tar -C "$src" --exclude=.git -cf - . | tar -C "$dest" -xf -
|
|
;;
|
|
import)
|
|
[ -d "$dest" ] || usage
|
|
(
|
|
cd "$src"
|
|
find . -type f \
|
|
\( -name pnpm-lock.yaml -o -name uv.lock \
|
|
-o -path './frontend/src/generated/*' \
|
|
-o -path './products/*/frontend/generated/*' \) -print0
|
|
) | while IFS= read -r -d '' f; do
|
|
rel=${f#./}
|
|
path=$dest
|
|
old_ifs=$IFS
|
|
IFS=/
|
|
for part in $rel; do
|
|
path="$path/$part"
|
|
if [ -L "$path" ]; then
|
|
echo "refusing import: $path is a symlink" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
IFS=$old_ifs
|
|
mkdir -p "$dest/$(dirname "$rel")"
|
|
cp "$src/$f" "$dest/$rel"
|
|
done
|
|
;;
|
|
*)
|
|
usage
|
|
;;
|
|
esac
|