Skip to content
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

Fix for Datamodel conversion error #5732

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

vishwahiremat
Copy link
Contributor

@vishwahiremat vishwahiremat commented Jun 16, 2023

Description

Added OmitEmpty property on field username.

Issue reference

Fixes: #issue_number

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Adds necessary unit tests for change
  • Adds necessary E2E tests for change
  • Unit tests passing
  • Extended the documentation / Created issue for it

Auto-generated summary

🤖 Generated by Copilot at 1e829c7

Summary

🏷️✨✅

This pull request adds support for the 2022-03-15-privatepreview API version for SQL database converter tests and makes the Username field optional for both SQL and Mongo database properties.

Sing, O Muse, of the skillful engineers who wrought
With nimble fingers and keen minds the code that brought
To life the databases of Mongo and of SQL
And gave them properties of Username optional.

Walkthrough

  • Make Username field optional for SQL and Mongo database properties (link, link)
  • Add test cases for converting SQL database resource and secrets between versioned API and data model representations (link, link)

@vishwahiremat vishwahiremat requested a review from a team as a code owner June 16, 2023 02:25
@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref 1e829c7
Unique ID 1715a470f9
Image tag pr-1715a470f9
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-1715a470f9
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-1715a470f9
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-1715a470f9

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting samples functional tests...
⌛ Starting corerp functional tests...
⌛ Starting ucp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Test Results

2 716 tests  +2   2 709 ✔️ +2   2m 2s ⏱️ ±0s
   241 suites ±0          7 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit d467693. ± Comparison against base commit 6d16267.

This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/3ffa089e-e86c-49a1-bd13-36ca7417bd32
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/3ffa089e-e86c-49a1-bd13-36ca7417bd32#01
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/fa78671c-dc6f-4ec2-b536-38412f73aea4
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/fa78671c-dc6f-4ec2-b536-38412f73aea4#01
github.com/project-radius/radius/pkg/linkrp/datamodel/converter ‑ TestSqlDatabaseDataModelFromVersioned/2022-03-15-privatepreview#02
github.com/project-radius/radius/pkg/linkrp/datamodel/converter ‑ TestSqlDatabaseSecretsDataModelToVersioned/2022-03-15-privatepreview#01

♻️ This comment has been updated with latest results.

@github-actions
Copy link

63.9

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.9 %
  • main branch coverage: 63.9 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

Copy link
Contributor

@ytimocin ytimocin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a meeting to make sure that all properties are correct in terms of being required or not. cc/ @AaronCrawfis @rynowak @sk593

@@ -80,7 +80,7 @@ type SqlDatabaseProperties struct {
// List of the resource IDs that support the SqlDB resource
Resources []*linkrp.ResourceReference `json:"resources,omitempty"`
// Username of the Sql database
Username string `json:"username"`
Username string `json:"username,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have a meeting to discuss which of these properties should be required? cc/ @AaronCrawfis @rynowak

@github-actions

This comment has been minimized.

@github-actions
Copy link

63.9

For the detailed report, please go to Checks tab, click Build and Test, and then download unit_test_coverage artifact at the bottom of build page.

  • Your PR branch coverage: 63.9 %
  • main branch coverage: 63.9 %
  • diff coverage: 0 %

The coverage result does not include the functional test coverage.

@github-actions
Copy link

github-actions bot commented Jun 16, 2023

⌛ Building Radius and pushing container images for functional tests...

✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting samples functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@vishwahiremat vishwahiremat merged commit 046dad1 into main Jun 16, 2023
@vishwahiremat vishwahiremat deleted the vishwahiremat/fixForDatamodelConversionError branch June 16, 2023 07:24
nithyatsu pushed a commit that referenced this pull request Jun 21, 2023
# Description

Added OmitEmpty property on field username.
## Issue reference


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
* [x] 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 1e829c7</samp>

### Summary
:label::sparkles::white_check_mark:

<!--
1. :label: - This emoji represents the addition of the `omitempty` tag
to the JSON annotations, which is a change in the labeling or metadata
of the fields.
2. :sparkles: - This emoji represents the enhancement or improvement of
the functionality of the Mongo and SQL database types, which allows for
more flexibility and options in creating databases without usernames.
3. :white_check_mark: - This emoji represents the addition of new test
cases, which is a change in the quality or reliability of the code.
-->
This pull request adds support for the `2022-03-15-privatepreview` API
version for SQL database converter tests and makes the `Username` field
optional for both SQL and Mongo database properties.

> _Sing, O Muse, of the skillful engineers who wrought_
> _With nimble fingers and keen minds the code that brought_
> _To life the databases of Mongo and of SQL_
> _And gave them properties of `Username` optional._

### Walkthrough
* Make `Username` field optional for SQL and Mongo database properties
([link](https://github.com/project-radius/radius/pull/5732/files?diff=unified&w=0#diff-6d8a82349409a90b33eabb56f84502b98614136152d60fd7a0be2ed82b9edb11L58-R58),
[link](https://github.com/project-radius/radius/pull/5732/files?diff=unified&w=0#diff-e781d4869cd1a8e6df1c16cd083e5a8234b1436e51d2a052486b438ee01aa583L83-R83))
* Add test cases for converting SQL database resource and secrets
between versioned API and data model representations
([link](https://github.com/project-radius/radius/pull/5732/files?diff=unified&w=0#diff-2adf71fc09b0bffd2b6e29ce11a8099ea530d901aa41c159ec8402f7f9acb1d6R80-R84),
[link](https://github.com/project-radius/radius/pull/5732/files?diff=unified&w=0#diff-2adf71fc09b0bffd2b6e29ce11a8099ea530d901aa41c159ec8402f7f9acb1d6R124-R129))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants