View Source

h1. [Job cascading or Inheritance|Job cascading or Inheritance]

The concept of cascading Job is the ability to inherit job properties from parent in a cascading fashion down the inheritance tree as  discussed in *[HUDSON-3157|http://issues.hudson-ci.org/browse/HUDSON-3157]* *Feature request: cascading job settings*.  


Initially  the implementation will be kept simple, with only few UI changes

* Drop down Box at the top of the project config page to select one the saved project to inherit from (filtered by the same type)
!Cascading Dropdwon.png!
* Any project of same type can be used as a parent project for inheritance
* Cycle inheritance is prohibited. The dropdown will not have those projects which can make potential cyclic dependency.
* All Job properties will be shown on the Configure Page, by default they will be taken from Parent
* User can override configuration properties by changing them on Child Configuration Page. When overiiden, property will be highlighted to show it is overriden !Cascade Highlight.png!

* User will be allowed to revert the overriding property to that of the parent using a simple revert button at the left hand side
!cascade revert.png!

* User will not be allowed to delete the project, if the it has cascading children
!Cascading delete.png!

* If Parent contains Builders, Publishers or Triggers they will be merged with Child.

h6.
















*Job properties which* *support cascading in 2.2.x * (Released on Nov 15, 2011) *and later*

|| Project type \\ || Property name \\ || UI changes \\ || Status \\ || Comment \\ ||
| *Freestyle Project* \\ | Discard Old Builds(Days to keep builds, Max # of builds to keep, \\
Days to keep artifacts,Max # of builds to keep with artifacts) | | Complete | |
| | Quiet period | | Complete | |
| | Retry Count | | Complete | |
| | Block build when upstream project is building | | Complete | |
| | Block build when downstream project is building | | Complete | |
| | Use custom workspace | | Complete | |
| | Clean workspace before build | | Complete | |
| | Builders (ant, maven 2 (legacy), maven 3, shell, batch) | | Complete | supported overriding of all section |
| | Publishers (default) \\ | | Complete | |
| | SCM (None, CVS, Subversion, Git) | | Complete | |
| | Disable Build | | Not Yet Implemented | |
| | Execute concurrent builds | | Complete | |
| {color:#008000} {color} | {color:#008000}Build Triggers{color} | {color:#008000} {color} | {color:#008000}Complete{color} | {color:#008000}except pseudo trigger "Build after other projects are built"{color} |
| {color:#008000} {color} | {color:#008000}Parameters{color} \\ | {color:#008000} {color} | {color:#008000}Complete{color} | {color:#008000}supported overriding of all parameters{color} |
| {color:#008000} {color} | {color:#008000}Restrict where this project can be run{color} | {color:#008000} {color} | {color:#008000}Complete{color} | \\ |
| *Multi-configuration* *Project* \\ | Discard Old Builds(Days to keep builds, Max # of builds to keep, \\
Days to keep artifacts,Max # of builds to keep with artifacts) | | Complete | |
| | Quiet period | | Complete | |
| | Retry Count | | Complete | |
| | Block build when upstream project is building | | Complete | |
| | Block build when downstream project is building | | Complete | |
| | Use custom workspace | | Complete | |
| | Configuration Matrix | | Complete | |
| | Run each configuration sequentially  \\ | | Complete | |
| | Combination Filter \\ | | Complete | |
| | Execute touchstone builds first | | Complete | |
| | Builders | | Complete | |
| | Publishers | | Complete | |
| | SCM (None, CVS, Subversion, Git) | | Complete | |
| | {color:#008000}Build Triggers{color} | {color:#008000} {color} | {color:#008000}Complete{color} | {color:#008000}except pseudo trigger "Build after other projects are built"{color} |
| | {color:#008000}Parameters{color} | {color:#008000} {color} | {color:#008000}Complete{color} | {color:#008000}supported overriding of all parameters{color} |
| | {color:#008000}Restrict where this project can be run{color} | {color:#008000} {color} | {color:#008000}Complete{color} | {color:#008000} {color} |
| *Maven 2/3 project (legacy)* \\ | | | | |
| *Monitor an external job* \\ | Discard Old Builds(Days to keep builds, Max # of builds to keep, \\
Days to keep artifacts,Max # of builds to keep with artifacts) | | Complete | |
| | | | | |


*Hudson plugins* *which* *support cascading*
|| Plugin || Version \\ || Comments \\ ||
| Copy Artifact Plugin | 1.12 \\ | |
| Promoted Builds Plugin | 2.4 \\ | |
| Parameterized Trigger Plugin | 2.4 \\ | |
| Deploy Plugin | 1.7 \\ | |
| Build Timeout Plugin \\ | 1.6 \\ | |
| Join Plugin | 1.9 \\ | |
| Static Analysis Utilities | 1.34 \\ | |
| Findbugs Plugin | 4.3 \\ | |
| Warnings Plugin | 3.22 \\ | |
| Task Scanner Plugin | 4.23 \\ | |
| Checkstyle Plugin | 3.21 \\ | |
| PMD Plugin | 3.22 \\ | |
| Mercurial Plugin | 1.35 \\ | |
| Sonar plugin | 1.7.1 \\ | |
| M2release plugin | 0.8.1 \\ | |
| Maven-info | 0.0.3 \\ | |
| M2-extra-steps | 1.1.3 \\ | |
| Svn-tagging | 1.14 \\ | |
| Violations | 0.7.7 \\ | |
| Email-ext plugin | 2.10 \\ | |
| Github plugin | 0.4 \\ | |
| Emma plugin | 1.26 \\ | |
| Cobertura plugin | 1.1 \\ | |
| Locks and Latches plugin | 0.6 \\ | |
| Batch task plugin | 1.14 \\ | |
| {color:#ff0000}Ivy plugin{color} | {color:#ff0000}1.17{color}\\ | {color:#ff0000}NPE on the Ivy project loading:{color} \\ {color:#ff0000}updateTransientActions(AbstractIvyProject.java:63){color} |

h6. Implementation Point of View

* Parent project is a regular project.
* Additional property will be added to the regular project to hold the "*Cascading parent name*"
* The inheritance will be done purely by comparison.
* Same way initially the loading and saving of config page is also done purely by comparison.
** All the UI elements in the config page relies on respective getter method of the project. The getter will provide corresponding data comparing what is saved in the project level config and what is saved in the parent level.
** While saving, compare project level and parent level. If the item (property) to be saved match that of the parent, do not save it in the project config, keep it in the parent config. Properties can have multiple count (example: a project can have more than one builder), So while comparing the count also should be taken in to consideration.