CopyArtifact/Upstream-build-strategy with overlapping executions

12 views
Skip to first unread message

Gabor Vasko-Szedlar

unread,
Oct 14, 2015, 1:50:55 PM10/14/15
to Jenkins Developers
Hi,

The CopyArtifact plugin with 'Upstream build that triggered this job' works fine for us for a chain of jobs when the build started with the first job that triggers the next one, which triggers the next, and so on. The advantage of the Upstream-build strategy is that it works even with overlapping chains of builds. But there is a problem when we have overlapping chains and the build is started with an intermediate job.

Let's consider a simple scenario: each job triggers the next one
  • ModuleA --> ModuleB --> Publisher
where
  • ModuleB depends on artifacts of ModuleA (using the Upstream-build strategy),
  • Publisher copies artifacts from ModuleA and ModuleB (using the Upstream-build strategy),
  • ModuleB needs significantly more time to build than ModuleA, so ModuleA can build while a ModuleB build is running.

Example execution:
  1. ModuleA#1 is triggered by SCM, builds successfully.
  2. ModuleB#1 is triggered by ModuleA#1, copies its artifacts and builds successfully.
  3. Publisher#1 is triggered by ModuleB#1, copies artifacts from ModuleA#1 and ModuleB#1.
  4. ModuleB#2 is triggered by SCM, copies artifacts from ModuleA#1 (fallback to last successful), build started...
  5. ModuleA#2 is triggered by SCM, builds successfully.
  6. ... ModuleB#2 finished.
  7. Publisher#2 is triggered by ModuleB#2, copies artifacts from ModuleB#2 and ModuleA#2 (fallback) instead of ModuleA#1, which ModuleB#2 depends on.
  8. ModuleB#3 and Publisher#3 works as expected.
   
This scenario happens more easily if the chain is longer and contains more than 3 jobs.
The problem here is the inconsistent builds (here the Publisher), or the violated isolation of build chains.

I hope what I've written so far is a reasonable issue.

What I found to this is that, the Upstream-build strategy in CopyArtifact plugin could include the upstream builds of the target build, not just the builds that triggered it. I have implemented this change introducing an additional checkbox for this, tried on a local Jenkins installation and seems working.

Could someone help me how to continue?
Should we test the change more thoroughly in our CI system before a pull request?
The change can be found here.

I've found a related issue for MultiJobs, but my change doesn't seem to help on that.

Thank you,
Gabor

Ikedam

unread,
Oct 15, 2015, 6:27:41 AM10/15/15
to Jenkins Developers
Please send a pull request.
I'll review that.

Regards,
ikedam

Reply all
Reply to author
Forward
0 new messages