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

Generalize DependencyGraph to Job (or ParameterizedJobMixIn)

    XMLWordPrintable

Details

    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

            jglick Jesse Glick added a comment -

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

            jglick Jesse Glick added a comment - abayer had started work on this but put it on the back burner.
            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 }
            }
            
            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

              Unassigned Unassigned
              jglick Jesse Glick
              Votes:
              25 Vote for this issue
              Watchers:
              31 Start watching this issue

              Dates

                Created:
                Updated: