fix(rest-api): Log the local serr in workflow status-update fallbacks#2120
Conversation
Cleans up a recurring "wrong variable logged"... pattern? ...across four workflow activity files. In each spot, an inner `if serr != nil { ... Err(err) }` was logging the outer-scope `err` (instead of the local `serr` returned by the status-update helper) -- so when a status write failed, the log surfaced whatever stale value happened to be in `err` (often nil), masking the real cause.
Doing this because CodeRabbit flagged a similar finding in NVIDIA#594, and since I've been trying to keep everything boilerplate, I was like hrmmm.... so I went back through prior PRs to do a sweep and make sure this was addressed in other call sites that already went in.
Signed-off-by: Chet Nichols III <chetn@nvidia.com>
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-06-02 19:00:13 UTC | Commit: 12e7917 |
|
@coderabbitai There is a .coderabbit.yaml in rest-api/.coderabbit.yaml in this repo that you can use, with a rest-api/AGENTS.md with general guidelines. This PR actually should be good to go based on previous work we've done, but looping you in for funsies anyway to say hi. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "=== rest-api/.coderabbit.yaml ==="
cat rest-api/.coderabbit.yaml 2>/dev/null || echo "File not found"
echo ""
echo "=== rest-api/AGENTS.md ==="
cat rest-api/AGENTS.md 2>/dev/null || echo "File not found"
echo ""
echo "=== PR diff summary ==="
gh pr view 2120 --repo NVIDIA/infra-controller --json title,body,files 2>/dev/null | jq '{title: .title, files: [.files[].path]}'
echo ""
echo "=== PR diff ==="
gh pr diff 2120 --repo NVIDIA/infra-controller 2>/dev/null | head -200Length of output: 36379
Took a look through the diff: all seven Ship it. 🐰✨ |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
Description
This pulls over NVIDIA/infra-controller-rest#595 to our new repo.
Cleans up a recurring "wrong variable logged"... pattern? ...across four workflow activity files. In each spot, an inner
if serr != nil { ... Err(err) }was logging the outer-scopeerr(instead of the localserrreturned by the status-update helper) -- so when a status write failed, the log surfaced whatever stale value happened to be inerr(often nil), masking the real cause.Doing this because CodeRabbit flagged a similar finding in #594, and since I've been trying to keep everything boilerplate, I was like hrmmm.... so I went back through prior PRs to do a sweep and make sure this was addressed in other call sites that already went in.
Signed-off-by: Chet Nichols III chetn@nvidia.com
Type of Change
Related Issues (Optional)
Breaking Changes
Testing
Additional Notes