Skip to content

Unhide setting js.interpretation.enabled#12605

Open
winterhazel wants to merge 1 commit intoapache:4.20from
winterhazel:unhide-js-interpretation-enabled
Open

Unhide setting js.interpretation.enabled#12605
winterhazel wants to merge 1 commit intoapache:4.20from
winterhazel:unhide-js-interpretation-enabled

Conversation

@winterhazel
Copy link
Member

@winterhazel winterhazel commented Feb 6, 2026

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 (JsInterpreterHelper already exists in main).

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

  1. I upgraded my environment to the new version, with the changes included, and checked the database entry for js.interpretation.enabled.
  • Before the changes:

    MariaDB [cloud]> select * from configuration where name = "js.interpretation.enabled";
      +----------+----------+------------------+---------------------------+----------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------+---------------------+------------+----------+-------------+--------+---------------------------+------+---------+-------+
      | category | instance | component        | name                      | value                                        | description                                                                                                | default_value | updated             | is_dynamic | group_id | subgroup_id | parent | display_text              | kind | options | scope |
      +----------+----------+------------------+---------------------------+----------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------+---------------------+------------+----------+-------------+--------+---------------------------+------+---------+-------+
      | Hidden   | DEFAULT  | ManagementServer | js.interpretation.enabled | MQmVLZoL1kmmDHZR1YsoIgw0OuvMDdyTnU9y3FEUNDA= | Enable/Disable all JavaScript interpretation related functionalities to create or update Javascript rules. | false         | 2026-01-23 11:09:12 |          0 |        1 |           1 | NULL   | Js interpretation enabled | NULL | NULL    |     1 |
      +----------+----------+------------------+---------------------------+----------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------+---------------------+------------+----------+-------------+--------+---------------------------+------+---------+-------+
  • In the logs:

    2026-02-06 11:46:01,436 INFO  [c.c.u.d.Upgrade42210to42300] (main:[]) (logid:) Updating setting 'js.interpretation.enabled' to decrypted value [true].
    
  • After the changes:

    MariaDB [cloud]> select * from configuration where name = "js.interpretation.enabled";
     +----------+----------+---------------+---------------------------+-------+-----------------------------------------------------------------------+---------------+---------------------+------------+----------+-------------+--------+---------------------------+------+---------+-------+
     | category | instance | component     | name                      | value | description                                                           | default_value | updated             | is_dynamic | group_id | subgroup_id | parent | display_text              | kind | options | scope |
     +----------+----------+---------------+---------------------------+-------+-----------------------------------------------------------------------+---------------+---------------------+------------+----------+-------------+--------+---------------------------+------+---------+-------+
     | System   | DEFAULT  | JsInterpreter | js.interpretation.enabled | true  | Enable/disable all JavaScript interpretation related functionalities. | false         | 2026-02-06 11:45:28 |          1 |        1 |           1 | NULL   | Js interpretation enabled | NULL | NULL    |     1 |
     +----------+----------+---------------+---------------------------+-------+-----------------------------------------------------------------------+---------------+---------------------+------------+----------+-------------+--------+---------------------------+------+---------+-------+
  1. I attempted to create heuristic rules, flexible tags, and Quota activation rules. When the setting was disabled, I received an error informing me that js.interpretation.enabled was disabled. When the setting was enabled, I was able to create them successfully.

@winterhazel
Copy link
Member Author

@blueorangutan package

@winterhazel winterhazel changed the title Unhide setting 'js.interpretation.enabled' Unhide setting js.interpretation.enabled Feb 6, 2026
@blueorangutan
Copy link

@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
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 4.15%. Comparing base (3d7d412) to head (9343086).
⚠️ Report is 13 commits behind head on 4.20.

❗ There is a different number of reports uploaded between BASE (3d7d412) and HEAD (9343086). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3d7d412) HEAD (9343086)
unittests 1 0
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     
Flag Coverage Δ
uitests 4.15% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16729

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15416)

@winterhazel
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16762

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15426)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JsInterpreterHelper class to centralize JS interpretation configuration and validation
  • Moves js.interpretation.enabled from 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() to JsInterpreterHelper.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.

@DaanHoogland DaanHoogland added this to the 4.20.3 milestone Feb 16, 2026
@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15484)

@weizhouapache
Copy link
Member

@winterhazel
the mgmt service failed to start , can you check ?
the simulator CI tests failed too

@winterhazel winterhazel force-pushed the unhide-js-interpretation-enabled branch from 2c89c1c to 9343086 Compare February 19, 2026 17:33
@winterhazel
Copy link
Member Author

@blueorangutan package

@winterhazel
Copy link
Member Author

@winterhazel the mgmt service failed to start , can you check ? the simulator CI tests failed too

@weizhouapache should be fixed now

@blueorangutan
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments