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

PipelineTriggersJobProperty / pipelineTriggers() - snippet generator and syntax doc fail

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.18
      Latest plugins installed as of 8-17-16

      I was looking to use the new ability to trigger builds from a multi-branch project on a schedule.

      To try to use it, I went to look for the docs for how to use it, but both the snippet generator and the doc failed.

      For example, when you go to try to generate the trigger with a schedule of "H/15 * * * *", it generated the following:

      properties [pipelineTriggers([]), [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false], [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project']]

      So I then went to look at the pipeline syntax - but on that page, I then found the following:
      {{$class: 'PipelineTriggersJobProperty'
      triggers
      Array/List:
      java.lang.UnsupportedOperationException: do not know how to categorize attributes of type hudson.triggers.Trigger<?>
      }}

      I am also attaching a screenshot

          [JENKINS-37477] PipelineTriggersJobProperty / pipelineTriggers() - snippet generator and syntax doc fail

          Andrew Bayer added a comment -

          PRs up in both workflow-job and workflow-multibranch - the latter is just a test, and will fail for now 'cos I can no longer deploy SNAPSHOTs of workflow-job due to changes in Artifactory permissions.

          Andrew Bayer added a comment - PRs up in both workflow-job and workflow-multibranch - the latter is just a test, and will fail for now 'cos I can no longer deploy SNAPSHOTs of workflow-job due to changes in Artifactory permissions.

          Jesse Glick added a comment -

          Probably then need JENKINS-29711 as well.

          Jesse Glick added a comment - Probably then need JENKINS-29711 as well.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          src/main/java/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobProperty.java
          http://jenkins-ci.org/commit/workflow-job-plugin/df624fbb07df077e04b8acb84d2e604842584ca6
          Log:
          JENKINS-37477 - Partial fix - docs are generated now.

          Snippet generator still not working, so more work to do.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java src/main/java/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobProperty.java http://jenkins-ci.org/commit/workflow-job-plugin/df624fbb07df077e04b8acb84d2e604842584ca6 Log: JENKINS-37477 - Partial fix - docs are generated now. Snippet generator still not working, so more work to do.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/resources/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobProperty/config.jelly
          http://jenkins-ci.org/commit/workflow-job-plugin/0fcaff04e2982488ff895668ad62b80ecea949aa
          Log:
          [FIXED JENKINS-37477] Fixed the snippet generator.

          Test is in workflow-multibranch-plugin.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/resources/org/jenkinsci/plugins/workflow/job/properties/PipelineTriggersJobProperty/config.jelly http://jenkins-ci.org/commit/workflow-job-plugin/0fcaff04e2982488ff895668ad62b80ecea949aa Log: [FIXED JENKINS-37477] Fixed the snippet generator. Test is in workflow-multibranch-plugin.

          Andrew Bayer added a comment -

          Fixed in about-to-release workflow-job plugin 2.6.

          Andrew Bayer added a comment - Fixed in about-to-release workflow-job plugin 2.6.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/15aa0ae9be1867b7bc0911a2785000952df4d8ea
          Log:
          JENKINS-37477 - Demonstrate snippets not generating right for triggers

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/15aa0ae9be1867b7bc0911a2785000952df4d8ea Log: JENKINS-37477 - Demonstrate snippets not generating right for triggers

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/378631399ffb542c005723033f42b0af8b2e5e08
          Log:
          JENKINS-37477 Updating for SNAPSHOT of workflow-job.

          Which fixes doc generation, but not snippet generator.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/378631399ffb542c005723033f42b0af8b2e5e08 Log: JENKINS-37477 Updating for SNAPSHOT of workflow-job. Which fixes doc generation, but not snippet generator.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/debde517af80c551a86e17c14f7a6f2eb1ccab83
          Log:
          JENKINS-37477 Working test for snippet generator for triggers.

          Can't do round tripping due to JENKINS-29711, and StepConfigTester
          doesn't work due to this being a Pipeline-specific JobProperty, but
          the snippet generator test does what's expected.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/debde517af80c551a86e17c14f7a6f2eb1ccab83 Log: JENKINS-37477 Working test for snippet generator for triggers. Can't do round tripping due to JENKINS-29711 , and StepConfigTester doesn't work due to this being a Pipeline-specific JobProperty, but the snippet generator test does what's expected.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/c8494c01368a9641b0f768a37ccc8d57da1e7d6c
          Log:
          JENKINS-37477 Add a test for lack of failures in doc generation.

          Ignoring errors in re: lack of @DataBoundConstructor for now. That may
          change, but those are generally symptomatic of something so deep in
          the core that they're not worth worrying about at the moment.

          The guts of the test should probably move to workflow-cps for common
          usage, a la SnippetizerTester.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/c8494c01368a9641b0f768a37ccc8d57da1e7d6c Log: JENKINS-37477 Add a test for lack of failures in doc generation. Ignoring errors in re: lack of @DataBoundConstructor for now. That may change, but those are generally symptomatic of something so deep in the core that they're not worth worrying about at the moment. The guts of the test should probably move to workflow-cps for common usage, a la SnippetizerTester.

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/42c3b10d3e49fb1b41d3a2663610b2256bbdf055
          Log:
          Merge pull request #28 from abayer/jenkins-37477

          Test for JENKINS-37477

          Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/80120a5bbfb7...42c3b10d3e49

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/42c3b10d3e49fb1b41d3a2663610b2256bbdf055 Log: Merge pull request #28 from abayer/jenkins-37477 Test for JENKINS-37477 Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/80120a5bbfb7...42c3b10d3e49

            abayer Andrew Bayer
            gregcovertsmith Greg Smith
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: