Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29711

Snippet Generator: missing attribute names in single-entry forms

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • None
    • workflow 1.4..1.8

      Using the snippet generator for the HTML publisher, the generated code, yields an exception:

      hudson.AbortException: Cannot publish the report. Target is not specified
      	at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:64)
      	at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:43)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
      

      Follow-up to https://github.com/jenkinsci/htmlpublisher-plugin/pull/15/files#r35805641 ...I suspect a bug in workflow, but probably it has been fixed.

      When a form/class contains only one entry, Snippet Generator provides a code without an attribute name :

      publishHtml([reportName : "", ...])
      

      After that the flow execution calls a constructor with null, because a target is missing. The right call is:

      publishHtml(target: [reportName : "", ...])```
      

      Has this bug been fixed in newer workflow versions? I suspect the answer is "no", but probably I'm doing something wrong in the code

          [JENKINS-29711] Snippet Generator: missing attribute names in single-entry forms

          Oleg Nenashev created issue -

          Jesse Glick added a comment -

          I seem to recall something like this affecting ServerEndpointStep/RegistryEndpointStep in docker-workflow: these steps require the parameter name to be specified. The issue here is that there is exactly one (mandatory) parameter, and it is monomorphic. For a polymorphic parameter, this code disambiguates the Map passed by Groovy, deciding whether it is the value of one parameter, or the set of all parameters. Probably that trick just does not work for the monomorphic case, yet Snippetizer assumes that it will. If I am right, either DSL or Snippetizer need to be fixed—preferably the former, so that you can actually use the shorter syntax; but this might be impossible, in which case the latter.

          Jesse Glick added a comment - I seem to recall something like this affecting ServerEndpointStep / RegistryEndpointStep in docker-workflow : these steps require the parameter name to be specified . The issue here is that there is exactly one (mandatory) parameter, and it is monomorphic. For a polymorphic parameter, this code disambiguates the Map passed by Groovy, deciding whether it is the value of one parameter, or the set of all parameters. Probably that trick just does not work for the monomorphic case, yet Snippetizer assumes that it will. If I am right, either DSL or Snippetizer need to be fixed—preferably the former, so that you can actually use the shorter syntax; but this might be impossible, in which case the latter.
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-30519 [ JENKINS-30519 ]
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-26343 [ JENKINS-26343 ]
          Oleg Nenashev made changes -
          Assignee Original: Jesse Glick [ jglick ] New: Oleg Nenashev [ oleg_nenashev ]
          Jens Wilke made changes -
          Description Original: Follow-up to https://github.com/jenkinsci/htmlpublisher-plugin/pull/15/files#r35805641 ...I suspect a bug in workflow, but probably it has been fixed.

          When a form/class contains only one entry, Snippet Generator provides a code without an attribute name :
          {noformat}
          publishHtml([reportName : "", ...])
          {noformat}

          After that the flow execution calls a constructor with null, because a target is missing. The right call is:
          {noformat}
          publishHtml(target: [reportName : "", ...])```
          {noformat}

          Has this bug been fixed in newer workflow versions? I suspect the answer is "no", but probably I'm doing something wrong in the code
          New: Using the snippet generator for the HTML publisher, the generated code yields in an exception:
          {noformat}
          hudson.AbortException: Cannot publish the report. Target is not specified
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:64)
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:43)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
          {noformat}

          Follow-up to https://github.com/jenkinsci/htmlpublisher-plugin/pull/15/files#r35805641 ...I suspect a bug in workflow, but probably it has been fixed.

          When a form/class contains only one entry, Snippet Generator provides a code without an attribute name :
          {noformat}
          publishHtml([reportName : "", ...])
          {noformat}

          After that the flow execution calls a constructor with null, because a target is missing. The right call is:
          {noformat}
          publishHtml(target: [reportName : "", ...])```
          {noformat}

          Has this bug been fixed in newer workflow versions? I suspect the answer is "no", but probably I'm doing something wrong in the code
          Jens Wilke made changes -
          Description Original: Using the snippet generator for the HTML publisher, the generated code yields in an exception:
          {noformat}
          hudson.AbortException: Cannot publish the report. Target is not specified
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:64)
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:43)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
          {noformat}

          Follow-up to https://github.com/jenkinsci/htmlpublisher-plugin/pull/15/files#r35805641 ...I suspect a bug in workflow, but probably it has been fixed.

          When a form/class contains only one entry, Snippet Generator provides a code without an attribute name :
          {noformat}
          publishHtml([reportName : "", ...])
          {noformat}

          After that the flow execution calls a constructor with null, because a target is missing. The right call is:
          {noformat}
          publishHtml(target: [reportName : "", ...])```
          {noformat}

          Has this bug been fixed in newer workflow versions? I suspect the answer is "no", but probably I'm doing something wrong in the code
          New: Using the snippet generator for the HTML publisher, the generated code, yields an exception:
          {noformat}
          hudson.AbortException: Cannot publish the report. Target is not specified
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:64)
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:43)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
          {noformat}

          Follow-up to https://github.com/jenkinsci/htmlpublisher-plugin/pull/15/files#r35805641 ...I suspect a bug in workflow, but probably it has been fixed.

          When a form/class contains only one entry, Snippet Generator provides a code without an attribute name :
          {noformat}
          publishHtml([reportName : "", ...])
          {noformat}

          After that the flow execution calls a constructor with null, because a target is missing. The right call is:
          {noformat}
          publishHtml(target: [reportName : "", ...])```
          {noformat}

          Has this bug been fixed in newer workflow versions? I suspect the answer is "no", but probably I'm doing something wrong in the code
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26126 [ JENKINS-26126 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-32674 [ JENKINS-32674 ]

          Jesse Glick added a comment -

          Reported to affect properties too.

          Jesse Glick added a comment - Reported to affect properties too.

            abayer Andrew Bayer
            oleg_nenashev Oleg Nenashev
            Votes:
            12 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: