-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a fix for nil pointer issue in converter. #5742
Conversation
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
@@ -46,6 +46,9 @@ func SqlDatabaseDataModelFromVersioned(content []byte, version string) (*datamod | |||
return nil, err | |||
} | |||
dm, err := am.ConvertTo() | |||
if err != nil { | |||
return nil, err | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for checking the others. I was about to ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have tests that cover these cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for pointing this out, the invalid tests we had were not covering this case. added tests for this case
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Test Results2 719 tests +5 2 712 ✔️ +5 2m 1s ⏱️ -1s Results for commit 2536682. ± Comparison against base commit bfcef12. This pull request removes 2 and adds 7 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
# Description Added changes to throw an error if conversion fails. ## Issue reference <!-- We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation. --> Fixes: #issue_number ## Checklist Please make sure you've completed the relevant tasks for this PR, out of the following list: * [x] Code compiles correctly * [ ] Adds necessary unit tests for change * [ ] Adds necessary E2E tests for change * [x] Unit tests passing * [ ] Extended the documentation / Created issue for it ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 495ce78</samp> ### Summary 🐛🔧🚧 <!-- 1. 🐛 - This emoji represents a bug fix, since the changes add error handling to prevent potential bugs or crashes when converting data models. 2. 🔧 - This emoji represents a tool, since the changes improve the functionality of the data model conversion functions, which are tools for working with different versions of data models. 3. 🚧 - This emoji represents a work in progress, since the changes are part of a larger refactoring effort to support multiple versions of data models. --> This pull request adds error handling to various data model conversion functions in the `pkg/linkrp/datamodel/converter` package. These functions are used to transform versioned data models of different resources to non-versioned ones for the LinkRP service. > _`DataModelFromVersioned`_ > _Converts with error checks_ > _Fall leaves may wither_ ### Walkthrough * Add error handling to data model conversion functions for various resources ([link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-fe1e9091ecc83a1c3582eb567510654663be1b6c5951afe78e0bda54d31fd54bR49-R51), [link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-6514b54334e0557b86400723b1b35865b8de5a6772d172722f2efba9894e1e9aR49-R51), [link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-9e2a6c473f54c263a21337c76232aa7cdbf203548bcd9bcfe80f31116c95f9a8R53-R55), [link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-f724a3f770fd8f4face722e8f6d76e6c7b80dbf83c027b6abd3780424443637dR48-R50), [link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-8cceaefe3dd01bf27434e4215db6c298f5d6fe2154db41956253e7d61554e20fR48-R50), [link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-0783b94ee282178c7c2442e63467d15599a141a764f75b64c0185aaea968c164R53-R55), [link](https://github.com/project-radius/radius/pull/5742/files?diff=unified&w=0#diff-8c3eb95b328475de587a4b1cde8ee1d8dc5af838ec3740b6cbe62c25da73baffR49-R51))
Description
Added changes to throw an error if conversion fails.
Issue reference
Fixes: #issue_number
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
Auto-generated summary
🤖 Generated by Copilot at 495ce78
Summary
🐛🔧🚧
This pull request adds error handling to various data model conversion functions in the
pkg/linkrp/datamodel/converter
package. These functions are used to transform versioned data models of different resources to non-versioned ones for the LinkRP service.Walkthrough