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

Make it possible to use project name to match downstream/upstream projects

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • ivy-plugin
    • None

      We have one Jenkins instance (master/slave setup) serving multiple versions of our product which we indicate by a suffix on the job name, e.g. 11a, LSV. However, for various internal reasons it is not indicated in ivy.xml for each module (i.e. identical organization, module and revision attributes) so we still need to match only on organization and module, i.e. we do not use the branch attribute. Currently, we are experiencing a somewhat strange behavior. With the following modules:

      PC_CLI_11a
      PC_CLI_LSV
      PC_Persistence_11a
      PC_Persistence_LSV

      where CLI is dependent on Persistence, upstream/downstream modules are reported as:

      PC_CLI_11a (Upstream: PC_Persistence_11a, Downstream: none)
      PC_CLI_LSV (Upstream: PC_Persistence_11a, Downstream: none)
      PC_Persistence_11a (Upstream: none, Downstream: PC_CLI_11a, PC_CLI_LSV)
      PC_Persistence_LSV (Upstream: none, Downstream: none)

      One way of solving this would be to bring in the job name into equation, e.g. a regular expression that must match in order to qualify as upstream/downstream dependency. Comments?

      I have not yet looked at the code but will do soon so any pointers are welcome.

          [JENKINS-9279] Make it possible to use project name to match downstream/upstream projects

          If you are using Ivy Projects (as opposed to the Ivy Trigger in Freestyle projects) then you might be able to make use of the "Ivy branch" field (even if you are not actually using Ivy branches).

          We make heavy use of Ivy branches here (so that you can match dependencies like rev="latest.integration" branch="11a" or rev="latest.integration" branch="LSV". Then in our Ivy Project type jobs in Jenkins we fill in the correct value for the "Ivy branch" field to instruct the Ivy plugin to which branch this job belongs.

          As I mentioned though, even if you are not using branches in Ivy, the "Ivy branch" field might still be of use here. If you specify "LSV" as the branch in your PC_CLI_LSV and PC_Persistence_LSV jobs and "11a" as the branch in your PC_CLI_11a and PC_Persistence_11a jobs it should generate the correct upstream/downstream triggers.

          Timothy Bingaman added a comment - If you are using Ivy Projects (as opposed to the Ivy Trigger in Freestyle projects) then you might be able to make use of the "Ivy branch" field (even if you are not actually using Ivy branches). We make heavy use of Ivy branches here (so that you can match dependencies like rev="latest.integration" branch="11a" or rev="latest.integration" branch="LSV" . Then in our Ivy Project type jobs in Jenkins we fill in the correct value for the "Ivy branch" field to instruct the Ivy plugin to which branch this job belongs. As I mentioned though, even if you are not using branches in Ivy, the "Ivy branch" field might still be of use here. If you specify "LSV" as the branch in your PC_CLI_LSV and PC_Persistence_LSV jobs and "11a" as the branch in your PC_CLI_11a and PC_Persistence_11a jobs it should generate the correct upstream/downstream triggers.

          bloomper added a comment -

          Thanks, it works great with filling in "Ivy branch"! However, it is not possible to have a common project triggering multiple downstream projects (on multiple branches), only one will be triggered. This is due to overwriting in the hash map modules in buildDependencyGraph() in IvyModule. But that is perhaps asking too much...

          bloomper added a comment - Thanks, it works great with filling in "Ivy branch"! However, it is not possible to have a common project triggering multiple downstream projects (on multiple branches), only one will be triggered. This is due to overwriting in the hash map modules in buildDependencyGraph() in IvyModule. But that is perhaps asking too much...

            tbingaman Timothy Bingaman
            bloomper bloomper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: