Skip to content

(CAT-1724) - Fix Provider returned data not matching Type Schema #295

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

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

jordanbreen28
Copy link
Contributor

@jordanbreen28 jordanbreen28 commented Feb 19, 2024

Summary

Warning: Provider returned data that does not match the Type Schema for `dsc_smbshare[Integrations]`
 Value type mismatch:
    * dsc_path:  (expects a String value, got Undef)

Prior to this PR, we would see the above error returned when dsc would return a nil value for a required string in its data hash.
As puppet is not expecting a nil value, but rather a complete or empty string, the error is raised on each puppet run where this occurs.
We can fix this by converting all required string attributes values returned in the data hash by DSC from nil to an empty string ('').

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@jordanbreen28 jordanbreen28 force-pushed the cat-1724-fix_value_mismatch branch 5 times, most recently from 2840b84 to 7746890 Compare February 19, 2024 14:08
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9203b8d) 91.90% compared to head (e802c9a) 91.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   91.90%   91.98%   +0.07%     
==========================================
  Files           6        6              
  Lines         704      711       +7     
==========================================
+ Hits          647      654       +7     
  Misses         57       57              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Prior to this commit, we would see the above error returned when dsc
would return a nil value for a required string in its data hash.

As puppet is not expecting a nil value, but rather an empty string, the
error is raised on each puppet run where this occurs.

We can fix this by converting all required string attributes values in
the data hash from nil to an empty string ('').
@jordanbreen28 jordanbreen28 force-pushed the cat-1724-fix_value_mismatch branch from 7746890 to e802c9a Compare February 19, 2024 14:19
@jordanbreen28 jordanbreen28 marked this pull request as ready for review February 19, 2024 14:25
@jordanbreen28 jordanbreen28 requested a review from a team as a code owner February 19, 2024 14:25
@david22swan david22swan merged commit 8c4a5bb into main Feb 19, 2024
@david22swan david22swan deleted the cat-1724-fix_value_mismatch branch February 19, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants