fix(hub): BIT-25223 add fix-duplicate-logo.js resolve pattern + auto-apply on deploy
CI / Test api (push) Successful in 1m8s
CI / Test ingest-api (push) Successful in 1m9s
CI / Lint and typecheck admin-ui (push) Successful in 1m30s
CI / Validate Docker build (push) Successful in 5m22s

- resolveFixedPatterns.ts: add '%fix-duplicate-logo.js%' entry so any
  Chrome-style CRM JS error that reaches the hub is auto-resolved on deploy
- webhook-deploy.sh: call resolve-fixed-patterns after every service restart
  so code fixes clear stale hub incidents automatically (uses ERROR_RESOLVE_API_KEY
  from /etc/error-reporting/env which is already sourced by the script)

The 5 open incidents for ERRCLUSTER:33b4e527d8fd were bulk-resolved directly
(IDs 747145, 747381, 753209, 753550, 753551). Client-side noise filter (CRM PR #684)
prevents new occurrences.
This commit is contained in:
David Santos committed 2026-07-17 22:20:18 +00:00
1 parent 615d771ade
commit 37ab9f1ccb
2 files changed
+30

No files matched your search

+22
View File
@@ -44,6 +44,28 @@ if [[ "${ER_WEBHOOK_RESTART_SERVICES:-1}" == "1" ]]; then
systemctl restart bitreport-error-reporting-admin-ui.service
systemctl restart bitreport-error-reporting-collector-worker.service
systemctl restart bitreport-error-reporting-api.service
# Auto-apply resolve-fixed-patterns after every deploy so code fixes clear stale incidents.
if [[ -n "${ERROR_RESOLVE_API_KEY:-}" ]]; then
_api_port="${ER_API_PORT:-3200}"
_ready=0
for _i in $(seq 1 20); do
if curl -sf "http://localhost:${_api_port}/health" >/dev/null 2>&1; then
_ready=1; break
fi
sleep 3
done
if [[ "${_ready}" == "1" ]]; then
curl -sf -X POST "http://localhost:${_api_port}/api/error-monitoring/resolve-fixed-patterns" \
-H "Content-Type: application/json" \
-d "{\"api_key\":\"${ERROR_RESOLVE_API_KEY}\"}" \
>/dev/null 2>&1 \
&& echo "webhook-deploy: resolve-fixed-patterns applied" \
|| echo "webhook-deploy: WARN resolve-fixed-patterns failed (non-fatal)"
else
echo "webhook-deploy: WARN API not ready after 60s, skipping resolve-fixed-patterns"
fi
fi
fi
echo "webhook-deploy: done"