-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix injection of preset variables into the JS interpreter #12515
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
base: 4.20
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12515 +/- ##
============================================
- Coverage 16.24% 16.22% -0.02%
+ Complexity 13396 13381 -15
============================================
Files 5658 5658
Lines 499169 499117 -52
Branches 60579 60578 -1
============================================
- Hits 81087 80999 -88
- Misses 409041 409074 +33
- Partials 9041 9044 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16519 |
|
|
@blueorangutan package |
|
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16520 |



Description
Before commit 03a4b9f, preset variables were injected into the JS interpreter by directly prepending them as a string to the script. 03a4b9f changed the interpreter so that preset variables are injected via bindings instead. However, all preset variables are still injected as a string. Due to this, variables that were previously interpreted as objects are now interpreted as strings. This broke the Quota activation rules and secondary storage selectors features.
This PR changes the code to inject the preset variables using their expected types. Also, the test files of most preset variables have been removed because the tests do not make sense anymore with the new injection mechanism.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
org.apache.cloudstack.utils.jsinterpreter.JsInterpreter#executeScriptInThreadto validate that the preset variables had their expected type in the JS interpreter.org.apache.cloudstack.utils.jsinterpreter.JsInterpreter#executeScriptInThreadto validate that the preset variables had their expected type in the JS interpreter.org.apache.cloudstack.utils.jsinterpreter.JsInterpreter#executeScriptInThreadto validate that the offering's host tags were correctly injected into the JS interpreter as a list.