assisted-service icon indicating copy to clipboard operation
assisted-service copied to clipboard

MGMT-20025: Replace encode from yaml to json on Nutanix types

Open mlorenzofr opened this issue 10 months ago • 18 comments

This PR fixes a bug unmarshalling the install-config generated by the assisted-service due to an error in Nutanix type encoding.

List all the issues related to this PR

  • [ ] New Feature
  • [ ] Enhancement
  • [X] Bug fix
  • [X] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

  • [X] Automation (CI, tools, etc)
  • [x] Cloud
  • [x] Operator Managed Deployments
  • [ ] None

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [x] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [x] Manual (tested on Nutanix platform with CAPI)
  • [ ] No tests needed

Checklist

  • [x] Title and description added to both, commit and PR.
  • [ ] Relevant issues have been associated (see CONTRIBUTING guide)
  • [x] This change does not require a documentation update (docstring, docs, README, etc)
  • [x] Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

mlorenzofr avatar Feb 26 '25 14:02 mlorenzofr

@mlorenzofr: This pull request references MGMT-20025 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set.

In response to this:

List all the issues related to this PR

  • [ ] New Feature
  • [ ] Enhancement
  • [X] Bug fix
  • [X] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

  • [X] Automation (CI, tools, etc)
  • [x] Cloud
  • [x] Operator Managed Deployments
  • [ ] None

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [x] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [x] Manual (tested on Nutanix platform with CAPI)
  • [ ] No tests needed

Checklist

  • [x] Title and description added to both, commit and PR.
  • [ ] Relevant issues have been associated (see CONTRIBUTING guide)
  • [x] This change does not require a documentation update (docstring, docs, README, etc)
  • [x] Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar Feb 26 '25 14:02 openshift-ci-robot

/assign @rccrdpccl

mlorenzofr avatar Feb 26 '25 15:02 mlorenzofr

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.39%. Comparing base (dc818a8) to head (05b2a7e). Report is 36 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7353      +/-   ##
==========================================
+ Coverage   67.25%   74.39%   +7.13%     
==========================================
  Files         334      380      +46     
  Lines       42697    69197   +26500     
==========================================
+ Hits        28718    51482   +22764     
- Misses      11373    15011    +3638     
- Partials     2606     2704      +98     
Files with missing lines Coverage Δ
internal/installcfg/installcfg.go 100.00% <ø> (ø)

... and 67 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Feb 26 '25 16:02 codecov[bot]

@mlorenzofr: This pull request references MGMT-20025 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set.

In response to this:

This PR fixes a bug unmarshalling the install-config generated by the assisted-service due to an error in Nutanix type encoding.

List all the issues related to this PR

  • [ ] New Feature
  • [ ] Enhancement
  • [X] Bug fix
  • [X] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

  • [X] Automation (CI, tools, etc)
  • [x] Cloud
  • [x] Operator Managed Deployments
  • [ ] None

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [x] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [x] Manual (tested on Nutanix platform with CAPI)
  • [ ] No tests needed

Checklist

  • [x] Title and description added to both, commit and PR.
  • [ ] Relevant issues have been associated (see CONTRIBUTING guide)
  • [x] This change does not require a documentation update (docstring, docs, README, etc)
  • [x] Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar Feb 26 '25 17:02 openshift-ci-robot

@eliorerz please review @mlorenzofr you need to run nutanix e2e test

gamli75 avatar Feb 26 '25 22:02 gamli75

/test ?

rccrdpccl avatar Feb 27 '25 09:02 rccrdpccl

@rccrdpccl: The following commands are available to trigger required jobs:

/test e2e-agent-compact-ipv4
/test edge-assisted-operator-catalog-publish-verify
/test edge-ci-index
/test edge-e2e-ai-operator-disconnected-capi
/test edge-e2e-ai-operator-ztp
/test edge-e2e-ai-operator-ztp-3masters
/test edge-e2e-ai-operator-ztp-capi
/test edge-e2e-ai-operator-ztp-disconnected
/test edge-e2e-metal-assisted-4-14
/test edge-e2e-metal-assisted-4-15
/test edge-e2e-metal-assisted-4-16
/test edge-e2e-metal-assisted-4-17
/test edge-e2e-metal-assisted-4-18
/test edge-e2e-metal-assisted-5-control-planes-4-18
/test edge-e2e-metal-assisted-cnv-4-17
/test edge-e2e-metal-assisted-external-4-18
/test edge-e2e-metal-assisted-lvm-4-18
/test edge-e2e-metal-assisted-mtv-4-17
/test edge-e2e-metal-assisted-none-4-18
/test edge-e2e-metal-assisted-odf-4-17
/test edge-e2e-metal-assisted-osc-4-18
/test edge-e2e-nutanix-assisted-2workers-4-18
/test edge-e2e-nutanix-assisted-4-18
/test edge-e2e-vsphere-assisted-4-18
/test edge-images
/test edge-lint
/test edge-operator-publish-verify
/test edge-subsystem-aws
/test edge-subsystem-kubeapi-aws
/test edge-unit-test
/test edge-verify-generated-code
/test images
/test mce-images

The following commands are available to trigger optional jobs:

/test e2e-agent-4control-ipv4
/test e2e-agent-5control-ipv4
/test e2e-agent-ha-dualstack
/test e2e-agent-sno-ipv6
/test edge-e2e-ai-operator-ztp-4masters
/test edge-e2e-ai-operator-ztp-5masters
/test edge-e2e-ai-operator-ztp-compact-day2-masters
/test edge-e2e-ai-operator-ztp-compact-day2-workers
/test edge-e2e-ai-operator-ztp-hypershift-zero-nodes
/test edge-e2e-ai-operator-ztp-multiarch-3masters-ocp
/test edge-e2e-ai-operator-ztp-multiarch-sno-ocp
/test edge-e2e-ai-operator-ztp-node-labels
/test edge-e2e-ai-operator-ztp-remove-node
/test edge-e2e-ai-operator-ztp-sno-day2-masters
/test edge-e2e-ai-operator-ztp-sno-day2-workers
/test edge-e2e-ai-operator-ztp-sno-day2-workers-ignitionoverride
/test edge-e2e-ai-operator-ztp-sno-day2-workers-late-binding
/test edge-e2e-metal-assisted-4-control-planes-4-18
/test edge-e2e-metal-assisted-4-masters-none-4-18
/test edge-e2e-metal-assisted-bond-4-14
/test edge-e2e-metal-assisted-bond-4-18
/test edge-e2e-metal-assisted-day2-4-18
/test edge-e2e-metal-assisted-day2-arm-workers-4-18
/test edge-e2e-metal-assisted-day2-sno-4-18
/test edge-e2e-metal-assisted-ipv4v6-4-18
/test edge-e2e-metal-assisted-ipv6-4-18
/test edge-e2e-metal-assisted-k8s-nmstate-4-17
/test edge-e2e-metal-assisted-kube-api-late-binding-sno-4-18
/test edge-e2e-metal-assisted-kube-api-late-unbinding-sno-4-18
/test edge-e2e-metal-assisted-kube-api-net-suite-4-18
/test edge-e2e-metal-assisted-kube-api-umlb-4-18
/test edge-e2e-metal-assisted-onprem-4-18
/test edge-e2e-metal-assisted-osc-sno-4-18
/test edge-e2e-metal-assisted-sno-4-18
/test edge-e2e-metal-assisted-static-ip-suite-4-14
/test edge-e2e-metal-assisted-static-ip-suite-4-18
/test edge-e2e-metal-assisted-tang-4-18
/test edge-e2e-metal-assisted-tpmv2-4-18
/test edge-e2e-metal-assisted-umlb-4-18
/test edge-e2e-metal-assisted-upgrade-agent-4-18
/test edge-e2e-oci-assisted-4-18
/test edge-e2e-oci-assisted-bm-iscsi-4-18
/test edge-e2e-vsphere-assisted-umlb-4-18
/test edge-e2e-vsphere-assisted-umn-4-18
/test okd-scos-e2e-aws-ovn
/test okd-scos-images
/test push-pr-image

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-assisted-service-master-e2e-agent-compact-ipv4
pull-ci-openshift-assisted-service-master-edge-ci-index
pull-ci-openshift-assisted-service-master-edge-e2e-ai-operator-ztp
pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted-4-18
pull-ci-openshift-assisted-service-master-edge-images
pull-ci-openshift-assisted-service-master-edge-lint
pull-ci-openshift-assisted-service-master-edge-subsystem-aws
pull-ci-openshift-assisted-service-master-edge-subsystem-kubeapi-aws
pull-ci-openshift-assisted-service-master-edge-unit-test
pull-ci-openshift-assisted-service-master-edge-verify-generated-code
pull-ci-openshift-assisted-service-master-images
pull-ci-openshift-assisted-service-master-mce-images
pull-ci-openshift-assisted-service-master-okd-scos-e2e-aws-ovn

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

openshift-ci[bot] avatar Feb 27 '25 09:02 openshift-ci[bot]

/test edge-e2e-nutanix-assisted-4-18

rccrdpccl avatar Feb 27 '25 09:02 rccrdpccl

/retest

rccrdpccl avatar Feb 27 '25 09:02 rccrdpccl

nice :heart_eyes:

rccrdpccl avatar Feb 27 '25 09:02 rccrdpccl

/hold Currently, our CI for Nutanix is broken. If this PR is not urgent, I think it is best to hold off on merging it until our CI is fixed.

eliorerz avatar Feb 27 '25 12:02 eliorerz

Currently, our CI for Nutanix is broken. If this PR is not urgent, I think it is best to hold off on merging it until our CI is fixed.

@eliorerz I guess it's not urgent because it has been broken since forever, but we are breaking most nutanix installations as we currently produce an invalid install config

rccrdpccl avatar Feb 27 '25 16:02 rccrdpccl

/test edge-e2e-nutanix-assisted-4-18

mlorenzofr avatar Mar 24 '25 11:03 mlorenzofr

/test edge-e2e-nutanix-assisted-4-18

mlorenzofr avatar Mar 25 '25 08:03 mlorenzofr

@eliorerz @rccrdpccl all tests passed (including nutanix), do you think we can unhold and merge it?

mlorenzofr avatar Mar 25 '25 15:03 mlorenzofr

@mlorenzofr sure, LGTM - feel free to unhold whenever suits you best

rccrdpccl avatar Mar 26 '25 08:03 rccrdpccl

@eliorerz I think this changes only improves the current situation: this works by chance, as the golang structs happen to have the same name as the desired json schema, and json is case insensitive. However this breaks if the struct's fields name differ from the json schema (as DeprecatedAPIVIP).

We should understand why we ended up in this else condition, but maybe we could investigate that issue separately. WDYT, should we merge this?

rccrdpccl avatar Apr 04 '25 11:04 rccrdpccl

/test edge-e2e-vsphere-assisted-4-19

mlorenzofr avatar Apr 10 '25 08:04 mlorenzofr

/test edge-e2e-metal-assisted-external-4-19 /test edge-e2e-nutanix-assisted-4-19

mlorenzofr avatar May 19 '25 13:05 mlorenzofr

/test ?

mlorenzofr avatar May 20 '25 06:05 mlorenzofr

@mlorenzofr: The following commands are available to trigger required jobs:

/test e2e-agent-compact-ipv4
/test edge-assisted-operator-catalog-publish-verify
/test edge-ci-index
/test edge-e2e-ai-operator-disconnected-capi
/test edge-e2e-ai-operator-ztp
/test edge-e2e-ai-operator-ztp-3masters
/test edge-e2e-ai-operator-ztp-capi
/test edge-e2e-ai-operator-ztp-disconnected
/test edge-e2e-metal-assisted-4-14
/test edge-e2e-metal-assisted-4-15
/test edge-e2e-metal-assisted-4-16
/test edge-e2e-metal-assisted-4-17
/test edge-e2e-metal-assisted-4-19
/test edge-e2e-metal-assisted-5-control-planes-4-19
/test edge-e2e-metal-assisted-ai-amd-4-18
/test edge-e2e-metal-assisted-ai-nvidia-4-18
/test edge-e2e-metal-assisted-external-4-19
/test edge-e2e-metal-assisted-lvm-4-19
/test edge-e2e-metal-assisted-none-4-19
/test edge-e2e-metal-assisted-osc-4-19
/test edge-e2e-metal-assisted-virtualization-4-18
/test edge-e2e-nutanix-assisted-2workers-4-19
/test edge-e2e-nutanix-assisted-4-19
/test edge-e2e-vsphere-assisted-4-19
/test edge-images
/test edge-lint
/test edge-operator-publish-verify
/test edge-subsystem-aws
/test edge-subsystem-kubeapi-aws
/test edge-unit-test
/test edge-verify-generated-code
/test images
/test mce-images
/test verify-deps

The following commands are available to trigger optional jobs:

/test e2e-agent-4control-ipv4
/test e2e-agent-5control-ipv4
/test e2e-agent-ha-dualstack
/test e2e-agent-sno-ipv6
/test edge-e2e-ai-operator-ztp-4masters
/test edge-e2e-ai-operator-ztp-5masters
/test edge-e2e-ai-operator-ztp-compact-day2-masters
/test edge-e2e-ai-operator-ztp-compact-day2-workers
/test edge-e2e-ai-operator-ztp-multiarch-3masters-ocp
/test edge-e2e-ai-operator-ztp-multiarch-sno-ocp
/test edge-e2e-ai-operator-ztp-node-labels
/test edge-e2e-ai-operator-ztp-remove-node
/test edge-e2e-ai-operator-ztp-sno-day2-masters
/test edge-e2e-ai-operator-ztp-sno-day2-workers
/test edge-e2e-ai-operator-ztp-sno-day2-workers-ignitionoverride
/test edge-e2e-ai-operator-ztp-sno-day2-workers-late-binding
/test edge-e2e-metal-assisted-4-control-planes-4-19
/test edge-e2e-metal-assisted-4-masters-none-4-19
/test edge-e2e-metal-assisted-bond-4-14
/test edge-e2e-metal-assisted-bond-4-19
/test edge-e2e-metal-assisted-day2-4-19
/test edge-e2e-metal-assisted-day2-arm-workers-4-19
/test edge-e2e-metal-assisted-day2-sno-4-19
/test edge-e2e-metal-assisted-ipv4v6-4-19
/test edge-e2e-metal-assisted-ipv6-4-19
/test edge-e2e-metal-assisted-kube-api-late-binding-sno-4-19
/test edge-e2e-metal-assisted-kube-api-late-unbinding-sno-4-19
/test edge-e2e-metal-assisted-kube-api-net-suite-4-19
/test edge-e2e-metal-assisted-kube-api-umlb-4-19
/test edge-e2e-metal-assisted-onprem-4-19
/test edge-e2e-metal-assisted-osc-sno-4-19
/test edge-e2e-metal-assisted-sno-4-19
/test edge-e2e-metal-assisted-static-ip-suite-4-14
/test edge-e2e-metal-assisted-static-ip-suite-4-19
/test edge-e2e-metal-assisted-tang-4-19
/test edge-e2e-metal-assisted-tpmv2-4-19
/test edge-e2e-metal-assisted-umlb-4-19
/test edge-e2e-metal-assisted-upgrade-agent-4-19
/test edge-e2e-oci-assisted-4-19
/test edge-e2e-oci-assisted-bm-iscsi-4-19
/test edge-e2e-vsphere-assisted-umlb-4-19
/test edge-e2e-vsphere-assisted-umn-4-19
/test okd-scos-e2e-aws-ovn
/test okd-scos-images
/test push-pr-image

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-assisted-service-master-e2e-agent-compact-ipv4
pull-ci-openshift-assisted-service-master-edge-ci-index
pull-ci-openshift-assisted-service-master-edge-e2e-ai-operator-ztp
pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted-4-19
pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted-external-4-19
pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted-none-4-19
pull-ci-openshift-assisted-service-master-edge-e2e-nutanix-assisted-4-19
pull-ci-openshift-assisted-service-master-edge-e2e-vsphere-assisted-4-19
pull-ci-openshift-assisted-service-master-edge-images
pull-ci-openshift-assisted-service-master-edge-lint
pull-ci-openshift-assisted-service-master-edge-subsystem-aws
pull-ci-openshift-assisted-service-master-edge-subsystem-kubeapi-aws
pull-ci-openshift-assisted-service-master-edge-unit-test
pull-ci-openshift-assisted-service-master-edge-verify-generated-code
pull-ci-openshift-assisted-service-master-images
pull-ci-openshift-assisted-service-master-mce-images
pull-ci-openshift-assisted-service-master-okd-scos-e2e-aws-ovn
pull-ci-openshift-assisted-service-master-verify-deps

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

openshift-ci[bot] avatar May 20 '25 06:05 openshift-ci[bot]

/test verify-deps

mlorenzofr avatar May 20 '25 06:05 mlorenzofr

/lgtm /approve

rccrdpccl avatar May 20 '25 08:05 rccrdpccl

Walkthrough

The changes introduce and enhance test coverage for Nutanix platform configuration handling. Tests were added to validate JSON unmarshalling and field-level assertions for Nutanix-specific install config fields. Struct field tags for Nutanix types were switched from YAML to JSON. Full YAML output comparisons in tests were replaced with granular field assertions.

Changes

Files Change Summary
internal/installcfg/builder/builder_test.go Added tests for Nutanix platform config validation/unmarshalling and helper assertion functions for Nutanix fields.
internal/installcfg/installcfg.go Changed Nutanix-related struct field tags from yaml to json for serialization.
internal/provider/registry/registry_test.go Replaced full YAML output comparisons with detailed field-by-field assertions for Nutanix platform config.

Poem

In the warren where configs grow, Nutanix fields now clearly show. From YAML tags to JSON’s grace, And tests that check each tiny place. With every hop, a field asserted— The builder’s trust, well-concerted! 🐇✨

[!NOTE]

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Learn more here.


[!NOTE]

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings. Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 86a016c53f530cc75311edec9d8199c31b6ca925 and 5fbf17cc103ffa10cf41edfa9af8c877a1707aaf.

📒 Files selected for processing (3)
  • internal/installcfg/builder/builder_test.go (2 hunks)
  • internal/installcfg/installcfg.go (1 hunks)
  • internal/provider/registry/registry_test.go (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/provider/registry/registry_test.go (3)
vendor/github.com/onsi/gomega/gomega_dsl.go (1)
  • Expect (220-223)
internal/installcfg/installcfg.go (1)
  • Platform (9-15)
internal/common/test_configuration.go (1)
  • Address (569-572)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Red Hat Konflux / assisted-service-rhel9-acm-ds-main-on-pull-request
  • GitHub Check: Red Hat Konflux / assisted-service-saas-main-on-pull-request
  • GitHub Check: Red Hat Konflux / assisted-service-rhel8-acm-ds-main-on-pull-request
🔇 Additional comments (12)
internal/installcfg/installcfg.go (4)

113-122: Structure annotation tag change from YAML to JSON

The field tags in NutanixInstallConfigPlatform struct have been changed from YAML to JSON, which aligns with the PR objective to fix the unmarshalling issue with Nutanix types.


124-130: Field tag format change from YAML to JSON

The field tags in NutanixPrismCentral struct have been changed from YAML to JSON, consistent with the unmarshalling fix being implemented across all Nutanix types.


132-137: Serialization format update from YAML to JSON

The field tags in NutanixEndpoint struct have been updated from YAML to JSON format, maintaining consistency with the rest of the Nutanix-related struct changes.


139-145: Field tag conversion from YAML to JSON

The field tags in NutanixPrismElement struct have been changed from YAML to JSON format, completing the consistent conversion across all Nutanix-related structs.

internal/provider/registry/registry_test.go (2)

361-371: Replaced YAML assertions with granular field assertions

The test for Nutanix platform with OpenShift version 4.12 now uses individual field assertions instead of full YAML string comparisons. This approach provides more precise test failures and better readability when tests fail.


387-399: Enhanced test coverage for OpenShift 4.11

The test for OpenShift version 4.11 now includes additional assertions for deprecated fields (DeprecatedAPIVIP and DeprecatedIngressVIP), ensuring backward compatibility is maintained while properly testing the newly standardized fields.

internal/installcfg/builder/builder_test.go (6)

264-264: Added Nutanix install config test data

Added a JSON string constant for testing Nutanix platform configuration overrides, which will be used in the subsequent tests to verify correct JSON unmarshalling.


266-272: Added test for Nutanix override decoding

This test verifies that Nutanix platform configuration is correctly decoded when applying config overrides directly, ensuring the JSON tag changes work properly.


274-283: Added test for end-to-end Nutanix configuration unmarshalling

This test validates the complete flow from install config generation to JSON unmarshalling for Nutanix platform configuration, ensuring the serialization changes work in the full context.


285-294: Added test for Nutanix credentials unmarshalling

This test specifically focuses on the correct unmarshalling of sensitive Nutanix credential fields (username and password), which is important for security and functionality.


971-980: Added Nutanix platform assertion helper function

This helper function encapsulates the verification logic for Nutanix platform fields, improving code reuse and readability across the test cases.


982-986: Added Nutanix credentials assertion helper function

This helper function focuses specifically on verifying the correct unmarshalling of Nutanix credential fields, providing a clear separation of concerns in the test assertions.

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar May 20 '25 08:05 coderabbitai[bot]

@mlorenzofr: This pull request references MGMT-20025 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.0" version, but no target version was set.

In response to this:

This PR fixes a bug unmarshalling the install-config generated by the assisted-service due to an error in Nutanix type encoding.

List all the issues related to this PR

  • [ ] New Feature
  • [ ] Enhancement
  • [X] Bug fix
  • [X] Tests
  • [ ] Documentation
  • [ ] CI/CD

What environments does this code impact?

  • [X] Automation (CI, tools, etc)
  • [x] Cloud
  • [x] Operator Managed Deployments
  • [ ] None

How was this code tested?

  • [ ] assisted-test-infra environment
  • [ ] dev-scripts environment
  • [x] Reviewer's test appreciated
  • [x] Waiting for CI to do a full test run
  • [x] Manual (tested on Nutanix platform with CAPI)
  • [ ] No tests needed

Checklist

  • [x] Title and description added to both, commit and PR.
  • [ ] Relevant issues have been associated (see CONTRIBUTING guide)
  • [x] This change does not require a documentation update (docstring, docs, README, etc)
  • [x] Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

  • Tests

  • Enhanced test coverage for Nutanix platform configuration, including validation of field decoding and credential unmarshalling.

  • Updated tests to use granular field-by-field assertions instead of full YAML output comparisons.

  • Refactor

  • Changed struct field tags for Nutanix-related configuration types from YAML to JSON format to improve serialization consistency.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar May 20 '25 08:05 openshift-ci-robot

/test edge-e2e-nutanix-assisted-4-19 /test okd-scos-e2e-aws-ovn /test edge-subsystem-kubeapi-aws

mlorenzofr avatar May 26 '25 16:05 mlorenzofr

/test edge-e2e-nutanix-assisted-4-19 /test okd-scos-e2e-aws-ovn /test edge-e2e-ai-operator-ztp

mlorenzofr avatar May 27 '25 06:05 mlorenzofr

/retest

HTTP response body: {"code":"400","href":"","id":400,"kind":"Error","reason":"api-vip <10.0.200.10> is already in use in cidr 10.0.200.0/22"}

rccrdpccl avatar May 27 '25 08:05 rccrdpccl

/test edge-e2e-nutanix-assisted-4-19 /test edge-e2e-ai-operator-ztp

mlorenzofr avatar May 27 '25 13:05 mlorenzofr

/test edge-e2e-nutanix-assisted-4-19

mlorenzofr avatar May 28 '25 10:05 mlorenzofr