feat(hub): populate runtime/host/release/request_id columns, honor environment, expose metadata in recent-errors (BIT-33316)
CI / Test ingest-api (pull_request) Successful in 22s
CI / Test api (pull_request) Successful in 25s
CI / Lint and typecheck admin-ui (pull_request) Failing after 2m12s
CI / Validate Docker build (pull_request) Failing after 3m15s

Paperclip-Issue: BIT-33316
This commit is contained in:
nelson-baptista committed 2026-11-25 05:10:18 +00:00
1 parent baac48a632
commit b757ec671a
4 files changed
+115 -2

No files matched your search

+18
View File
@@ -65,6 +65,15 @@ function extractFileLine(ctx: Record<string, unknown> | null): { file_path: stri
return { file_path, line_number };
}
function ctxStr(ctx: Record<string, unknown> | null, keys: string[]): string {
if (!ctx) return '';
for (const k of keys) {
const v = ctx[k];
if (typeof v === 'string' && v.trim() !== '') return v.trim();
}
return '';
}
/** Paperclip error loop reads top-level `gitea_repo` on each recent-error row. */
function extractGiteaRepo(ctx: Record<string, unknown> | null): string {
if (!ctx) {
@@ -300,6 +309,15 @@ async function handleRecentErrors(request: FastifyRequest, reply: FastifyReply):
if (gitea_repo !== '') {
rowOut.gitea_repo = gitea_repo;
}
const extra: Record<string, string> = {
component: ctxStr(ctx, ['component']),
release_version: ctxStr(ctx, ['release_version', 'release', 'app_version']),
runtime_name: ctxStr(ctx, ['runtime_name', 'runtime']),
host_name: ctxStr(ctx, ['host_name', 'hostname', 'host']),
};
for (const [k, v] of Object.entries(extra)) {
if (v !== '') rowOut[k] = v;
}
if (paperclip_project_id !== '') {
rowOut.paperclip_project_id = paperclip_project_id;
}