Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (29)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. Summary by CodeRabbit
WalkthroughThe change adds typed API collection responses, serializes nil labels as ChangesAPI collection contracts and model mappings
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The API response normalization is covered by the changed model and handler tests, with no current merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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-09-14 21:14:48 UTC | Commit: 4834cb5 |
4834cb5 to
29f5ce4
Compare
|
🌿 Preview your docs: https://nvidia-preview-pull-request-6151.docs.buildwithfern.com/infra-controller |
Use response-specific APILabels across all label-bearing API models so
nil labels serialize as {}. Use APIList for Expected Machine fallback
DPU serial numbers so nil serials serialize as []. Preserve request and
database nil semantics.
Convert Expected Machine batch results through the API response model
for consistent JSON field names and empty collections. Cover collection
serialization, all response label models, and batch endpoint behavior.
Fixes NVBug https://nvbugspro.nvidia.com/bug/6753874
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
29f5ce4 to
6954aab
Compare
REST responses can return
nullfor empty labels even though their published contract is an object. Use response-specificAPILabelsacross all 11 label-bearing API models so empty labels return{}, andAPIListfor Expected Machine fallback DPU serial numbers so empty values return[]. Request and database models retain their existing nil semantics.Expected Machine batch create and update now convert database results through the API response model, matching single-resource endpoints' JSON field names and empty collection behavior while preserving result order.
Related issues
Fixes NVBug 6753874.
Type of Change
Breaking Changes
Testing
Collection serialization tests cover empty and populated values, escaping, ordering, and encoding errors. Constructor coverage checks all 11 response label models. Handler coverage checks Expected Machine single and batch responses.
Validation:
make test-apipassed. Formatting andgit diff --checkpassed.make lint-gocompleted; its golangci-lint invocation permits existing findings via--issues-exit-code 0. A separate check against the final commit's parent found no new lint findings in the changed model and handler packages. The full API suite also passed after preserving the remote branch's newer base.Additional Notes
The OpenAPI object and array contracts are unchanged. Batch Expected Machine responses now use the documented API field names instead of serializing database structs directly.