• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • depgraph-view-plugin
    • None

      The dependency graph view only detects "Build after other projects"/"Build other projects" triggers from the pre- and post-build actions.

      While this is very useful, a number of our jobs have parameterized triggers to other jobs and it would be very useful to be able to also view these in the dependency graph.

      We also copy artifacts from other jobs – it would be great to be able to see these as dependencies too.

          [JENKINS-10804] Detect triggered builds and copied artifacts

          Stefan Wolf added a comment -

          The dependency graph view plugin detects all dependencies from the Jenkins "DependencyGraph". Every plugin which triggers another build as a dependency of one build should contribute to this graph. The ParameterizedTrigger does contribute to the graph, so it already should be included. What version of the parameterized trigger and of jenkins are you using? Do you see the parameterized dependencies as downstream projects on the jobs main page?

          Stefan Wolf added a comment - The dependency graph view plugin detects all dependencies from the Jenkins "DependencyGraph". Every plugin which triggers another build as a dependency of one build should contribute to this graph. The ParameterizedTrigger does contribute to the graph, so it already should be included. What version of the parameterized trigger and of jenkins are you using? Do you see the parameterized dependencies as downstream projects on the jobs main page?

          chris yate added a comment -

          Yes, I do see the jobs that are fired by a post-build Parameterized Trigger in the dependency graph. The 'Join' functionality also shows up.

          But if a job "calls" another job in its 'Build' section, that's not shown in the dependency graph. (as I said above, neither does "Copy Artifact"...)

          I had a look at the code and it seems you'd probably have to look through all the "Builder" objects on a project and inspect them, which would require some knowledge of a number of other plugins.

          chris yate added a comment - Yes, I do see the jobs that are fired by a post-build Parameterized Trigger in the dependency graph. The 'Join' functionality also shows up. But if a job "calls" another job in its 'Build' section, that's not shown in the dependency graph. (as I said above, neither does "Copy Artifact"...) I had a look at the code and it seems you'd probably have to look through all the "Builder" objects on a project and inspect them, which would require some knowledge of a number of other plugins.

          Stefan Wolf added a comment - - edited

          Now I understand what you mean. For me, these builds are not dependencies of the corresponding project, but sub-projects. I have a rough cut of a plugin showing these, see https://github.com/wolfs/sub-project-view, but it is not really done yet.
          If I include them in the dependency graph view plugin, how would you suggest to do so? Drawing just a new edge does not really give the right meaning, I think. Especially for projects of which you wait until their completion before continuing with the build.

          Stefan Wolf added a comment - - edited Now I understand what you mean. For me, these builds are not dependencies of the corresponding project, but sub-projects. I have a rough cut of a plugin showing these, see https://github.com/wolfs/sub-project-view , but it is not really done yet. If I include them in the dependency graph view plugin, how would you suggest to do so? Drawing just a new edge does not really give the right meaning, I think. Especially for projects of which you wait until their completion before continuing with the build.

          chris yate added a comment -

          I see your point – sub-projects are not dependencies... The trouble is, without any link expressed on the graph our 'called' builds are just listed along the top of the dependency graph and look like they're orphaned. I'm not sure how I want it to look – nesting the sub-project box within its parent would make for a messy graph.

          Since dependencies flow downwards on the graph, does it make sense to you to have a horizonal link to indicate a "call"? (perhaps using a different line or arrowhead style). When we "Copy Artifact" from another build I think I'd like to see a dashed line (like UML's "uses" in a component diagram).

          I'll have a look at sub-project-view at work tomorrow and see whether that gives me any better inspiration.

          chris yate added a comment - I see your point – sub-projects are not dependencies... The trouble is, without any link expressed on the graph our 'called' builds are just listed along the top of the dependency graph and look like they're orphaned. I'm not sure how I want it to look – nesting the sub-project box within its parent would make for a messy graph. Since dependencies flow downwards on the graph, does it make sense to you to have a horizonal link to indicate a "call"? (perhaps using a different line or arrowhead style). When we "Copy Artifact" from another build I think I'd like to see a dashed line (like UML's "uses" in a component diagram). I'll have a look at sub-project-view at work tomorrow and see whether that gives me any better inspiration.

          chris yate added a comment -

          Hi wolfs,

          I thought it would be just as easy for me to try things out in the code. So I forked the project to https://github.com/CJBrew/depgraph-view-plugin.

          The latest commit here has a couple of changes that display 'sub jobs' in seperate clusters, and lighter coloured lines showing copied artifacts.

          The depgraph-view-plugin therefore depends on paramaterized-trigger and copy-artifact. Is there a neat way of making the plugin still work without those dependencies installed?

          I wasn't sure whether to issue a pull request; if you consider my changes worthwhile including or have any comments please let me know.

          Best Regards, Chris

          chris yate added a comment - Hi wolfs, I thought it would be just as easy for me to try things out in the code. So I forked the project to https://github.com/CJBrew/depgraph-view-plugin . The latest commit here has a couple of changes that display 'sub jobs' in seperate clusters, and lighter coloured lines showing copied artifacts. The depgraph-view-plugin therefore depends on paramaterized-trigger and copy-artifact. Is there a neat way of making the plugin still work without those dependencies installed? I wasn't sure whether to issue a pull request; if you consider my changes worthwhile including or have any comments please let me know. Best Regards, Chris

            wolfs Stefan Wolf
            cjbrew chris yate
            Votes:
            3 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: