mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-09 17:28:51 +00:00
Some checks are pending
Publish Fork Image to GHCR / Build and Push Fork Image (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Change Classification (push) Waiting to run
CI / Quality Ratchet (push) Blocked by required conditions
CI / Quality Gates (Extended) (push) Waiting to run
CI / Docs Sync (Strict) (push) Waiting to run
CI / Docs Lint (prose — advisory) (push) Waiting to run
CI / i18n UI Coverage (push) Waiting to run
CI / Build language matrix (push) Waiting to run
CI / i18n Validation (push) Blocked by required conditions
CI / PR Test Policy (push) Waiting to run
CI / Build (push) Blocked by required conditions
CI / Package Artifact (push) Blocked by required conditions
CI / Electron Package Smoke (push) Blocked by required conditions
CI / Unit Tests (1/8) (push) Blocked by required conditions
CI / Unit Tests (2/8) (push) Blocked by required conditions
CI / Unit Tests (3/8) (push) Blocked by required conditions
CI / Unit Tests (4/8) (push) Blocked by required conditions
CI / E2E Tests (3/9) (push) Blocked by required conditions
CI / Unit Tests (5/8) (push) Blocked by required conditions
CI / Unit Tests (6/8) (push) Blocked by required conditions
CI / Unit Tests (7/8) (push) Blocked by required conditions
CI / Unit Tests (8/8) (push) Blocked by required conditions
CI / Vitest (MCP / autoCombo / UI components) (push) Blocked by required conditions
CI / Node 24 Compatibility Tests (1/4) (push) Blocked by required conditions
CI / Node 24 Compatibility Tests (2/4) (push) Blocked by required conditions
CI / Node 24 Compatibility Tests (3/4) (push) Blocked by required conditions
CI / Node 24 Compatibility Tests (4/4) (push) Blocked by required conditions
CI / Node 26 Compatibility Build (push) Blocked by required conditions
CI / Node 26 Compatibility Tests (1/4) (push) Blocked by required conditions
CI / Node 26 Compatibility Tests (2/4) (push) Blocked by required conditions
CI / Node 26 Compatibility Tests (3/4) (push) Blocked by required conditions
CI / Node 26 Compatibility Tests (4/4) (push) Blocked by required conditions
CI / Coverage Shard (1/8) (push) Blocked by required conditions
CI / Coverage Shard (2/8) (push) Blocked by required conditions
CI / Coverage Shard (3/8) (push) Blocked by required conditions
CI / Coverage Shard (4/8) (push) Blocked by required conditions
CI / Coverage Shard (5/8) (push) Blocked by required conditions
CI / Coverage Shard (6/8) (push) Blocked by required conditions
CI / Coverage Shard (7/8) (push) Blocked by required conditions
CI / Coverage Shard (8/8) (push) Blocked by required conditions
CI / Coverage (push) Blocked by required conditions
CI / SonarQube (push) Blocked by required conditions
CI / PR Coverage Comment (push) Blocked by required conditions
CI / E2E Tests (1/9) (push) Blocked by required conditions
CI / E2E Tests (2/9) (push) Blocked by required conditions
CI / E2E Tests (4/9) (push) Blocked by required conditions
CI / E2E Tests (5/9) (push) Blocked by required conditions
CI / E2E Tests (6/9) (push) Blocked by required conditions
CI / E2E Tests (7/9) (push) Blocked by required conditions
CI / E2E Tests (8/9) (push) Blocked by required conditions
CI / E2E Tests (9/9) (push) Blocked by required conditions
CI / Integration Tests (1/2) (push) Blocked by required conditions
CI / Integration Tests (2/2) (push) Blocked by required conditions
CI / Security Tests (push) Blocked by required conditions
CI / CI Dashboard (push) Blocked by required conditions
Publish to Docker Hub / Resolve Docker release metadata (push) Waiting to run
Publish to Docker Hub / Build Docker (linux/amd64) (push) Blocked by required conditions
Publish to Docker Hub / Build Docker (linux/arm64) (push) Blocked by required conditions
Publish to Docker Hub / Publish multi-arch manifests (push) Blocked by required conditions
opencode-plugin CI / Test (Node 24) (push) Waiting to run
opencode-plugin CI / Test (Node 22) (push) Waiting to run
opencode-plugin CI / Build (push) Blocked by required conditions
OpenSSF Scorecard / Scorecard analysis (push) Waiting to run
semgrep / semgrep (push) Waiting to run
Wiki Sync / Sync wiki with docs (push) Waiting to run
v3.8.40 cycle integration → main. All test gates green (Unit/Integration/Coverage/Node-compat/Quality-Ratchet). The only red check, 'PR Test Policy', is the test-masking heuristic firing on the cumulative ~57-commit release diff (legitimate assert consolidations already reviewed per-PR — Gemini CLI removal #5246, retired GPT models #5280, provider catalog refreshes); overridden with --admin per the documented release-PR convention. CodeQL/SonarQube advisory scans non-blocking; #5278's code already passed CodeQL on main. Homologated on VPS 192.168.0.15 (v3.8.40 healthy).
70 lines
2.7 KiB
Bash
70 lines
2.7 KiB
Bash
# bin/_ops-common.sh — shared helpers for the OmniRoute ops runbook scripts.
|
|
#
|
|
# Sourced (not executed) by rollback.sh / snapshot-data.sh / restore-data.sh /
|
|
# restore-policies.sh / cold-start-bench.sh — the self-hoster incident-recovery
|
|
# and cold-start ops tooling. Each script documents its own contract via --help.
|
|
#
|
|
# Path resolution mirrors the app (src/lib/db/core.ts): the SQLite store is
|
|
# $DATA_DIR/storage.sqlite and managed backups go to $DATA_DIR/db_backups
|
|
# (overridable via DB_BACKUPS_DIR), so snapshots created here are interchangeable
|
|
# with the ones the server writes on migrations.
|
|
|
|
# Recompute the data-dir-derived paths. Called once on source, and again by
|
|
# scripts that accept a --data-dir override.
|
|
ops_set_data_dir() {
|
|
OMNIROUTE_DATA_DIR="$1"
|
|
OMNIROUTE_SQLITE="${OMNIROUTE_DATA_DIR}/storage.sqlite"
|
|
OMNIROUTE_BACKUPS_DIR="${DB_BACKUPS_DIR:-${OMNIROUTE_DATA_DIR}/db_backups}"
|
|
}
|
|
ops_set_data_dir "${DATA_DIR:-$HOME/.omniroute}"
|
|
|
|
ops_log() { printf '[%s] %s\n' "${SCRIPT_NAME:-ops}" "$*" >&2; }
|
|
ops_die() {
|
|
printf '[%s] ERROR: %s\n' "${SCRIPT_NAME:-ops}" "$*" >&2
|
|
exit 1
|
|
}
|
|
|
|
ops_require_cmd() {
|
|
command -v "$1" >/dev/null 2>&1 || ops_die "required command not found: $1"
|
|
}
|
|
|
|
# ops_confirm "<prompt>" — return 0 to proceed. Honors ASSUME_YES=1 (set by the
|
|
# --yes flag) and REFUSES a destructive action on a non-interactive stdin unless
|
|
# ASSUME_YES is set, so an unattended/CI invocation can never silently destroy data.
|
|
ops_confirm() {
|
|
local prompt="$1" reply
|
|
if [ "${ASSUME_YES:-0}" = "1" ]; then return 0; fi
|
|
if [ ! -t 0 ]; then
|
|
ops_die "refusing a destructive action without a TTY; pass --yes to proceed non-interactively"
|
|
fi
|
|
read -r -p "$prompt [y/N] " reply
|
|
case "$reply" in
|
|
[yY] | [yY][eE][sS]) return 0 ;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
# ops_find_snapshot <id> — resolve a snapshot identifier (a snapshot dir name,
|
|
# a bare timestamp/sha, or an explicit path) to a directory containing
|
|
# storage.sqlite. Echoes the resolved dir or dies.
|
|
ops_find_snapshot() {
|
|
local id="$1" cand
|
|
[ -n "$id" ] || ops_die "snapshot id required (a timestamp/sha, dir name, or path)"
|
|
for cand in \
|
|
"$id" \
|
|
"$id/" \
|
|
"$OMNIROUTE_BACKUPS_DIR/$id" \
|
|
"$OMNIROUTE_BACKUPS_DIR/snapshot_$id"; do
|
|
if [ -f "${cand%/}/storage.sqlite" ]; then
|
|
printf '%s\n' "${cand%/}"
|
|
return 0
|
|
fi
|
|
done
|
|
# Fall back to a prefix match against snapshot_* dirs (e.g. a short sha/date).
|
|
if [ -d "$OMNIROUTE_BACKUPS_DIR" ]; then
|
|
for cand in "$OMNIROUTE_BACKUPS_DIR"/snapshot_*"$id"*; do
|
|
[ -f "$cand/storage.sqlite" ] && { printf '%s\n' "$cand"; return 0; }
|
|
done
|
|
fi
|
|
ops_die "no snapshot matching '$id' under $OMNIROUTE_BACKUPS_DIR (run bin/snapshot-data.sh first)"
|
|
}
|