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
<https://github.com/gvasko/copyartifact-plugin/commit/2ecfd4a4a79e7237b179b7143f60dbca270207a0>
.
I've found a related issue
<https://issues.jenkins-ci.org/browse/JENKINS-16847> for MultiJobs, but my
change doesn't seem to help on that.
Thank you,
Gabor
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/19ee140d-434d-4968-8bb4-3ed646c80e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.