From fcbd1072b67d64790f191e49d162e95c669bf485 Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 9 Jul 2026 08:29:39 +0200 Subject: [PATCH] fix(lint): check fmt.Fprintf errors in webhook handler (infra#190) errcheck flagged two unchecked fmt.Fprintf return values in internal/webhook/webhook.go, failing CI (run 310/311) for the whole 'trigger brain-sync on Gitea push' feature -- so no new ingestion image was ever built, and the deployed image predates this feature entirely even though infra's manifest (secret, RBAC, env wiring) was already live. Both writes are best-effort informational text after WriteHeader has already committed the status code -- a failed write here only happens on client disconnect and nothing depends on it succeeding, so explicitly discard (_, _ =) rather than log-and-continue noise. Co-Authored-By: Claude Opus 4.8 (1M context) --- ingestion/internal/webhook/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingestion/internal/webhook/webhook.go b/ingestion/internal/webhook/webhook.go index a3df62e..d366cfb 100644 --- a/ingestion/internal/webhook/webhook.go +++ b/ingestion/internal/webhook/webhook.go @@ -94,7 +94,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if ev.Repo.FullName != h.WatchRepo || ev.Ref != "refs/heads/main" { w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, "ignored: repo=%s ref=%s", ev.Repo.FullName, ev.Ref) + _, _ = fmt.Fprintf(w, "ignored: repo=%s ref=%s", ev.Repo.FullName, ev.Ref) return } jobName, err := TriggerJobFromCronJob(r.Context(), h.Clientset, h.Namespace, h.CronJobName) @@ -105,5 +105,5 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } h.Logger.Info("webhook: triggered brain-sync job", "job", jobName) w.WriteHeader(http.StatusOK) - fmt.Fprintf(w, "triggered %s", jobName) + _, _ = fmt.Fprintf(w, "triggered %s", jobName) }