Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(dx): make migration notice more prominent (#18711)

Nimar332867f62fdf
diff --git a/scripts/release-preflight.sh b/scripts/release-preflight.sh
index 7a0a69a97f..2c8a1823c0 100755
--- a/scripts/release-preflight.sh
+++ b/scripts/release-preflight.sh
@@ -99,28 +99,44 @@ collect_clickhouse_migrations_not_in_production() {
<(collect_clickhouse_migration_names_at_ref origin/production)
}
+migration_authors() {
+ local authors
+ authors="$(git log --format='%aN' origin/production..HEAD -- "$@" \
+ | sort -u \
+ | awk 'NR > 1 {printf ", "} {printf "%s", $0} END {print ""}')"
+ printf '%s\n' "${authors:-unknown (check Git history)}"
+}
+
confirm_migrations_are_applied() {
local prisma_migrations="$1"
local clickhouse_migrations="$2"
+ local migration authors
- log "Detected migrations in main that are not yet on production."
+ echo
+ log "🚨🚨🚨 MIGRATIONS REQUIRE ATTENTION 🚨🚨🚨"
+ log "Detected migrations in main that are not yet on production. Verify they have been applied before releasing."
if [[ -n "$prisma_migrations" ]]; then
log "Postgres (Prisma) migrations not yet promoted:"
while IFS= read -r migration; do
- [[ -n "$migration" ]] && echo " - $migration"
+ [[ -n "$migration" ]] || continue
+ authors="$(migration_authors "packages/shared/prisma/migrations/$migration")"
+ echo " - $migration (authors: $authors)"
done <<< "$prisma_migrations"
fi
if [[ -n "$clickhouse_migrations" ]]; then
log "ClickHouse migrations not yet promoted:"
while IFS= read -r migration; do
- [[ -n "$migration" ]] && echo " - $migration"
+ [[ -n "$migration" ]] || continue
+ authors="$(migration_authors ":(glob)packages/shared/clickhouse/migrations/**/${migration}.*.sql")"
+ echo " - $migration (AUTHORS: $authors)"
done <<< "$clickhouse_migrations"
fi
echo
- log "Confirm you have reviewed these migrations and applied them to the production Postgres and ClickHouse databases."
+ log "📣 Authors must apply their migrations AND deploy afterward. Please let the authors know."
+ log "🛑 Confirm you have reviewed these migrations and applied them to the production Postgres and ClickHouse databases."
read -r -p "Type '${MIGRATION_CONFIRMATION_TOKEN}' to continue: " confirmation
if [[ "$confirmation" != "$MIGRATION_CONFIRMATION_TOKEN" ]]; then