Repository navigation
THREESCALE-16302 Remove cmp.Diff of openapi structs - #1192
borisurbanik wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1192 +/- ##
==========================================
+ Coverage 44.03% 44.67% +0.63%
==========================================
Files 204 208 +4
Lines 20960 21227 +267
==========================================
+ Hits 9230 9483 +253
- Misses 10933 10944 +11
- Partials 797 800 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
tkan145
left a comment
There was a problem hiding this comment.
There are other cmp.Diff in the code, can we remove them all? Keep the log though, I don't see why we need to call cmp.Diff to compare string/bool/int.
58ce5f2 to
a70e09a
Compare
Removed all cmp.Diff occurrences. |
|
Can we keep those log values please 😅 |
a70e09a to
9fde8fc
Compare
Updated, added "existing" and "desired" kv entries for the logger. Please take a look again. |
tkan145
left a comment
There was a problem hiding this comment.
Most of the fields are pointers, so we are just recording their memory addresses. To record the actual values, we need to dereference those pointers; at the same time, we must ensure they are not nil. The log level is currently set to debug, and while I still find them useful for troubleshooting, it seems we need extra logic to ensure the panic error doesn't recur.
So what do you think about removing these debug logs?
9fde8fc to
1ddfa9f
Compare
To address directly the dereferencing while we're discussing I have added If it still feels like unnecessary risk I'd suggest removing the values but leaving the bare log messages to at least guide to the right field in the payload to investigate. So, there are still the 2 other options:
Let me know how does |
|
/retest |
|
@tkan145 Since the PR is about the bug THREESCALE-16302 and not the field diff logging, can we pick one of the 2 paths forward:
Which of these two would you prefer to approve? |
|
Sorry, but I find this a bit confusing. I previously asked if you wanted to remove that log section, and then you suggested using |
Also after discussion in PR the verbose log entries containing cmp.Diff were removed to avoid any potential cmp.Diff and pointer issues.
1ddfa9f to
52a3b90
Compare
I have removed the individual field debug logs as you suggested. Please re-review. p.s.: sorry for confusion, it wasn't intentional - I think consensus has been reached now |
Fixes:
Validation
Set up minimal 3scale dev environment.
Run the operator locally.
Wait for reconciliation. Then test the OpenApi will be created with schema with references:
Expected to not show error:
And the operator (make run) to not crash.