fix(rest-api): Nil check DPU extension timestamp error logging#3744
Conversation
Walkthrough
ChangesTimestamp Parse Error Handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔐 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-07-20 22:30:59 UTC | Commit: d93cbd6 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
rest-api/workflow/pkg/activity/dpuextensionservice/dpuextensionservice_test.go (1)
302-334: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd coverage for an empty
Createdvalue.This case verifies invalid non-empty input, but the changed
Created != ""guard also defines empty-input behavior. Add a case expecting theUpdatedfallback withexpectTimestampParseError: false; otherwise the corrected branch is only partially covered.As per path instructions, “Review Go code for correctness, clean control flow, error handling, context propagation, test coverage, performance, and cohesive organization.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rest-api/workflow/pkg/activity/dpuextensionservice/dpuextensionservice_test.go` around lines 302 - 334, Add a separate test case alongside the existing invalid-timestamp case in the DPU extension service inventory tests, using an empty Created value. Assert that the service’s Updated timestamp is used as expectedCreated, set expectTimestampParseError to false, and keep wantErr false to cover the empty-input branch guarded by the Created check.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@rest-api/workflow/pkg/activity/dpuextensionservice/dpuextensionservice_test.go`:
- Around line 302-334: Add a separate test case alongside the existing
invalid-timestamp case in the DPU extension service inventory tests, using an
empty Created value. Assert that the service’s Updated timestamp is used as
expectedCreated, set expectTimestampParseError to false, and keep wantErr false
to cover the empty-input branch guarded by the Created check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 52e058b3-02fd-4b01-83b3-4d705406b309
📒 Files selected for processing (2)
rest-api/workflow/pkg/activity/dpuextensionservice/dpuextensionservice.gorest-api/workflow/pkg/activity/dpuextensionservice/dpuextensionservice_test.go
d93cbd6 to
ae2e1b2
Compare
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3744.docs.buildwithfern.com/infra-controller |
kfelternv
left a comment
There was a problem hiding this comment.
This is the correct logical fix, the else if here meant that there could have been no err, err = nil but we would still enter the else if because the value was set.
|
Thanks @kfelternv and @hanyux-nv |
Description:
Type of Change
Testing