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

Code snippet generation for BuildTriggerStep.parameters

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • None

      Should ideally look up the Job from the job field and dynamically include a list of value.jelly blocks; just not sure how to wire up the JavaScript for this.

      A potential alternative (requiring a core change) would be for ParameterValue, not just ParameterDefinition, to be Describable (where config.jelly just calls value.jelly, passing it = instance), and these would all have a Descriptor, so that <f:repeatableHeteroProperty field="parameters"/> would suffice to configure a List<ParameterValue>. Not as nice for the user, though.

      kohsuke also originally suggested adding ParameterDefinition.createValue(Object) as yet another alternative, but again this is not as friendly to snippet generation.

          [JENKINS-26093] Code snippet generation for BuildTriggerStep.parameters

          Jesse Glick created issue -

          Jesse Glick added a comment -

          Actually even if config.jelly uses value.jelly, we still need for ParameterValue to be Describable, so that DSL syntax can take parameters: [$class: 'StringParameterValue', name: 'branch', value: 'release'] rather than parameters: [new hudson.model.StringParameterValue('branch', 'release')]. (DescribableHelper.instantiate could hardcode support for known ParameterValue implementations but this is messy.)

          Jesse Glick added a comment - Actually even if config.jelly uses value.jelly , we still need for ParameterValue to be Describable , so that DSL syntax can take parameters: [$class: 'StringParameterValue', name: 'branch', value: 'release'] rather than parameters: [new hudson.model.StringParameterValue('branch', 'release')] . ( DescribableHelper.instantiate could hardcode support for known ParameterValue implementations but this is messy.)

          Jesse Glick added a comment -

          This and JENKINS-26143 could probably be worked around in DescribableHelper until a fix is available in core.

          Jesse Glick added a comment - This and JENKINS-26143 could probably be worked around in DescribableHelper until a fix is available in core.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26143 [ JENKINS-26143 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 69 (Web Link)" [ 12139 ]
          Jesse Glick made changes -
          Link Original: This issue is related to JENKINS-26143 [ JENKINS-26143 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-19413 [ JENKINS-19413 ]
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java
          cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
          step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java
          step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java
          support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/config.jelly
          http://jenkins-ci.org/commit/workflow-plugin/72860e91d39712e1beecdab61d42427a4402f294
          Log:
          JENKINS-26093 Allow parameter values to be specified using standard $class syntax.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/config.jelly http://jenkins-ci.org/commit/workflow-plugin/72860e91d39712e1beecdab61d42427a4402f294 Log: JENKINS-26093 Allow parameter values to be specified using standard $class syntax.

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: