-
Notifications
You must be signed in to change notification settings - Fork 26
Fix empty string nullification #292
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 empty string nullification #292
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #292 +/- ##
=======================================
Coverage 91.98% 91.98%
=======================================
Files 6 6
Lines 711 711
=======================================
Hits 654 654
Misses 57 57 ☔ View full report in Codecov by Sentry. |
Hi @jordanbreen28 , for this one I 'm not sure what is going on. |
hey @Clebam - yeah i don't think thats the issue as our nightly builds are passing. Something that has changed in this PR has caused it - Not to worry though! I'll be happy to collaborate, spin up an environment and take a look at this myself shortly. Appreciate all your work on these! |
@Clebam I've been looking into this some more, running tests and trying to get a working solution, but the more time I've spent on this I'm starting to think this maybe isn't the way to go 👎 I think a fix is more appropriate in the puppet-resource_api, and how it's compares the empty or |
I gave a look at resource-api, it's a bit overwhelming at first glance. Not sure if I can spot something useful. |
@Clebam agreed, it is definitely a biggy. |
@jordanbreen28 However I'm curious to know what you saw that is going wrong with my fix. Maybe there is more I can do to it 🤔 (and I'm also interested if I can still try to use my quick fix in my env without breaking something. From my point of view, it did not have any wrong effects, but given you found issues, I'm a bit worried to merge it into my production environment 😓 ) |
@Clebam actually disregard my previous message! This should work. I'm going to spend some more time in prying into the code to see if I can spot what is exactly happening here. Could you rebase this off main? Some changes have went in, wondering if they effect the behaviour in anyway. |
25efb36
to
96eb242
Compare
@jordanbreen28, I rebased from main. If you have any logs from the puppet run that fails, I could give a look. |
@Clebam apologies, I was off last week. I'll get to looking at this and providing some logs as soon as I can. |
@Clebam so the issue here is that we are converting nil enums to empty strings even when that is not a valid enum value. So I would recommend not running this in any of your environments as this will cause unexpected behaviour! I'm sure there is a way we can convert only valid values..
The only way we can access the resource type properties is within the |
I see. Not at work today but will give a shot tomorrow. At first glance the enum_values function I added might be useful here to know if
Will keep you updated tomorrow |
a51bd64
to
4945294
Compare
@jordanbreen28 Seems to be working 😄 |
@Clebam amazing! Yes, like you said, let me spin up an environment and to just reassure this doesn't break the existing logic :) Looking good though! |
3b410e6
to
3c1b39e
Compare
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.
LGTM. Thanks for your work on this @Clebam
Reinstating reverted change by Clebam with additional fix suggested by original author. Original PR: #292 Revert PR: #342 Reason for revert: #340 Original author: https://github.com/Clebam
Reinstating reverted change by Clebam with additional fix suggested by original author. Original PR: puppetlabs#292 Revert PR: puppetlabs#342 Reason for revert: puppetlabs#340 Original author: https://github.com/Clebam
Summary
Linked to #264
Related Issues (if any)
#264
Checklist