[JIRA] (JENKINS-57508) NodeJSInstallation "home" parameter required but not documented

10 views
Skip to first unread message

michele.mauro@aton.com (JIRA)

unread,
May 16, 2019, 11:37:02 AM5/16/19
to jenkinsc...@googlegroups.com
Michele Mauro created an issue
 
Jenkins / Bug JENKINS-57508
NodeJSInstallation "home" parameter required but not documented
Issue Type: Bug Bug
Assignee: Ewelina Wilkosz
Components: configuration-as-code-plugin, nodejs-plugin
Created: 2019-05-16 15:36
Environment: jenkins 2.164.3
nodejs-plugin 1.2.9
configuration-as-code-plugin 1.13
Labels: plugin user-experience configuration
Priority: Minor Minor
Reporter: Michele Mauro

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 its value. 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

Related code: https://github.com/jenkinsci/nodejs-plugin/blob/2d459b1507a763ef14303b3c7b727863ffd974f2/src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java#L70

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:

 

  1. One possible solution could be to remove the requirement on the parameter, possibly adding another constructor that sets the working empty value
  2. 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
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

michele.mauro@aton.com (JIRA)

unread,
May 16, 2019, 11:40:02 AM5/16/19
to jenkinsc...@googlegroups.com
Michele Mauro updated an issue
Change By: Michele Mauro
Environment: jenkins 2.164.3
nodejs-plugin 1.2.9
configuration-as-code-plugin 1.
13 14
configuration-as-code-support:1.14

michele.mauro@aton.com (JIRA)

unread,
May 16, 2019, 11:41:02 AM5/16/19
to jenkinsc...@googlegroups.com
Michele Mauro updated an issue
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 its value set to . In fact, just specifying it as an empty string solves the problem.


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:

 
{code:java}

        tool:
          nodejs:
            installations:
            - name: "Node 11.14"
              home: ""
              properties:
              - installSource:
                  installers:
                  - nodeJSinstaller:
                     id: "11.14.0"
                     npmPackagesRefreshHours: 72
{code}
Without the _home: ""_ value, the instance fails to start with the following error:
{code:java}

io.jenkins.plugins.casc.ConfiguratorException: home is required to configure class jenkins.plugins.nodejs.tools.NodeJSInstallation
{code}
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

nfalco79@hotmail.com (JIRA)

unread,
Jun 26, 2019, 7:08:02 PM6/26/19
to jenkinsc...@googlegroups.com
Nikolas Falco commented on Bug JENKINS-57508
 
Re: NodeJSInstallation "home" parameter required but not documented

For what I know nodeJS plugin has never been tested with configuration as plugin

nfalco79@hotmail.com (JIRA)

unread,
Jun 26, 2019, 7:09:03 PM6/26/19
to jenkinsc...@googlegroups.com
Nikolas Falco edited a comment on Bug JENKINS-57508
For what I know nodeJS plugin has never been tested with configuration as plugin and do not support it till now.

nfalco79@hotmail.com (JIRA)

unread,
Jun 26, 2019, 7:13:01 PM6/26/19
to jenkinsc...@googlegroups.com
Nikolas Falco edited a comment on Bug JENKINS-57508
For what I know nodeJS plugin has never been tested with configuration as plugin and do not support it till now.


I can see that NodeJSInstallation has the same constructor of hudson.tasks.Maven.MavenInstallation and hudson.model.JDK that takes the path already installed home directory (empty by default if install automatically is checked)
Reply all
Reply to author
Forward
0 new messages