Unhide setting js.interpretation.enabled#12605
Unhide setting js.interpretation.enabled#12605winterhazel wants to merge 1 commit intoapache:4.20from
js.interpretation.enabled#12605Conversation
|
@blueorangutan package |
js.interpretation.enabled
|
@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. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12605 +/- ##
=============================================
- Coverage 16.26% 4.15% -12.11%
=============================================
Files 5661 404 -5257
Lines 500010 32965 -467045
Branches 60715 5893 -54822
=============================================
- Hits 81331 1370 -79961
+ Misses 409606 31419 -378187
+ Partials 9073 176 -8897
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:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16729 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-15416) |
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
Outdated
Show resolved
Hide resolved
|
@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 16762 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-15426) |
There was a problem hiding this comment.
Pull request overview
This PR unhides the js.interpretation.enabled configuration setting, moving it from the "Hidden" category to the "System" category, and makes it dynamic so it can be changed without restarting the management server. This addresses issue #12523 where the management server would hang during startup when this setting was enabled. The PR refactors the JavaScript interpretation validation logic by introducing a new JsInterpreterHelper class that centralizes the configuration and validation logic.
Changes:
- Introduces
JsInterpreterHelperclass to centralize JS interpretation configuration and validation - Moves
js.interpretation.enabledfrom ManagementService to JsInterpreterHelper and changes it from "Hidden" to "System" category - Makes the configuration dynamic to allow runtime changes
- Migrates all validation calls from
ManagementService.checkJsInterpretationAllowedIfNeededForParameterValue()toJsInterpreterHelper.ensureInterpreterEnabledIfParameterProvided() - Adds database upgrade script to unhide and decrypt the existing configuration value
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/main/java/org/apache/cloudstack/jsinterpreter/JsInterpreterHelper.java | New helper class that implements Configurable interface and provides the JS_INTERPRETATION_ENABLED ConfigKey and validation method |
| server/src/main/java/com/cloud/storage/StorageManagerImpl.java | Updated to inject and use JsInterpreterHelper for validating storage pool and secondary storage selector operations |
| server/src/main/java/com/cloud/server/ManagementServerImpl.java | Removed old ConfigKey definition, jsInterpretationEnabled field, and validation method; unconditionally registers CreateSecondaryStorageSelectorCmd and UpdateSecondaryStorageSelectorCmd |
| server/src/main/java/com/cloud/resource/ResourceManagerImpl.java | Updated to inject and use JsInterpreterHelper for validating host update operations |
| plugins/database/quota/src/main/java/org/apache/cloudstack/quota/QuotaServiceImpl.java | Removed jsInterpretationEnabled field and isJsInterpretationEnabled() method |
| plugins/database/quota/src/main/java/org/apache/cloudstack/quota/QuotaService.java | Removed isJsInterpretationEnabled() method from interface |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java | Updated to inject and use JsInterpreterHelper for validating quota tariff operations |
| engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java | Adds database migration to unhide and decrypt the js.interpretation.enabled configuration setting |
| api/src/main/java/com/cloud/server/ManagementService.java | Removed JsInterpretationEnabled ConfigKey and checkJsInterpretationAllowedIfNeededForParameterValue() method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
Outdated
Show resolved
Hide resolved
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42020to42030.java
Show resolved
Hide resolved
|
[SF] Trillian Build Failed (tid-15484) |
|
@winterhazel |
2c89c1c to
9343086
Compare
|
@blueorangutan package |
@weizhouapache should be fixed now |
|
@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. |
Description
This PR proposes unhiding
js.interpretation.enabled. For reference regarding why, see the discussion in #12523.Also, the configuration was made dynamic, and some extra refactoring was performed to organize the code (
JsInterpreterHelperalready exists inmain).Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
js.interpretation.enabled.Before the changes:
In the logs:
After the changes:
js.interpretation.enabledwas disabled. When the setting was enabled, I was able to create them successfully.