-
Bug
-
Resolution: Fixed
-
Minor
-
jenkins 2.164.3
nodejs-plugin 1.2.9
configuration-as-code-plugin 1.14
configuration-as-code-support:1.14
-
-
1.3.4
When configuring a NodeJS installation with the Configuration as Code plugin, the "home" argument of the NodeJSInstallation class constructor is required and its absence prevents the Jenkins instance to start. The bug is that it is not clear from the configuration UI, nor from an export of a working configuration, nor from any documentation that such a value is required, or what should be set to. In fact, just specifying it as an empty string solves the problem.
Related github issue: https://github.com/jenkinsci/configuration-as-code-plugin/issues/701
Steps to reproduce:
To have a working Jenkins instance using the Configuration as Code plugin, you must use something like the following as configuration for a NodeJS installation:
tool: nodejs: installations: - name: "Node 11.14" home: "" properties: - installSource: installers: - nodeJSinstaller: id: "11.14.0" npmPackagesRefreshHours: 72
Without the home: "" value, the instance fails to start with the following error:
io.jenkins.plugins.casc.ConfiguratorException: home is required to configure class jenkins.plugins.nodejs.tools.NodeJSInstallation
With the empty home value, everything works correctly. The bug is the fact that it is very hard to find (it probably requires inspection of the NodeJS plugin source code) that that value is required, is required in that position, and that an empty value is a correct default.
Possible solutions:
- One possible solution could be to remove the requirement on the parameter, possibly adding another constructor that sets the working empty value
- Another solution could be adding some documentation (it's not clear to me where, however) to guide Configuration as Code users so that they are aware of the requirement