fix(core): phone_home should NOT be injected in installer user-data but in target OS user-data#3859
fix(core): phone_home should NOT be injected in installer user-data but in target OS user-data#3859pbreton wants to merge 3 commits into
Conversation
…ut in target OS user-data Signed-off-by: Patrice Breton <pbreton@nvidia.com>
|
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 (2)
Summary by CodeRabbit
WalkthroughPhone-home YAML handling now supports root-level and ChangesPhone-home YAML handling
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
rest-api/api/pkg/api/model/util/util_test.go (1)
45-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover non-mapping
autoinstall.The table covers invalid
autoinstall.user-databut not the newautoinstallmapping guard. Add anautoinstall: invaliderror case to lock down that branch.Proposed test case
+ { + name: "rejects non-mapping autoinstall", + userData: "autoinstall: invalid\n", + wantErr: true, + },🤖 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/api/pkg/api/model/util/util_test.go` around lines 45 - 53, Add a table-driven test case alongside the existing autoinstall validation cases in the relevant test table, using scalar `autoinstall: invalid` input and asserting the expected error result to cover the non-mapping autoinstall guard. Keep the existing nested user-data case unchanged.Source: Coding guidelines
🤖 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/api/pkg/api/model/util/util_test.go`:
- Around line 45-53: Add a table-driven test case alongside the existing
autoinstall validation cases in the relevant test table, using scalar
`autoinstall: invalid` input and asserting the expected error result to cover
the non-mapping autoinstall guard. Keep the existing nested user-data case
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7bb2001f-bc47-458f-867a-f3c86ea50818
📒 Files selected for processing (2)
rest-api/api/pkg/api/model/util/util.gorest-api/api/pkg/api/model/util/util_test.go
🔐 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-22 18:22:36 UTC | Commit: a8611c0 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@rest-api/api/pkg/api/handler/instance_test.go`:
- Around line 58-73: Update userDataHasPhoneHome to identify the exact
phone-home location and reject configurations where it appears at the wrong
level or in both root and nested user-data. In
rest-api/api/pkg/api/handler/instance_test.go lines 3898-3906, assert root
placement for root-only user-data and nested placement for autoinstall
user-data; at lines 3919-3919, apply the same location-specific assertion to
inherited OS user-data.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c8dc4cc3-44ff-4794-ba54-f33862caf692
📒 Files selected for processing (1)
rest-api/api/pkg/api/handler/instance_test.go
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
When using an installer to install OS on target, 'phone_home' is added to the user-data of the installer instead of the user-data for the target OS. That makes the installer to callback and instances to report Ready/BootCompleted before the OS is actually booted/reachable.
Type of Change
Breaking Changes
Testing