Compare commits

...
2 Commits
Author SHA1 Message Date
DenozordecandCursor 27864fad58 fix(ci): make check-migrations-pair.sh POSIX sh compatible
CI / changes (push) Successful in 8s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Has been skipped
CI / go (push) Has been skipped
CI / bird2 (push) Has been skipped
CI / release (push) Has been cancelled
Убрана bash process substitution; скрипт работает под sh в Gitea runner (DEP-03).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-20 14:57:18 +07:00
DenozordecandCursor dc5e777d07 style(web): format settings-known schema for prettier
CI / changes (push) Successful in 7s
CI / openapi (push) Has been skipped
CI / commitlint (push) Has been skipped
CI / go (push) Has been cancelled
CI / bird2 (push) Has been cancelled
CI / release (push) Has been cancelled
CI / web (push) Has been cancelled
Исправление падения CI job web: prettier --check на settings-known.schema.ts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-20 14:56:20 +07:00
2 changed files with 42 additions and 11 deletions

No files matched your search

+39 -6
View File
@@ -11,21 +11,54 @@ list_nums() {
ls "$dir" 2>/dev/null | sed -n 's/^\([0-9]\{6\}\)_.*\.up\.sql$/\1/p' | sort -u ls "$dir" 2>/dev/null | sed -n 's/^\([0-9]\{6\}\)_.*\.up\.sql$/\1/p' | sort -u
} }
migration_only_in() {
# Prints numbers present in $1 but not in $2 (space-separated lists).
haystack="$2 "
for n in $1; do
case "$haystack" in
*" $n "*) ;;
*) echo "$n" ;;
esac
done
}
pg_nums="$(list_nums "$PG")" pg_nums="$(list_nums "$PG")"
sql_nums="$(list_nums "$SQL")" sql_nums="$(list_nums "$SQL")"
if [ "$pg_nums" != "$sql_nums" ]; then if [ "$pg_nums" != "$sql_nums" ]; then
echo "check-migrations-pair: postgres and sqlite migration numbers differ" >&2 echo "check-migrations-pair: postgres and sqlite migration numbers differ" >&2
echo "postgres only:" >&2 only_pg="$(migration_only_in "$pg_nums" "$sql_nums")"
comm -23 <(printf '%s\n' "$pg_nums") <(printf '%s\n' "$sql_nums") >&2 || true only_sql="$(migration_only_in "$sql_nums" "$pg_nums")"
echo "sqlite only:" >&2 if [ -n "$only_pg" ]; then
comm -13 <(printf '%s\n' "$pg_nums") <(printf '%s\n' "$sql_nums") >&2 || true echo "postgres only:" >&2
for n in $only_pg; do
echo " $n" >&2
done
fi
if [ -n "$only_sql" ]; then
echo "sqlite only:" >&2
for n in $only_sql; do
echo " $n" >&2
done
fi
exit 1 exit 1
fi fi
for n in $pg_nums; do for n in $pg_nums; do
pg_up="$(ls "$PG"/${n}_*.up.sql 2>/dev/null | head -1)" pg_up=""
sql_up="$(ls "$SQL"/${n}_*.up.sql 2>/dev/null | head -1)" sql_up=""
for f in "$PG"/${n}_*.up.sql; do
if [ -f "$f" ]; then
pg_up="$f"
break
fi
done
for f in "$SQL"/${n}_*.up.sql; do
if [ -f "$f" ]; then
sql_up="$f"
break
fi
done
if [ -z "$pg_up" ] || [ -z "$sql_up" ]; then if [ -z "$pg_up" ] || [ -z "$sql_up" ]; then
echo "check-migrations-pair: missing .up.sql for $n" >&2 echo "check-migrations-pair: missing .up.sql for $n" >&2
exit 1 exit 1
@@ -50,11 +50,9 @@ export const settingsKnownSchema = z.object({
bird_router_id: optionalIPv4('router id'), bird_router_id: optionalIPv4('router id'),
bird_local_ipv4: optionalIPv4('local IPv4'), bird_local_ipv4: optionalIPv4('local IPv4'),
bird_local_ipv6: optionalIPv6('local IPv6'), bird_local_ipv6: optionalIPv6('local IPv6'),
bird_local_asn: z bird_local_asn: z.string().refine((v) => v.trim() === '' || /^[1-9]\d*$/.test(v.trim()), {
.string() message: 'ASN должен быть целым числом больше 0'
.refine((v) => v.trim() === '' || /^[1-9]\d*$/.test(v.trim()), { }),
message: 'ASN должен быть целым числом больше 0'
}),
bird_bgp_source_ipv4: optionalIPv4('BGP source IPv4'), bird_bgp_source_ipv4: optionalIPv4('BGP source IPv4'),
bird_bgp_source_ipv6: optionalIPv6('BGP source IPv6'), bird_bgp_source_ipv6: optionalIPv6('BGP source IPv6'),
revision_retention_minutes: z.string().refine( revision_retention_minutes: z.string().refine(