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

New "WorkflowScript: 14: "ansiColor" should have 1 arguments but has 0 arguments instead" exception thrown in version 1.1.1

    • Declarative - 1.2

      Steps to Reproduce:

      1. Using version 1.1.1 of Pipeline Model Definition Plugin, try running a job using this Jenkinsfile: https://github.com/mozilla/fxapom/blob/13f8e668f5d99ebc6a66045db238494479acef00/Jenkinsfile

      Actual Results:

      WorkflowScript: 14: "ansiColor" should have 1 arguments but has 0 arguments instead. @ line 14, column 5. ansiColor() ^

       

      We fixed/worked around this in https://github.com/mozilla/fxapom/pull/91 but as it was working before, want to check if it's an intended change.

          [JENKINS-42772] New "WorkflowScript: 14: "ansiColor" should have 1 arguments but has 0 arguments instead" exception thrown in version 1.1.1

          And, sorry (again); this "regressed" with version 1.1.1, for us, but was fine using version 1.0.2.

          Stephen Donner added a comment - And, sorry (again); this "regressed" with version 1.1.1, for us, but was fine using version 1.0.2.

          Andrew Bayer added a comment -

          So in truth, that probably should have always been failing. Off the top of my head, I'm not sure what change caused this to be altered, but I'll dig into it as soon as I'm done with a fix for JENKINS-42771.

          Andrew Bayer added a comment - So in truth, that probably should have always been failing. Off the top of my head, I'm not sure what change caused this to be altered, but I'll dig into it as soon as I'm done with a fix for  JENKINS-42771 .

          Andrew Bayer added a comment -

          Oh, and I haven't said it already, I'm so sorry for the regressions! JENKINS-42771 we definitely could have caught with a test if we'd realized anyone was actually doing that syntax, and this one I can definitely test for, albeit not necessarily with that specific plugin. I need to comb through your Jenkinsfiles to see what other regression tests I can derive from them. =)

          Andrew Bayer added a comment - Oh, and I haven't said it already, I'm so sorry for the regressions! JENKINS-42771 we definitely could have caught with a test if we'd realized anyone was actually doing that syntax, and this one I can definitely test for, albeit not necessarily with that specific plugin. I need to comb through your Jenkinsfiles to see what other regression tests I can derive from them. =)

          Andrew Bayer added a comment -

          Sooooo this was supposed to always happen! But it didn't until we fixed JENKINS-42640. Grr. Sorry for the inconvenience - the ansiColor step should really change to having a no-params DataBoundConstructor and a DataBoundSetter for the colorMapName, so that it doesn't need a parameter and will just use AnsiColorMap.DefaultName by default. That works in Scripted Pipeline as is because we don't actually validate whether the right parameters are passed to the step, and the step doesn't actually care whether it gets the parameter. But since it's marked as a DataBoundConstructor, Declarative will always require it to have a parameter.

          Andrew Bayer added a comment - Sooooo this was supposed to always happen! But it didn't until we fixed  JENKINS-42640 . Grr. Sorry for the inconvenience - the ansiColor step should really change to having a no-params DataBoundConstructor and a DataBoundSetter for the colorMapName , so that it doesn't need a parameter and will just use AnsiColorMap.DefaultName by default. That works in Scripted Pipeline as is because we don't actually validate whether the right parameters are passed to the step, and the step doesn't actually care whether it gets the parameter. But since it's marked as a DataBoundConstructor , Declarative will always require it to have a parameter.

          Stephen Donner added a comment - https://github.com/mozilla/Addon-Tests/blob/master/Jenkinsfile https://github.com/mozilla/socorro/blob/master/e2e-tests/Jenkinsfile https://github.com/mozilla/treeherder-tests/blob/master/Jenkinsfile https://github.com/mozilla/snippets-tests/blob/master/Jenkinsfile https://github.com/mozilla/mozillians-tests/blob/master/Jenkinsfile https://github.com/mozilla-services/go-bouncer/blob/master/tests/e2e/Jenkinsfile Shared libraries: https://github.com/mozilla/fxtest-jenkins-pipeline

          Andrew Bayer added a comment -

          You, sir, rock. Thank you very much.

          Andrew Bayer added a comment - You, sir, rock. Thank you very much.

          Andrew Bayer added a comment -

          Re-opening - I think I'm going to set it to not fail when it sees no parameters passed to a single-argument @DataBoundConstructor.

          Andrew Bayer added a comment - Re-opening - I think I'm going to set it to not fail when it sees no parameters passed to a single-argument @DataBoundConstructor .

          Andrew Bayer added a comment -

          Andrew Bayer added a comment - And a PR -  https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/145

          Jesse Glick added a comment -

          The PR is closed; is this still “in review”?

          Discussion on the dev list suggests that you would like a change to DescribableModel to report on the nullability of constructor parameters.

          Jesse Glick added a comment - The PR is closed; is this still “in review”? Discussion on the dev list suggests that you would like a change to DescribableModel to report on the nullability of constructor parameters.

            Unassigned Unassigned
            stephendonner Stephen Donner
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: