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

Generalize DependencyGraph to Job (or ParameterizedJobMixIn)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently DependencyGraph is limited to AbstractProject, making it impossible for Workflows to participate in upstream/downstream relationships (in cases where job chaining is required, for example due to security constraints).

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Andrew Bayer had started work on this but put it on the back burner.

            Show
            jglick Jesse Glick added a comment - Andrew Bayer had started work on this but put it on the back burner.
            Hide
            djviking Sverre Moe added a comment -

            A much needed feature.

            A solution has been made for the Pipeline Maven Plugin and its PipelineGraphPublisher, but that will not helps us where the majority of our projects are C/C++.
            For C/C++ projects where build requirements are stored in RPM spec files we must implement some solution in our pipeline shared library. In our pipeline we iterate through all projects in Jenkins build view, check out and parse their RPM spec file, find all downstream dependencies from the extracted build requirements. Then executes verification builds on each of them. This adds unnecessary complexity and build time to our build pipeline. However this does only give us direct dependencies, and not all transitive dependencies, so I even considered taking the code from DependencyGraph to use in our Pipeline, but it was not feasible.

            If we had the DependencyGraph for Pipeline and Multibranch Pipeline projects we could just at every SCM change update the projects upstream dependencies. Then later in the pipeline trigger build of all transitive dependencies.

            stage("checkout") { 
              checkout scm
              def downstreamProjects = findAllDownstreamProjects()
              currentBuild.setDownstreamProjects(downstreamProjects)
              build()
            }
            
            stage("verify") {
              def deps = currentBuild.getTransitiveDownstream()
              deps.each { dep -> build name: dep }
            }
            
            Show
            djviking Sverre Moe added a comment - A much needed feature. A solution has been made for the Pipeline Maven Plugin and its PipelineGraphPublisher, but that will not helps us where the majority of our projects are C/C++. For C/C++ projects where build requirements are stored in RPM spec files we must implement some solution in our pipeline shared library. In our pipeline we iterate through all projects in Jenkins build view, check out and parse their RPM spec file, find all downstream dependencies from the extracted build requirements. Then executes verification builds on each of them. This adds unnecessary complexity and build time to our build pipeline. However this does only give us direct dependencies, and not all transitive dependencies, so I even considered taking the code from DependencyGraph to use in our Pipeline, but it was not feasible. If we had the DependencyGraph for Pipeline and Multibranch Pipeline projects we could just at every SCM change update the projects upstream dependencies. Then later in the pipeline trigger build of all transitive dependencies. stage( "checkout" ) { checkout scm def downstreamProjects = findAllDownstreamProjects() currentBuild.setDownstreamProjects(downstreamProjects) build() } stage( "verify" ) { def deps = currentBuild.getTransitiveDownstream() deps.each { dep -> build name: dep } }

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                jglick Jesse Glick
              • Votes:
                17 Vote for this issue
                Watchers:
                24 Start watching this issue

                Dates

                • Created:
                  Updated: