Bug 394709 - copy artifacts from another project fails if the project from which to copy is running
Summary: copy artifacts from another project fails if the project from which to copy i...
Status: REOPENED
Alias: None
Product: Hudson
Classification: Technology
Component: Plugins (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Bob Foster CLA
QA Contact: Geoff Waymark CLA
URL:
Whiteboard: candidate-3.1.1
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-20 15:49 EST by Daniel Desjardins CLA
Modified: 2013-11-05 17:09 EST (History)
6 users (show)

See Also:


Attachments
My configuration (12.60 KB, image/png)
2013-03-12 12:12 EDT, Daniel Desjardins CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Desjardins CLA 2012-11-20 15:49:17 EST
With Hudson 3.0.0 RC-4, when Hudson process A have a build task "Copy artifacts from another project" to get "Latest successful build" from Hudson process B; if the Hudson process B has successful build artifacts BUT is running at the time process A tries to get the artifacts, then the process A will fail.
Comment 1 Winston Prakash CLA 2013-03-06 19:43:22 EST
Hi Daniel, which version of copyArtifacts plugin you have. I tested  with 1.25-h-1 and could not reproduce the issue you mentioned.

This is how I tested

- Created job A and specified some files as artifacts
- Created job B and specified to copy the artifacts from A only from the last successful build. It's build is only to copy artifacts.

- Created few builds of A. Build #11 successful but build #13 failed.
- Started build  #14 of job A
- While build #14 of job A was continuing, I started Job B. It successfully copied the artifacts from build #11 (last successful build of Job A)

Started by user anonymous
Copied 2 artifacts from "Test" build number 11
Finished: SUCCESS


I don't see any issue. Please explain what exact issue you are facing.
Comment 2 Daniel Desjardins CLA 2013-03-11 13:42:09 EDT
Hello,
I am using version 1.25-h-1.

I use the parameters "Specified by permalink" Permalink: Last Build.

I want my process to fail if the build from which I copy artifacts hasn't created archives.

I just had the issue this morning, my build process B failed because build process A was still running.

Thanks for looking into this.
Comment 3 Winston Prakash CLA 2013-03-12 11:56:48 EDT
Hi Daniel, could you please explain more on "I use the parameters "Specified by permalink" Permalink: Last Build". Are you using any plugin to set this?
Comment 4 Daniel Desjardins CLA 2013-03-12 12:09:46 EDT
Hello,
the copyArtifacts plugin has a few parameters. By default it is configured to copy the latest "successful build". But you can change the parameters to take another one, for example a build that was marked specially, etc. I use the parameter to take the latest build.

I will add a screen shot.
Comment 5 Daniel Desjardins CLA 2013-03-12 12:12:37 EDT
Created attachment 228277 [details]
My configuration

see my parameters.
Comment 6 Geoff Waymark CLA 2013-04-08 12:33:03 EDT
With the schedule tight to the release of Kepler we are concentrating on new features in Hudson. 

The bugs assigned for fixing in 3.0.2 will now be fixed as part of the 3.1.0 release due June 26th.

Please raise anything you think to be too important to wait by adding a comment to the bug.
Comment 7 Bob Foster CLA 2013-07-17 16:27:22 EDT
The configuration you attached conflicts with the stated goal. You asked for the last build, not the latest successful build. If the last build is running at the time A runs and hasn't produced artifacts yet, sure enough, A will fail.

If you set up copy artifacts from "Latest successful build", it will work fine.

If you truly want the artifacts from the "latest build", and to have job A fail if the latest build doesn't produce artifacts, you should use the parameterized trigger plugin in B to trigger A Always (be sure to check "Trigger build without parameters"). Then A won't run until last B build ends, but will run regardless of build status.
Comment 8 Daniel Desjardins CLA 2013-07-17 16:40:40 EDT
Then I guess my issue is then a request to have a new option like 'Latest completed build'?
I don't see how much it makes sense to be able to link to something that will sometime not be available, what do you think?
Comment 9 Bob Foster CLA 2013-07-18 00:18:52 EDT
No, but I don't understand why using the parameterized trigger plugin as I described earlier or using "Copy from WORKSPACE of latest completed build" won't solve your problem without any new options.
Comment 10 Daniel Desjardins CLA 2013-07-18 14:55:22 EDT
Wow, that was a stupid question...sorry. 
I never realized there was this option "Copy from WORKSPACE of latest completed build".

This solves my problem.

Thank you very much!
Comment 11 Daniel Desjardins CLA 2013-07-18 16:10:00 EDT
Ooups, this actually doesn't solve my problem.

I made the modification to my processes.
So Process A, tries to gets the artifacts from Process B with the setting "Copy from WORKSPACE of latest completed build".

Now pretty much exactly at the same time that Process A runs, process B kicks in again and starts a new build of itself (build 630).

Meanwhile in Process A, I got 
Copied 0 artifacts from "Voyager(trunk)Eclipse-Encryption-Hook-feature-CI-Daily" build number 629

Why?

I just re-ran the Process A and this times it goes through and successfully gets the 1 artifact from my Process B.

So apparently I can get in the same kind of "timing" issue with the setting "Copy from WORKSPACE of latest completed build".

I don't want to be forced to put all my processes as dependencies in my process A, getting artifacts should just work in my opinion.
Comment 12 Bob Foster CLA 2013-07-18 17:19:04 EDT
I don't know why Copy from WORKSPACE of latest completed build didn't work as you expected, except of course if you had no latest completed build.

But I don't agree that "copy artifacts should just work". You are essentially asking for job B to wait for job A's latest build to complete and fail if A produced no artifacts, an effect you can easily get by from the parameterized trigger plugin by launching the B build whenever an A build completes (Always/no parameters).
Comment 13 Bob Foster CLA 2013-07-18 17:22:44 EDT
But perhaps I just don't understand your setup. What triggers B? Does B do something useful before it gets artifacts from A?
Comment 14 Daniel Desjardins CLA 2013-08-14 16:48:11 EDT
Hello,
perhaps we have different expectations here.

To answer your question, process A doesn't do much before getting the files from B, it checks out additional files and then gets the artifacts from B (and from C, D, an Z), then does something useful with all of them.

The problem is that B, C, D and Z are triggered on commits, do validations and produce outputs. 

Sometime C may take longer than B to complete, sometime B will take longer than C to complete, but only B triggers A.

There lies my problem that I never quite know for sure if B, C, D and Z are completed when I start running A. It could even be so that C is relaunched during the running of A, therefore causing the artifacts of "latest successful build" to not be available before the build is not completed yet.

My expectation is that I should be able to get the archived artifacts from a build from the latest successful (or completed) build, whatever the process is running or not. To me a running process is neither successful nor completed...

What am I missing?
Comment 15 Duncan Mills CLA 2013-08-23 07:54:01 EDT
Bulk deferral to 3.1.1