Bug 165155 - No failonerror while fetching source from repository
Summary: No failonerror while fetching source from repository
Status: RESOLVED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 157137 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-20 09:23 EST by Prince Singh CLA
Modified: 2018-11-13 07:27 EST (History)
2 users (show)

See Also:


Attachments
Patch implementing the improvement (4.40 KB, patch)
2006-12-14 11:12 EST, Pascal Rapicault CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Prince Singh CLA 2006-11-20 09:23:14 EST
in org.eclipse.pde.internal.build.fetch.CVSFetchTaskFactory.java
CVS checkout task does not set the attribute failonerror="true". Now since it defaults to false, therefore even if there is failure in exporting code from repository, the build tries to continue and then fails. Its difficult to find out at that point why it has failed.

Suggestion:-
   by default failonerror="true". Allow optional from build.properties or maps arguments.

Prince Singh
Drishti Soft Solutions Pvt Ltd
Comment 1 Pascal Rapicault CLA 2006-12-14 11:12:05 EST
Created attachment 55684 [details]
Patch implementing the improvement

This patch implement a generalized version of the proposed improvement. With this, users can set the property failOnFetchError to cause a build failure.
The property has to be honored by all repository providers thus changing the API contract.
Comment 2 Pascal Rapicault CLA 2006-12-15 09:07:49 EST
Andrew, could you please review.
Comment 3 Prince Singh CLA 2006-12-15 10:57:32 EST
(In reply to comment #1)
Seems fine to me.

Prince Singh
Drishti Soft Solutions Pvt Ltd

Comment 4 Chris Aniszczyk CLA 2006-12-18 21:55:23 EST
this looks like a reasonable and simple change, thoughts Andrew?
Comment 5 Andrew Niefer CLA 2006-12-18 23:53:05 EST
A couple of things:
In the COPYFetchTasksFactory.printCopyTask, there is already a failonerror being printed (see 2 lines up), the method takes a boolean parameter for that attribute.  It will need to change to either take a string (property) or to take nothing and just print the property.  

As well, I think the FetchScriptGenerator should probably write out a default  value for failOnFetchError at the top of the fetch script in case it isn't set in the build configuration build.properties
Comment 6 Pascal Rapicault CLA 2006-12-19 08:38:29 EST
Agreed on printing a default value. I did not print it because it seems that ant behaves nicely when the property is left undefined.
Comment 7 Pascal Rapicault CLA 2006-12-19 09:02:54 EST
*** Bug 157137 has been marked as a duplicate of this bug. ***
Comment 8 Pascal Rapicault CLA 2007-04-24 17:20:23 EDT
I have played with this and it turns out that the patch is far from being sufficient because there are cases where the fetch is expected to fail, therefore no build would ever be able to succeed with such a setup.
The example where the fetch is expected to fail is when one used the "fragment@" tag in his map file but where the actual file in the repo is a manifest.mf. For obvious backward compatibility reason we first try to get the fragment.xml and then the manifest.mf. This attempt to dl the fragment.xml could only be avoided by correcting all the map files to use the type (i.e. "bundle@").

Andrew and I believe that the solution could consist in updating the fetch factory api to have the generateRetrieve* methods take an additional parameter saying whether or not the fetch is expected to fail.

Unmarking 3.3 because this would require api changes and the impact of the solution is broader than what we want at this stage.
Comment 9 Lars Vogel CLA 2018-11-13 07:27:11 EST
Mass change for PDE Build bugs tagged with "helpwanted". PDE build is not actively enhanced, hence I close these bugs as wontfix. Please reopen if you want to contribute a patch.