patch(v2.1): use lowercase phone_home post key - #4692
Conversation
Signed-off-by: Patrice Breton <pbreton@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Summary by CodeRabbit
WalkthroughThe PR adds a cloud-init phone-home JSON Schema, changes the phone-home key to lowercase, adds JSON Schema validation for generated autoinstall data, and declares the schema validation dependency. ChangesPhone-home schema validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
rest-api/api/pkg/api/model/util/util_test.go (1)
15-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the schema check into
TestInsertPhoneHomeIntoUserData.This test validates
InsertPhoneHomeIntoUserData, which already has a table-driven top-level test in this file. Add the schema-validation case as a namedt.Runsubtest there.As per coding guidelines and path instructions, use “one top-level
Test...function and named table-drivent.Runsubtests” for tests around the production function under test.🤖 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 15 - 34, Move the schema-validation logic from TestInsertedPhoneHomeMatchesCloudInitSchema into the existing table-driven TestInsertPhoneHomeIntoUserData test. Add it as a named t.Run subtest covering the production function’s output, and remove the separate top-level schema test while preserving its assertions and schema setup.Sources: Coding guidelines, 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/api/pkg/api/model/util/util_test.go`:
- Around line 15-34: Move the schema-validation logic from
TestInsertedPhoneHomeMatchesCloudInitSchema into the existing table-driven
TestInsertPhoneHomeIntoUserData test. Add it as a named t.Run subtest covering
the production function’s output, and remove the separate top-level schema test
while preserving its assertions and schema setup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c5d9abe1-84bc-4e39-a68b-8701910c8bf9
📒 Files selected for processing (4)
rest-api/api/pkg/api/model/util/testdata/cloud-init-phone-home.schema.jsonrest-api/api/pkg/api/model/util/util.gorest-api/api/pkg/api/model/util/util_test.gorest-api/go.mod
🔐 TruffleHog Secret Scan🚨 Potential secrets detected! TruffleHog found potential secrets in your code changes. This could include:
📋 View Detailed Findings👉 Click here to view the full TruffleHog scan results The job logs contain:
Next Steps
Security Best Practices
🕐 Last updated: 2026-08-06 23:25:46 UTC | Commit: e107ef5 |
nv-dmendoza
left a comment
There was a problem hiding this comment.
LGTM, trufflescan failing because of ci issue and is fine to ignore
Backport of #4670 to
release/v2.1.What changed
postproperty in the cloud-initphone_homeconfiguration.autoinstall.user-dataphone-home configuration.Why
Ubuntu validates nested cloud-config strictly and rejects the uppercase
POSTproperty, leaving affected installations stuck inProvisioning. Cloud-init mandates the lowercasepostproperty.Validation
go test ./api/pkg/api/model/utilRef: 6569456