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

Snippet generator does not generate valid code for ReverseBuildTrigger

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • core, workflow-job-plugin
    • None
    • Jenkins 2.7.1
      workflow-job-plugin 2.9
      workflow-multibranch-plugin 2.9.2

      Using the snippet generator to generate the code for a reverse build trigger generates code like this:

      properties([pipelineTriggers([upstream(threshold: <object of type hudson.model.Result>, upstreamProjects: 'foo')])])
      

      The Result object needs to be displayed as e.g. hudson.model.Result.SUCCESS.

      I'm not sure in which component this needs to be fixed; I've filed against core (which implements ReverseBuildTrigger) and workflow-job-plugin (which defines pipelineTriggers).

          [JENKINS-40304] Snippet generator does not generate valid code for ReverseBuildTrigger

          Bruce Merry added a comment -

          I've also just run a 2.19.4 Docker image and confirmed that the problem still exists there.

          Bruce Merry added a comment - I've also just run a 2.19.4 Docker image and confirmed that the problem still exists there.

          Daniel Beck added a comment -

          I can't get the reverse build trigger to show up in the snippet generator for a MBPL, there's just periodically and periodically if not otherwise. Any idea why?

          Could you provide detailed steps to reproduce from scratch?

          Daniel Beck added a comment - I can't get the reverse build trigger to show up in the snippet generator for a MBPL, there's just periodically and periodically if not otherwise. Any idea why? Could you provide detailed steps to reproduce from scratch?

          Bruce Merry added a comment -

          I also had trouble getting it to show up when starting with a fresh Docker image. I fiddled around creating jobs until it worked, but I didn't keep a record of what I did and I'm not sure what the magic combination was. I recall creating a freestyle job and a (non-multibranch) pipeline job, and possibly the snippet generator showed the option on that pipeline job rather than the MBPL I was trying to set up. In production the option shows up when I use the snippet generator on a MBPL though.

          Bruce Merry added a comment - I also had trouble getting it to show up when starting with a fresh Docker image. I fiddled around creating jobs until it worked, but I didn't keep a record of what I did and I'm not sure what the magic combination was. I recall creating a freestyle job and a (non-multibranch) pipeline job, and possibly the snippet generator showed the option on that pipeline job rather than the MBPL I was trying to set up. In production the option shows up when I use the snippet generator on a MBPL though.

          Daniel Beck added a comment -

          I learned yesterday that the correct triggers only show up on a MBPL branch job's snippet generator, not on the global one or the one shown for the MBPL folder project. I'm going to report that as a bug as well. Nobody wants to see a snippet generator with triggers for a folder project that cannot have a pipeline…

          Daniel Beck added a comment - I learned yesterday that the correct triggers only show up on a MBPL branch job's snippet generator, not on the global one or the one shown for the MBPL folder project. I'm going to report that as a bug as well. Nobody wants to see a snippet generator with triggers for a folder project that cannot have a pipeline…

            Unassigned Unassigned
            bmerry Bruce Merry
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: