THREESCALE-11841 Update validation to match Porta - #1191
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1191 +/- ##
==========================================
+ Coverage 44.03% 44.65% +0.62%
==========================================
Files 204 208 +4
Lines 20960 21235 +275
==========================================
+ Hits 9230 9483 +253
- Misses 10933 10952 +19
- 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:
|
|
Is there any reason why we want to remove the validation instead of fixing it to match what the system does? |
Yes, to make it consistent with all the other CRs that contain system name. Also validation rules in porta can change in the future to be more permissive. The ask in JIRA was:
The porta currently uses for validation following regex: I have no objection to changing it to that if that's your preference. |
I don't think you can easily change it without breaking a bunch of things and I don't see it going to happen ever. Plus because the porta validation rules are fixed and known, we validate/false early and save an extra API calls. If needed we can add the same rules to other CRD(s) |
b6fee0a to
46126b8
Compare
Updated PR to match validation as discussed above. Please re-review. |
tkan145
left a comment
There was a problem hiding this comment.
nit: underscore _ here is redundant since \w already includes it)
Additionally, this will cause an error if the system name consists of only a single character (rare), as the system previously required one or more characters but now requires at least two.
I won't block this
/lgtm
/approve
Fixes:
Validation
Set up minimal 3scale dev environment.
This PR touches CRDs - re-create them. This is very destructive so make sure you're on a throwaway cluster.
Run the operator locally.
Wait for reconciliation.
Then test the OpenApi will be created with underscore in the name:
note: the successful processing of activedoc requires fix #1192 to be applied
Expected to succeed (Failed condition status == false):
If the name contains a bad character, it's expected to fail:
Expected to show error: