Hello All,
This one is a follow-up for builds getting triggered for the changes not specified in "Include regions". We also added "force polling using workspace" option, but no luck.
We ran into Jenkins Git plugin merge issue, and wanted to know if this can be addressed, and here is our scenario:
1. Branches A and B are created from master.
2. Jenkins Job_A is created with included regions to look for sub-directories pertaining to changes committed through Branch A.
3. Jenkins Job_B is created with included regions to look for sub-directories pertaining to changes committed through Branch B.
4. Jenkins Job_A, and Job_B are mutually exclusive, as the included regions for triggering builds are only pertaining to their respective sub-directories.
5. Branch A is merged with the master triggering a Jenkins build defined in "Job_A".
6. Branch B is merged with the master triggering a Jenkins build defined in "Job_B".
7. However, when the Branch B code is merged, Jenkins build for "Job_A" is also triggered which is not a part of included region.
8. Seems that this issue can be mitigated if we add "first-parent" option in method showRevision() in "CliGitAPIImpl.java". "first-parent" logic was implemented subsequently with commit#: 777c306e433e7de58702a3fd1e45512a47c0d33a
Please find below the comment referred to extra builds getting triggered.
"The output of "git show" included commits that were not introduced since
the last build, so could falsely trigger build in the presence of
"includedRegions".
A benefit of not including extraneous commits is the size of the output
is reduced, and therefore less heap required.
This can still trigger extra builds as "-m" means the changes between all
legs of a merge commit are displayed. However, without this, conflict
resolution changed as part of the merge commit would be skipped."
Please let us know your thoughts/suggestions.
Thanks,
Kalyan